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

[#5071] Improvement (test): Add integration tests for Trino cascading queries #5073

Open
wants to merge 18 commits into
base: main
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
10 changes: 6 additions & 4 deletions .github/workflows/trino-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:

- name: Package Gravitino
run: |
./gradlew compileDistribution -x test -PjdkVersion=${{ matrix.java-version }}
./gradlew compileDistribution compileTrinoConnector -x test -PjdkVersion=${{ matrix.java-version }}

- name: Free up disk space
run: |
Expand All @@ -87,6 +87,7 @@ jobs:
run: |
./gradlew -PskipTests -PtestMode=embedded -PjdkVersion=${{ matrix.java-version }} -PskipDockerTests=false :trino-connector:integration-test:test
./gradlew -PskipTests -PtestMode=deploy -PjdkVersion=${{ matrix.java-version }} -PskipDockerTests=false :trino-connector:integration-test:test
trino-connector/integration-test/trino-test-tools/run_test.sh

- name: Upload integrate tests reports
uses: actions/upload-artifact@v3
Expand All @@ -95,10 +96,11 @@ jobs:
name: trino-connector-integrate-test-reports-${{ matrix.java-version }}
path: |
build/reports
trino-connector/integrate-test/build/*.log
trino-connector/integrate-test/build/*.tar
trino-connector/integration-test/build/*.log
trino-connector/integration-test/build/*.tar
trino-connector/integration-test/build/trino-cascading-env
integration-test-common/build/trino-ci-container-log
distribution/package/logs/gravitino-server.out
distribution/package/logs/gravitino-server.log
catalogs/**/*.log
catalogs/**/*.tar
catalogs/**/*.tar
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,9 @@ tasks.rat {
"dev/docker/kerberos-hive/kadm5.acl",
"**/*.log",
"**/*.out",
"**/testsets",
"**/trino-ci-testset",
"**/licenses/*.txt",
"**/licenses/*.md",
"integration-test/**/*.sql",
"integration-test/**/*.txt",
"docs/**/*.md",
"spark-connector/spark-common/src/test/resources/**",
"web/web/.**",
Expand Down
6 changes: 4 additions & 2 deletions integration-test-common/docker-script/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
cd "$(dirname "$0")"

LOG_DIR=../build/trino-ci-container-log
docker cp trino-ci-hive:/usr/local/hadoop/logs $LOG_DIR/hdfs
docker cp trino-ci-hive:/tmp/root $LOG_DIR/hive
if [ -d $LOG_DIR ]; then
docker cp trino-ci-hive:/usr/local/hadoop/logs $LOG_DIR/hdfs
docker cp trino-ci-hive:/tmp/root $LOG_DIR/hive
fi

docker compose down
2 changes: 1 addition & 1 deletion trino-connector/integration-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ tasks.test {

tasks.register<JavaExec>("TrinoTest") {
classpath = sourceSets["test"].runtimeClasspath
mainClass.set("org.apache.gravitino.integration.test.trino.TrinoQueryTestTool")
mainClass.set("org.apache.gravitino.trino.connector.integration.test.TrinoQueryTestTool")

if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
jvmArgs = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ public class TrinoQueryIT extends TrinoQueryITBase {
static {
testsetsDir = TrinoQueryIT.class.getClassLoader().getResource("trino-ci-testset").getPath();
testsetsDir = ITUtils.joinPath(testsetsDir, "testsets");

ciTestsets.add("hive");
ciTestsets.add("lakehouse-iceberg");
ciTestsets.add("jdbc-mysql");
ciTestsets.add("jdbc-postgresql");
ciTestsets.add("tpch");
}

@BeforeAll
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
select count(*) from call_center;
select count(*) from catalog_page;
select count(*) from catalog_returns;
select count(*) from catalog_sales;
select count(*) from customer;
select count(*) from customer_address;
select count(*) from customer_demographics;
select count(*) from date_dim;
select count(*) from household_demographics;
select count(*) from income_band;
select count(*) from inventory;
select count(*) from item;
select count(*) from promotion;
select count(*) from reason;
select count(*) from ship_mode;
select count(*) from store;
select count(*) from store_returns;
select count(*) from store_sales;
select count(*) from time_dim;
select count(*) from warehouse;
select count(*) from web_page;
select count(*) from web_returns;
select count(*) from web_sales;
select count(*) from web_site;

SELECT * FROM call_center ORDER BY cc_call_center_sk, cc_call_center_id, cc_rec_start_date LIMIT 10;

SELECT * FROM catalog_page ORDER BY cp_catalog_page_sk, cp_catalog_page_id, cp_start_date_sk LIMIT 10;

SELECT * FROM catalog_returns ORDER BY cr_returned_date_sk, cr_returned_time_sk, cr_item_sk LIMIT 10;

SELECT * FROM catalog_sales ORDER BY cs_sold_date_sk, cs_sold_time_sk, cs_ship_date_sk LIMIT 10;

SELECT * FROM customer ORDER BY c_customer_sk, c_customer_id, c_current_cdemo_sk LIMIT 10;

SELECT * FROM customer_address ORDER BY ca_address_sk, ca_address_id, ca_street_number LIMIT 10;

SELECT * FROM customer_demographics ORDER BY cd_demo_sk, cd_gender, cd_marital_status LIMIT 10;

SELECT * FROM date_dim ORDER BY d_date_sk, d_date_id, d_date LIMIT 10;

SELECT * FROM household_demographics ORDER BY hd_demo_sk, hd_income_band_sk, hd_buy_potential LIMIT 10;

SELECT * FROM income_band ORDER BY ib_income_band_sk, ib_lower_bound, ib_upper_bound LIMIT 10;

SELECT * FROM inventory ORDER BY inv_date_sk, inv_item_sk, inv_warehouse_sk LIMIT 10;

SELECT * FROM item ORDER BY i_item_sk, i_item_id, i_rec_start_date LIMIT 10;

SELECT * FROM promotion ORDER BY p_promo_sk, p_promo_id, p_start_date_sk LIMIT 10;

SELECT * FROM reason ORDER BY r_reason_sk, r_reason_id, r_reason_desc LIMIT 10;

SELECT * FROM ship_mode ORDER BY sm_ship_mode_sk, sm_ship_mode_id, sm_type LIMIT 10;

SELECT * FROM store ORDER BY s_store_sk, s_store_id, s_rec_start_date LIMIT 10;

SELECT * FROM store_returns ORDER BY sr_returned_date_sk, sr_return_time_sk, sr_item_sk LIMIT 10;

SELECT * FROM store_sales ORDER BY ss_sold_date_sk, ss_sold_time_sk, ss_item_sk LIMIT 10;

SELECT * FROM time_dim ORDER BY t_time_sk, t_time_id, t_time LIMIT 10;

SELECT * FROM warehouse ORDER BY w_warehouse_sk, w_warehouse_id, w_warehouse_name LIMIT 10;

SELECT * FROM web_page ORDER BY wp_web_page_sk, wp_web_page_id, wp_rec_start_date LIMIT 10;

SELECT * FROM web_returns ORDER BY wr_returned_date_sk, wr_returned_time_sk, wr_item_sk LIMIT 10;

SELECT * FROM web_sales ORDER BY ws_sold_date_sk, ws_sold_time_sk, ws_ship_date_sk LIMIT 10;

SELECT * FROM web_site ORDER BY web_site_sk, web_site_id, web_rec_start_date LIMIT 10;
Loading
Loading