Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
superbear committed Nov 22, 2022
1 parent af06447 commit 16a5f59
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Trino(PrestoSQL) Plugin in Go

## Requirements
- Java 17.0.4+, 64-bit
- https://github.com/superbear/java-call-go

## How to build

### Build JAR
```bash
mvn clean package -Dcheckstyle.skipExec=true -DskipTests
```
This creates a `target/trino-plugin-in-go-402` directory.

### Test
```bash
mvn clean test -Dcheckstyle.skipExec=true
```

## Running the container
```bash
docker compose up -d

docker exec -ti trino trino

# restart container after rebuild plugin
docker restart trino
```

```sql
trino> SELECT atoi('123');
trino> SELECT toupper('hello world');
```

## References
- [Trino Plugin implementation](https://trino.io/docs/current/develop/functions.html#plugin-implementation)
- [Trino](https://github.com/trinodb/trino/blob/master/core/trino-main/src/main/java/io/trino/operator/scalar/StringFunctions.java)
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
version: '2.1'
version: "3"

services:
trino:
image: trinodb/trino:402
container_name: trino
volumes:
- ./target/trino-plugin-in-go-402:/lib/trino/plugin/trino-plugin-in-go-402
ports:
Expand Down

0 comments on commit 16a5f59

Please sign in to comment.