feat: add presto
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
f345a956c9
commit
026a95790e
5
connect-to-presto.sh
Executable file
5
connect-to-presto.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/zsh
|
||||
|
||||
set -eu
|
||||
|
||||
./docker-exec.sh exec presto presto-cli --server localhost:8080 --execute 'select count(*) from iceberg.demo_db.demo_table;'
|
@ -4,5 +4,6 @@ docker compose \
|
||||
-f templates/docker-compose.rising-wave.yaml \
|
||||
-f templates/docker-compose.iceberg.yaml \
|
||||
-f templates/docker-compose.clickhouse.yaml \
|
||||
-f templates/docker-compose.trino.yaml \
|
||||
-f templates/docker-compose.yaml \
|
||||
$@
|
||||
|
13
prepare.sh
Executable file
13
prepare.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/zsh
|
||||
|
||||
set -eu
|
||||
|
||||
|
||||
psql -h 0.0.0.0 -p 4566 -d dev -U root -f templates/create_sources.sql || true
|
||||
psql -h 0.0.0.0 -p 4566 -d dev -U root -f templates/create_mvs.sql || true
|
||||
psql -h 0.0.0.0 -p 4566 -d dev -U root -f templates/create_create_iceberg_sink.sql || true
|
||||
psql -h 0.0.0.0 -p 4566 -d dev -U root -f templates/create_create_clickhouse_sink.sql || true
|
||||
|
||||
./docker-exec.sh exec spark bash /spark-script/run_sql.sh create-table
|
||||
./docker-exec.sh exec spark bash /spark-script/run_sql.sh query-table
|
||||
|
@ -29,6 +29,7 @@ services:
|
||||
- SPARK_MASTER_URL=spark://spark:7077
|
||||
- SPARK_WORKER_MEMORY=1G
|
||||
- SPARK_WORKER_CORES=1
|
||||
|
||||
configs:
|
||||
run_sql:
|
||||
content: |
|
||||
|
20
templates/docker-compose.trino.yaml
Normal file
20
templates/docker-compose.trino.yaml
Normal file
@ -0,0 +1,20 @@
|
||||
services:
|
||||
presto:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: presto.Dockerfile
|
||||
container_name: presto
|
||||
|
||||
# trino:
|
||||
# image: trinodb/trino
|
||||
# ports:
|
||||
# - 18080:8080
|
||||
# configs:
|
||||
# - source: iceberg_properties
|
||||
# target: /etc/catalog/iceberg.properties
|
||||
# configs:
|
||||
# iceberg_properties:
|
||||
# content: |
|
||||
# connector.name=iceberg
|
||||
# hive.metastore.uri=thrift://192.0.2.3:9083
|
||||
|
22
templates/hadoop-catalog.xml
Normal file
22
templates/hadoop-catalog.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<configuration>
|
||||
<property>
|
||||
<name>presto.s3.endpoint</name>
|
||||
<value>http://minio-0:9301</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>presto.s3.path-style-access</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>presto.s3.access-key</name>
|
||||
<value>hummockadmin</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>presto.s3.secret-key</name>
|
||||
<value>hummockadmin</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>fs.s3a.impl</name>
|
||||
<value>com.facebook.presto.hive.s3.PrestoS3FileSystem</value>
|
||||
</property>
|
||||
</configuration>
|
5
templates/iceberg.properties
Normal file
5
templates/iceberg.properties
Normal file
@ -0,0 +1,5 @@
|
||||
connector.name=iceberg
|
||||
iceberg.catalog.type=hadoop
|
||||
iceberg.catalog.warehouse=s3a://hummock001/iceberg-data
|
||||
iceberg.hadoop.config.resources=/etc/iceberg/conf/hadoop-catalog.xml
|
||||
hive.config.resources=/etc/iceberg/conf/hadoop-catalog.xml
|
2
templates/log.properties
Normal file
2
templates/log.properties
Normal file
@ -0,0 +1,2 @@
|
||||
com.facebook.presto=DEBUG
|
||||
org.apache.hadoop=DEBUG
|
5
templates/presto.Dockerfile
Normal file
5
templates/presto.Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM prestodb/presto
|
||||
|
||||
COPY ./iceberg.properties /opt/presto-server/etc/catalog
|
||||
COPY ./log.properties /opt/presto-server/etc
|
||||
COPY ./hadoop-catalog.xml /etc/iceberg/conf/hadoop-catalog.xml
|
Loading…
Reference in New Issue
Block a user