-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What changes were proposed in this pull request? 1. Add HiveContainer and TrinoContainer 3. Use Trino JDBC to connect TrinoContainer execute create database, table, insert, select and join two tables test. ### Why are the changes needed? + Through Trino operations hive + Supports Trino E2E testing in the local and GitHub Action. Fix: #434 ### Does this PR introduce _any_ user-facing change? N/A ### How was this patch tested? Add TrinoConnectorIT in the Integration-test
- Loading branch information
Showing
31 changed files
with
1,376 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- | ||
Copyright 2023 Datastrato. | ||
This software is licensed under the Apache License version 2. | ||
--> | ||
|
||
# Mac Docker Connector | ||
Because Docker Desktop for Mac does not provide access to container IP from host(macOS). | ||
This can result in host(macOS) and containers not being able to access each other's internal services directly over IPs. | ||
The [mac-docker-connector](https://github.com/wenjunxiao/mac-docker-connector) provides the ability for the macOS host to directly access the docker container IP. | ||
Before running the integration tests, make sure to execute the `dev/docker/tools/mac-docker-connector.sh` script. | ||
> Developing Gravitino in a linux environment does not have this limitation and does not require executing the `mac-docker-connector.sh` script ahead of time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
#set -ex | ||
|
||
bin="$(dirname "${BASH_SOURCE-$0}")" | ||
bin="$(cd "${bin}">/dev/null; pwd)" | ||
|
||
OS=$(uname -s) | ||
if [ "${OS}" != "Darwin" ]; then | ||
echo "Only macOS needs to run mac-docker-connector." | ||
exit 1 | ||
fi | ||
|
||
if pgrep -xq "docker-connector"; then | ||
echo "docker-connector is running." | ||
exit 1 | ||
fi | ||
|
||
# Download docker-connector | ||
DOCKER_CONNECTOR_PACKAGE_NAME="docker-connector-darwin.tar.gz" | ||
DOCKER_CONNECTOR_DOWNLOAD_URL="https://github.com/wenjunxiao/mac-docker-connector/releases/download/v3.2/${DOCKER_CONNECTOR_PACKAGE_NAME}" | ||
if [ ! -f "${bin}/docker-connector" ]; then | ||
wget -q -P "${bin}" ${DOCKER_CONNECTOR_DOWNLOAD_URL} | ||
tar -xzf "${bin}/${DOCKER_CONNECTOR_PACKAGE_NAME}" -C "${bin}" | ||
rm -rf "${bin}/${DOCKER_CONNECTOR_PACKAGE_NAME}" | ||
fi | ||
|
||
# Create a docker-connector.conf file with the routes to the docker networks | ||
if [ ! -f "${bin}/docker-connector.conf" ]; then | ||
docker network ls --filter driver=bridge --format "{{.ID}}" | xargs docker network inspect --format "route {{range .IPAM.Config}}{{.Subnet}}{{end}}" > ${bin}/docker-connector.conf | ||
fi | ||
|
||
echo "Start docker-connector requires root privileges, Please enter the root password." | ||
sudo ${bin}/docker-connector -config ${bin}/docker-connector.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = gravitino | ||
gravitino.uri = http://GRAVITINO_HOST_IP:GRAVITINO_HOST_PORT | ||
gravitino.metalake = GRAVITINO_METALAKE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = hive | ||
hive.metastore.uri = thrift://HIVE_HOST_IP:9083 | ||
hive.allow-drop-table = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = jmx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = tpcds | ||
tpcds.splits-per-node = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
connector.name = tpch | ||
tpch.splits-per-node = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
#single node install config | ||
#coordinator = true | ||
#node-scheduler.include-coordinator = true | ||
#http-server.http.port = 8080 | ||
#discovery-server.enabled = true | ||
#discovery.uri = http://localhost:8080 | ||
#protocol.v1.alternate-header-name = Presto | ||
#hive.hdfs.impersonation.enabled = true | ||
coordinator = true | ||
node-scheduler.include-coordinator = true | ||
http-server.http.port = 8080 | ||
discovery.uri = http://0.0.0.0:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
-server | ||
-Xmx1G | ||
-XX:-UseBiasedLocking | ||
-XX:+UseG1GC | ||
-XX:G1HeapRegionSize=32M | ||
-XX:+ExplicitGCInvokesConcurrent | ||
-XX:+HeapDumpOnOutOfMemoryError | ||
-XX:+UseGCOverheadLimit | ||
-XX:+ExitOnOutOfMemoryError | ||
-XX:ReservedCodeCacheSize=256M | ||
-Djdk.attach.allowAttachSelf=true | ||
-Djdk.nio.maxCachedBufferSize=2000000 | ||
-DHADOOP_USER_NAME=hive | ||
-Dlog4j.configurationFile=/etc/trino/log4j2.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
# Enable verbose logging from Trino | ||
io.trino = INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
|
||
# Set to debug or trace if log4j initialization is failing | ||
status = info | ||
|
||
# Name of the configuration | ||
name = ConsoleLogConfig | ||
|
||
# Console appender configuration | ||
appender.console.type = Console | ||
appender.console.name = consoleLogger | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | ||
|
||
# File appender configuration | ||
appender.file.type = File | ||
appender.file.name = fileLogger | ||
appender.file.fileName = gravitino-trino-connector.log | ||
appender.file.layout.type = PatternLayout | ||
appender.file.layout.pattern = %d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n | ||
|
||
# Root logger level | ||
rootLogger.level = info | ||
|
||
# Root logger referring to console and file appenders | ||
rootLogger.appenderRef.stdout.ref = consoleLogger | ||
rootLogger.appenderRef.file.ref = fileLogger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright 2023 Datastrato. | ||
# This software is licensed under the Apache License version 2. | ||
# | ||
node.environment = docker | ||
node.data-dir = /data/trino | ||
plugin.dir = /usr/lib/trino/plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.