forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test](jdbc) add jdbc and hive regression test (apache#13143)
1. Modify default behavior of `build.sh` The `BUILD_JAVA_UDF` is default ON, so that jvm is needed for compilation and runtime. 2. Add docker-compose for MySQL 5.7, PostgreSQL 14 and Hive 2 See `docker/thirdparties/docker-compose`. 3. Add some regression test cases for jdbc query on MySQL, PG and Hive Catalog The default is `false`, if set to true, you need first start docker for MySQL/PG/Hive. 4. Support `if not exists` and `if exists` for create/drop resource and create/drop encryptkey
- Loading branch information
1 parent
ccc0421
commit 847b80e
Showing
51 changed files
with
26,302 additions
and
71 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
File renamed without changes.
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,40 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
#################################################################### | ||
# This script will generate hadoop-hive.env from hadoop-hive.env.tpl | ||
#################################################################### | ||
|
||
set -eo pipefail | ||
|
||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" | ||
|
||
FS_PORT=8120 | ||
HMS_PORT=9183 | ||
|
||
cp "${ROOT}"/hadoop-hive.env.tpl "${ROOT}"/hadoop-hive.env | ||
# Need to set hostname of container to same as host machine's. | ||
# Otherwise, the doris process can not connect to namenode directly. | ||
HOST_NAME=$(hostname) | ||
|
||
{ | ||
echo "FS_PORT=${FS_PORT}" | ||
echo "HMS_PORT=${HMS_PORT}" | ||
echo "CORE_CONF_fs_defaultFS=hdfs://${HOST_NAME}:${FS_PORT}" | ||
echo "HOST_NAME=${HOST_NAME}" | ||
} >>"${ROOT}"/hadoop-hive.env |
50 changes: 50 additions & 0 deletions
50
docker/thirdparties/docker-compose/hive/hadoop-hive.env.tpl
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,50 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
HIVE_SITE_CONF_javax_jdo_option_ConnectionURL=jdbc:postgresql://doris--hive-metastore-postgresql/metastore | ||
HIVE_SITE_CONF_javax_jdo_option_ConnectionDriverName=org.postgresql.Driver | ||
HIVE_SITE_CONF_javax_jdo_option_ConnectionUserName=hive | ||
HIVE_SITE_CONF_javax_jdo_option_ConnectionPassword=hive | ||
HIVE_SITE_CONF_datanucleus_autoCreateSchema=false | ||
HIVE_SITE_CONF_hive_metastore_uris=thrift://doris--hive-metastore:9083 | ||
HDFS_CONF_dfs_namenode_datanode_registration_ip___hostname___check=false | ||
HIVE_SITE_CONF_hive_server2_thrift_bind_host=0.0.0.0 | ||
HIVE_SITE_CONF_hive_server2_thrift_port=10000 | ||
|
||
CORE_CONF_hadoop_http_staticuser_user=root | ||
CORE_CONF_hadoop_proxyuser_hue_hosts=* | ||
CORE_CONF_hadoop_proxyuser_hue_groups=* | ||
CORE_CONF_hadoop_proxyuser_hive_hosts=* | ||
|
||
HDFS_CONF_dfs_webhdfs_enabled=true | ||
HDFS_CONF_dfs_permissions_enabled=false | ||
|
||
YARN_CONF_yarn_log___aggregation___enable=true | ||
YARN_CONF_yarn_resourcemanager_recovery_enabled=true | ||
YARN_CONF_yarn_resourcemanager_store_class=org.apache.hadoop.yarn.server.resourcemanager.recovery.FileSystemRMStateStore | ||
YARN_CONF_yarn_resourcemanager_fs_state___store_uri=/rmstate | ||
YARN_CONF_yarn_nodemanager_remote___app___log___dir=/app-logs | ||
YARN_CONF_yarn_log_server_url=http://historyserver:8188/applicationhistory/logs/ | ||
YARN_CONF_yarn_timeline___service_enabled=true | ||
YARN_CONF_yarn_timeline___service_generic___application___history_enabled=true | ||
YARN_CONF_yarn_resourcemanager_system___metrics___publisher_enabled=true | ||
YARN_CONF_yarn_resourcemanager_hostname=resourcemanager | ||
YARN_CONF_yarn_timeline___service_hostname=historyserver | ||
YARN_CONF_yarn_resourcemanager_address=resourcemanager:8032 | ||
YARN_CONF_yarn_resourcemanager_scheduler_address=resourcemanager:8030 | ||
YARN_CONF_yarn_resourcemanager_resource__tracker_address=resourcemanager:8031 | ||
|
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,122 @@ | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
version: "3.8" | ||
|
||
services: | ||
doris--namenode: | ||
image: bde2020/hadoop-namenode:2.0.0-hadoop2.7.4-java8 | ||
environment: | ||
- CLUSTER_NAME=test | ||
env_file: | ||
- ./hadoop-hive.env | ||
hostname: ${HOST_NAME} | ||
expose: | ||
- "50070" | ||
- "${FS_PORT}" | ||
ports: | ||
- target: ${FS_PORT} | ||
published: ${FS_PORT} | ||
protocol: tcp | ||
mode: host | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://localhost:50070/" ] | ||
interval: 5s | ||
timeout: 60s | ||
retries: 120 | ||
networks: | ||
- doris--hive | ||
doris--datanode: | ||
image: bde2020/hadoop-datanode:2.0.0-hadoop2.7.4-java8 | ||
env_file: | ||
- ./hadoop-hive.env | ||
environment: | ||
SERVICE_PRECONDITION: "doris--namenode:50070" | ||
expose: | ||
- "50075" | ||
healthcheck: | ||
test: [ "CMD", "curl", "http://localhost:50075" ] | ||
interval: 5s | ||
timeout: 60s | ||
retries: 120 | ||
networks: | ||
- doris--hive | ||
doris--hive-server: | ||
image: bde2020/hive:2.3.2-postgresql-metastore | ||
env_file: | ||
- ./hadoop-hive.env | ||
environment: | ||
HIVE_CORE_CONF_javax_jdo_option_ConnectionURL: "jdbc:postgresql://doris--hive-metastore-postgresql:5432/metastore" | ||
SERVICE_PRECONDITION: "doris--hive-metastore:9083" | ||
expose: | ||
- "10000" | ||
depends_on: | ||
doris--datanode: | ||
condition: service_healthy | ||
doris--namenode: | ||
condition: service_healthy | ||
healthcheck: | ||
test: beeline -u "jdbc:hive2://127.0.0.1:10000/default" -n health_check -e "show databases;" | ||
interval: 5s | ||
timeout: 60s | ||
retries: 120 | ||
networks: | ||
- doris--hive | ||
doris--hive-metastore: | ||
image: bde2020/hive:2.3.2-postgresql-metastore | ||
env_file: | ||
- ./hadoop-hive.env | ||
command: ["sh","-c","/mnt/scripts/hive-metastore.sh"] | ||
environment: | ||
SERVICE_PRECONDITION: "doris--namenode:50070 doris--datanode:50075 doris--hive-metastore-postgresql:5432" | ||
expose: | ||
- "9083" | ||
ports: | ||
- ${HMS_PORT}:9083 | ||
volumes: | ||
- ./scripts:/mnt/scripts | ||
depends_on: | ||
doris--hive-metastore-postgresql: | ||
condition: service_healthy | ||
healthcheck: | ||
test: ["CMD", "sh", "-c", "/mnt/scripts/healthy_check.sh"] | ||
interval: 5s | ||
timeout: 60s | ||
retries: 120 | ||
networks: | ||
- doris--hive | ||
doris--hive-metastore-postgresql: | ||
image: bde2020/hive-metastore-postgresql:2.3.0 | ||
expose: | ||
- "5432" | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 60s | ||
retries: 120 | ||
networks: | ||
- doris--hive | ||
hello-world: | ||
image: hello-world | ||
depends_on: | ||
doris--hive-metastore: | ||
condition: service_healthy | ||
networks: | ||
- doris--hive | ||
|
||
networks: | ||
doris--hive: |
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,4 @@ | ||
1. Download parquet file packages from: | ||
https://doris-build-hk-1308700295.cos.ap-hongkong.myqcloud.com/regression/load/tpch1_parquet/tpch1.db.tar.gz | ||
|
||
2. Unzip and name it to "tpch1.db" |
Oops, something went wrong.