Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PrestoSQL to 346 #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To deploy in Docker Swarm:
docker stack deploy -c docker-compose.yml hive
```

To run a PrestoDB 0.181 with Hive connector:
To run PrestoSQL 346 with Hive connector:

```
docker-compose up -d presto-coordinator
Expand All @@ -34,10 +34,10 @@ Load data into Hive:
> LOAD DATA LOCAL INPATH '/opt/hive/examples/files/kv1.txt' OVERWRITE INTO TABLE pokes;
```

Then query it from PrestoDB. You can get [presto.jar](https://prestosql.io/docs/current/installation/cli.html) from PrestoDB website:
Then query it from PrestoDB. You can get [presto.jar](https://prestosql.io/docs/current/installation/cli.html) from PrestoSQL website:
```
$ wget https://repo1.maven.org/maven2/io/prestosql/presto-cli/308/presto-cli-308-executable.jar
$ mv presto-cli-308-executable.jar presto.jar
$ wget https://repo1.maven.org/maven2/io/prestosql/presto-cli/346/presto-cli-346-executable.jar
$ mv presto-cli-346-executable.jar presto.jar
$ chmod +x presto.jar
$ ./presto.jar --server localhost:8080 --catalog hive --schema default
presto> select * from pokes;
Expand All @@ -47,3 +47,4 @@ Then query it from PrestoDB. You can get [presto.jar](https://prestosql.io/docs/
* Ivan Ermilov [@earthquakesan](https://github.com/earthquakesan) (maintainer)
* Yiannis Mouchakis [@gmouchakis](https://github.com/gmouchakis)
* Ke Zhu [@shawnzhu](https://github.com/shawnzhu)
* Eric Semeniuc [@esemeniuc](https://github.com/esemeniuc)
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ services:
hive-metastore-postgresql:
image: bde2020/hive-metastore-postgresql:2.3.0
presto-coordinator:
image: shawnzhu/prestodb:0.181
build: ./presto
depends_on:
- hive-server
- namenode
- datanode
ports:
- "8080:8080"

Expand Down
22 changes: 22 additions & 0 deletions presto/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM bde2020/hadoop-base:latest

ENV PRESTO_VERSION=346
ENV PRESTO_HOME=/opt/presto
WORKDIR ${PRESTO_HOME}

#need java 11 (requires backports for stretch) and python for recent presto
RUN echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list && \
apt update && \
apt install -y openjdk-11-jre python && \
rm -rf /var/lib/apt/lists/*

RUN set -xe && curl -L https://repo1.maven.org/maven2/io/prestosql/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz | tar xz && \
mv presto-server-${PRESTO_VERSION}/* . && \
rmdir presto-server-${PRESTO_VERSION} && \
mkdir -p ${PRESTO_HOME}/data

COPY etc ${PRESTO_HOME}/etc
VOLUME ["${PRESTO_HOME}/etc", "${PRESTO_HOME}/data"]
EXPOSE 8080

CMD ["bin/launcher", "run"]
5 changes: 5 additions & 0 deletions presto/etc/catalog/hive.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
connector.name=hive-hadoop2
hive.metastore.uri=thrift://hive-metastore:9083
hive.allow-register-partition-procedure=true
hive.allow-drop-table=true
hive.config.resources=/etc/hadoop/core-site.xml,/etc/hadoop/hdfs-site.xml
7 changes: 7 additions & 0 deletions presto/etc/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
query.max-memory=5GB
query.max-memory-per-node=1GB
discovery-server.enabled=true
discovery.uri=http://presto-coordinator:8080
13 changes: 13 additions & 0 deletions presto/etc/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-server
-Xmx16G
-XX:-UseBiasedLocking
-XX:+UseG1GC
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+ExitOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
-XX:ReservedCodeCacheSize=512M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
3 changes: 3 additions & 0 deletions presto/etc/node.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node.environment=development
node.id=presto-coordinator
node.data-dir=/opt/presto/data