Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whhe/trino-oceanbase
https://github.com/whhe/trino-oceanbase
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/whhe/trino-oceanbase
- Owner: whhe
- License: apache-2.0
- Created: 2024-08-13T09:35:31.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-15T01:25:33.000Z (3 months ago)
- Last Synced: 2024-10-04T15:36:19.728Z (about 1 month ago)
- Language: Java
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Usage
### Building Plugin
Build requirements
* Java 17.0.4+, 64-bit
Run the following command from the project root directory:
./mvnw clean package -DskipTests
There plugin files should be under the `target` directory.
### Running with Docker
Firstly, start a trino Docker container.
```shell
docker run --name trino -d trinodb/trino:433
```Create `log.properties`.
```text
io.trino=DEBUG
```Create `oceanbase.properties`.
```properties
connector.name=oceanbase
connection-url=jdbc:oceanbase://localhost:2883/${ENV:USER}
connection-user=${ENV:USERNAME}
connection-password=${ENV:PASSWORD}
oceanbase.compatible-mode=oracle
oceanbase.auto-reconnect=true
oceanbase.remarks-reporting.enabled=true
decimal-mapping=ALLOW_OVERFLOW
decimal-rounding-mode=HALF_UP
```Patch plugin and config files to container and restart container.
```shell
# add plugin files
docker cp trino-oceanbase-433 trino:/data/trino/plugin/oceanbase# add log config file
docker cp log.properties trino:/etc/trino# add catalog config file
docker cp oceanbase.properties trino:/etc/trino/catalog# add timezone files
docker cp /usr/share/zoneinfo trino:/usr/share/zoneinfo
docker cp /usr/share/zoneinfo/Asia/Shanghai trino:/etc/localtime# restart container
docker restart trino
```Then you can execute query with the cli.
```shell
docker exec -it trino trino
``````sql
SHOW CATALOGS;
```