World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
Java ai-catalogdata-catalogdatalakefederated-querylakehousemetadatametalakemodel-catalogopendatacatalogskycomputingstratosphere
[#10454] feat(trino-connector): Add multi-version integration test automation (#10455)
Yuhuid7ca3446d3c0
diff --git a/.github/workflows/trino-integration-test.yml b/.github/workflows/trino-integration-test.ymlindex c0176e7dc7..2a1fa90aee 100644--- a/.github/workflows/trino-integration-test.yml+++ b/.github/workflows/trino-integration-test.yml@@ -76,7 +76,17 @@ jobs:- name: Build Gravitinorun: |- ./gradlew build -x test+ ./gradlew build -x test \+ -x :web:web:build -x :web:integration-test:build \+ -x :web-v2:web:build -x :web-v2:integration-test:build \+ -x :clients:client-python:build \+ -x :flink-connector:flink:build \+ -x :spark-connector:spark-common:build \+ -x :spark-connector:spark-3.3:build -x :spark-connector:spark-3.4:build -x :spark-connector:spark-3.5:build \+ -x :spark-connector:spark-runtime-3.3:build -x :spark-connector:spark-runtime-3.4:build -x :spark-connector:spark-runtime-3.5:build \+ -x :mcp-server:build -x :lineage:build \+ -x :maintenance:optimizer:build -x :maintenance:jobs:build \+ -x :lance:lance-common:build -x :lance:lance-rest-server:build- name: Free up disk spacerun: |diff --git a/.github/workflows/trino-multi-version-test.yml b/.github/workflows/trino-multi-version-test.ymlnew file mode 100644index 0000000000..418acacb67--- /dev/null+++ b/.github/workflows/trino-multi-version-test.yml@@ -0,0 +1,98 @@+name: Trino Multi-Version Integration Test++on:+ workflow_dispatch:++jobs:+ TrinoMultiVersionIT:+ runs-on: ubuntu-latest+ timeout-minutes: 240+ env:+ CONNECTOR_DIR: ${{ github.workspace }}/trino-connector+ steps:+ - uses: actions/checkout@v4++ - uses: actions/setup-java@v4+ with:+ java-version: 17+ distribution: 'temurin'+ cache: 'gradle'++ - name: Set up QEMU+ uses: docker/setup-qemu-action@v3++ - name: Check required command+ run: dev/ci/check_commands.sh++ - name: Build Gravitino+ run: |+ ./gradlew build -x test \+ -x :web:web:build -x :web:integration-test:build \+ -x :web-v2:web:build -x :web-v2:integration-test:build \+ -x :clients:client-python:build \+ -x :flink-connector:flink:build \+ -x :spark-connector:spark-common:build \+ -x :spark-connector:spark-3.3:build -x :spark-connector:spark-3.4:build -x :spark-connector:spark-3.5:build \+ -x :spark-connector:spark-runtime-3.3:build -x :spark-connector:spark-runtime-3.4:build -x :spark-connector:spark-runtime-3.5:build \+ -x :mcp-server:build -x :lineage:build \+ -x :maintenance:optimizer:build -x :maintenance:jobs:build \+ -x :lance:lance-common:build -x :lance:lance-rest-server:build++ - name: Free up disk space+ run: dev/ci/util_free_space.sh++ - name: Test Trino 478+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=478 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-473-478/build/libs++ - name: Test Trino 473+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=473 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-473-478/build/libs++ - name: Test Trino 469+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=469 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-469-472/build/libs++ - name: Test Trino 452+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=452 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-452-468/build/libs++ - name: Test Trino 446+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=446 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-446-451/build/libs++ - name: Test Trino 440+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=440 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-440-445/build/libs++ - name: Test Trino 435+ run: |+ trino-connector/integration-test/trino-test-tools/trino_integration_test.sh \+ --auto=all --auto_patch --trino_version=435 \+ --trino_connector_dir=${{ env.CONNECTOR_DIR }}/trino-connector-435-439/build/libs++ - name: Upload test reports+ uses: actions/upload-artifact@v4+ if: failure()+ with:+ name: trino-multi-version-test-reports+ path: |+ build/reports+ trino-connector/integration-test/build/*.log+ trino-connector/integration-test/build/*.tar+ integration-test-common/build/trino-ci-container-log+ distribution/package/logs/gravitino-server.out+ distribution/package/logs/gravitino-server.log+ catalogs/**/*.logdiff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-435-445.patch b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-435-445.patchdeleted file mode 100644index 5d249a20cd..0000000000--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-435-445.patch+++ /dev/null@@ -1,97 +0,0 @@-diff --git b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00004_query_pushdown.txt a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00004_query_pushdown.txt-index d1c050b4d..bef98d37b 100644---- b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00004_query_pushdown.txt-+++ a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00004_query_pushdown.txt-@@ -12,32 +12,35 @@ INSERT: 15000 rows-- "Trino version: %- %-- %TableScan[table = gt_mysql:gt_db1.customer->gt_db1.customer gt_db1.customer limit=10 columns=[custkey:bigint:BIGINT]]-+ └─ TableScan[table = gt_mysql:gt_db1.customer->gt_db1.customer gt_db1.customer limit=10 columns=[custkey:bigint:BIGINT]]- Layout: [custkey:bigint]- %- "-- "Trino version: %- %-- %ScanFilter[table = gt_mysql:gt_db1.customer->gt_db1.customer gt_db1.customer%like%phone%]-+ └─ ScanFilter[table = gt_mysql:gt_db1.customer->gt_db1.customer gt_db1.customer, filterPredicate = ""$like""(""phone"", ""$literal$""(from_base64('DgAAAFZBUklBQkxFX1dJRFRIAQAAAAEAAAALAAAAAAsAAAAGAAAAJTIzNDIlAA==')))]-+ Layout: [custkey:bigint, name:varchar(25), address:varchar(40), nationkey:bigint, phone:varchar(15), acctbal:decimal(12,2), mktsegment:varchar(10), comment:varchar(117)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_mysql:gt_db1.orders->Query[SELECT sum(`totalprice`) AS `_pfgnrtd_0` FROM `gt_db1`.`orders`]%columns=[_pfgnrtd_0:decimal(38,2):decimal]]-+ └─ TableScan[table = gt_mysql:gt_db1.orders->Query[SELECT sum(`totalprice`) AS `_pfgnrtd_0` FROM `gt_db1`.`orders`] columns=[_pfgnrtd_0:decimal(38,2):decimal]]-+ Layout: [_pfgnrtd:decimal(38,2)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_mysql:gt_db1.orders->Query[SELECT `orderdate`, sum(`totalprice`) AS `_pfgnrtd_0` FROM `gt_db1`.`orders` GROUP BY `orderdate`]%sortOrder=[orderdate:date:DATE ASC NULLS LAST]%limit=10%columns=[orderdate:date:DATE, _pfgnrtd_0:decimal(38,2):decimal]]-+ └─ TableScan[table = gt_mysql:gt_db1.orders->Query[SELECT `orderdate`, sum(`totalprice`) AS `_pfgnrtd_0` FROM `gt_db1`.`orders` GROUP BY `orderdate`] sortOrder=[orderdate:date:DATE ASC NULLS LAST] limit=10 columns=[orderdate:date:DATE, _pfgnrtd_0:decimal(38,2):decimal]]-+ Layout: [orderdate:date, _pfgnrtd:decimal(38,2)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_mysql:gt_db1.%->Query[SELECT % INNER JOIN %]%limit=10%columns=%]%-+ └─ TableScan[table = gt_mysql:gt_db1.%->Query[SELECT % INNER JOIN %] limit=10 columns=%]]- %- "--diff --git b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt-index c4f271add..c0d96d086 100644---- b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt-+++ a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt-@@ -12,32 +12,35 @@ INSERT: 15000 rows-- "Trino version: %- %-- %TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer limit=10 columns=[custkey:bigint:int8]]-+ └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer limit=10 columns=[custkey:bigint:int8]]- Layout: [custkey:bigint]- %- "-- "Trino version: %- %-- %TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer%constraints=%phone%LIKE%]-+ └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer constraints=[ParameterizedExpression[expression=(""phone"") LIKE (?), parameters=[QueryParameter{jdbcType=Optional.empty, type=varchar(6), value=Optional[Slice{base=[B@%, baseOffset=0, length=6}]}]]] limit=10]-+ Layout: [custkey:bigint, name:varchar(25), address:varchar(40), nationkey:bigint, phone:varchar(15), acctbal:decimal(12,2), mktsegment:varchar(10), comment:varchar(117)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_postgresql:gt_db1.orders->Query[SELECT sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders""]%columns=[_pfgnrtd_0:decimal(38,2):decimal]]-+ └─ TableScan[table = gt_postgresql:gt_db1.orders->Query[SELECT sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders""] columns=[_pfgnrtd_0:decimal(38,2):decimal]]-+ Layout: [_pfgnrtd:decimal(38,2)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT ""orderdate"", sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders"" GROUP BY ""orderdate""]%sortOrder=[orderdate:date:date ASC NULLS LAST]%limit=10%columns=[orderdate:date:date, _pfgnrtd_0:decimal(38,2):decimal]]-+ └─ TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT ""orderdate"", sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders"" GROUP BY ""orderdate""] sortOrder=[orderdate:date:date ASC NULLS LAST] limit=10 columns=[orderdate:date:date, _pfgnrtd_0:decimal(38,2):decimal]]-+ Layout: [orderdate:date, _pfgnrtd:decimal(38,2)]- %- "-- "Trino version: %- %-- %TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT % INNER JOIN %]%limit=10%columns=%]%-+ TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT % INNER JOIN %] limit=10 columns=%]- %- "--@@ -45,4 +48,4 @@ DROP TABLE-- DROP TABLE---DROP SCHEMA-+DROP SCHEMA-\ No newline at end of filediff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-446-451.patch b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-452-446.patchsimilarity index 91%rename from trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-446-451.patchrename to trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-452-446.patchindex 4e158cd7cd..369b9f456b 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-446-451.patch+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-452-446.patch@@ -1,3 +1,16 @@+diff --git a/integration-test-common/docker-script/init/trino/config/jvm.config b/integration-test-common/docker-script/init/trino/config/jvm.config+index e1089ee4b..77a930a36 100644+--- a/integration-test-common/docker-script/init/trino/config/jvm.config++++ b/integration-test-common/docker-script/init/trino/config/jvm.config+@@ -26,8 +26,5 @@+ -XX:+ExplicitGCInvokesConcurrent+ -XX:+HeapDumpOnOutOfMemoryError++--XX:+UnlockDiagnosticVMOptions+--XX:G1NumCollectionsKeepPinned=10000000+-+ -DHADOOP_USER_NAME=hive+ -Dlog4j.configurationFile=/etc/trino/log4j2.propertiesdiff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00011_column_properties.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00011_column_properties.txtindex 117d2f1d4..c3e55683f 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00011_column_properties.txtdiff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-473-452.patch b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-473-452.patchnew file mode 100644index 0000000000..4a1f2125b5--- /dev/null+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-473-452.patch@@ -0,0 +1,180 @@+diff --git a/integration-test-common/docker-script/init/trino/config/jvm.config b/integration-test-common/docker-script/init/trino/config/jvm.config+index 77a930a36..e1089ee4b 100644+--- a/integration-test-common/docker-script/init/trino/config/jvm.config++++ b/integration-test-common/docker-script/init/trino/config/jvm.config+@@ -26,5 +26,8 @@+ -XX:+ExplicitGCInvokesConcurrent+ -XX:+HeapDumpOnOutOfMemoryError+++-XX:+UnlockDiagnosticVMOptions++-XX:G1NumCollectionsKeepPinned=10000000+++ -DHADOOP_USER_NAME=hive+ -Dlog4j.configurationFile=/etc/trino/log4j2.properties+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.sql+new file mode 100644+index 000000000..a3154a68e+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.sql+@@ -0,0 +1,14 @@++CREATE SCHEMA gt_iceberg_test_table_statistics;++++CREATE TABLE gt_iceberg_test_table_statistics.tb01 (++ key1 int,++ value1 int++);++++INSERT INTO gt_iceberg_test_table_statistics.tb01(key1, value1) VALUES (1, 1), (2, 2);++++SHOW STATS FOR gt_iceberg_test_table_statistics.tb01;++++DROP TABLE gt_iceberg_test_table_statistics.tb01;++++DROP SCHEMA gt_iceberg_test_table_statistics;+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.txt+new file mode 100644+index 000000000..ce9f3101b+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00011_table_statistics.txt+@@ -0,0 +1,13 @@++CREATE SCHEMA++++CREATE TABLE++++INSERT: 2 rows++++"key1","","","0.0","","1","2"++"value1","","","0.0","","1","2"++"","","","","2.0","",""++++DROP TABLE++++DROP SCHEMA+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_cleanup.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_cleanup.sql+new file mode 100644+index 000000000..051d2a503+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_cleanup.sql+@@ -0,0 +1 @@++CALL gravitino.system.drop_catalog('gt_iceberg');+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_cleanup.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_cleanup.sql+new file mode 100644+index 000000000..19d744acd+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_cleanup.sql+@@ -0,0 +1 @@++CALL gravitino.system.drop_catalog('gt_iceberg_mysql');+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_prepare.sql+new file mode 100644+index 000000000..607be5081+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_mysql_prepare.sql+@@ -0,0 +1,17 @@++call gravitino.system.create_catalog(++ 'gt_iceberg_mysql',++ 'lakehouse-iceberg',++ map(++ array['uri', 'catalog-backend', 'warehouse', 'jdbc-user', 'jdbc-password', 'jdbc-driver'],++ array['${mysql_uri}/iceberg_db?createDatabaseIfNotExist=true&useSSL=false', 'jdbc',++ '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver']++ )++);++++show catalogs;++++CREATE SCHEMA gt_iceberg_mysql.gt_db2;++++USE gt_iceberg_mysql.gt_db2;++++DROP SCHEMA gt_iceberg_mysql.gt_db2;+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql+new file mode 100644+index 000000000..46ad6a38c+--- /dev/null++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql+@@ -0,0 +1,16 @@++call gravitino.system.create_catalog(++ 'gt_iceberg',++ 'lakehouse-iceberg',++ map(++ array['uri', 'catalog-backend', 'warehouse'],++ array['${hive_uri}', 'hive', '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT']++ )++);++++show catalogs;++++CREATE SCHEMA gt_iceberg.gt_db2;++++USE gt_iceberg.gt_db2;++++DROP SCHEMA gt_iceberg.gt_db2;+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.sql+deleted file mode 100644+index a3154a68e..000000000+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.sql++++ /dev/null+@@ -1,14 +0,0 @@+-CREATE SCHEMA gt_iceberg_test_table_statistics;+-+-CREATE TABLE gt_iceberg_test_table_statistics.tb01 (+- key1 int,+- value1 int+-);+-+-INSERT INTO gt_iceberg_test_table_statistics.tb01(key1, value1) VALUES (1, 1), (2, 2);+-+-SHOW STATS FOR gt_iceberg_test_table_statistics.tb01;+-+-DROP TABLE gt_iceberg_test_table_statistics.tb01;+-+-DROP SCHEMA gt_iceberg_test_table_statistics;+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.txt+deleted file mode 100644+index ce9f3101b..000000000+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/00011_table_statistics.txt++++ /dev/null+@@ -1,13 +0,0 @@+-CREATE SCHEMA+-+-CREATE TABLE+-+-INSERT: 2 rows+-+-"key1","","","0.0","","1","2"+-"value1","","","0.0","","1","2"+-"","","","","2.0","",""+-+-DROP TABLE+-+-DROP SCHEMA+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_cleanup.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_cleanup.sql+deleted file mode 100644+index 19d744acd..000000000+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_cleanup.sql++++ /dev/null+@@ -1 +0,0 @@+-CALL gravitino.system.drop_catalog('gt_iceberg_mysql');+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_prepare.sql+deleted file mode 100644+index 607be5081..000000000+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/ignored/catalog_iceberg_mysql_prepare.sql++++ /dev/null+@@ -1,17 +0,0 @@+-call gravitino.system.create_catalog(+- 'gt_iceberg_mysql',+- 'lakehouse-iceberg',+- map(+- array['uri', 'catalog-backend', 'warehouse', 'jdbc-user', 'jdbc-password', 'jdbc-driver'],+- array['${mysql_uri}/iceberg_db?createDatabaseIfNotExist=true&useSSL=false', 'jdbc',+- '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT', 'trino', 'ds123', 'com.mysql.cj.jdbc.Driver']+- )+-);+-+-show catalogs;+-+-CREATE SCHEMA gt_iceberg_mysql.gt_db2;+-+-USE gt_iceberg_mysql.gt_db2;+-+-DROP SCHEMA gt_iceberg_mysql.gt_db2;diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-469-478.patch b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-478-473.patchsimilarity index 79%rename from trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-469-478.patchrename to trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-478-473.patchindex 9a55b49b87..91bec155e5 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-469-478.patch+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/trino-478-473.patch@@ -1,27 +1,34 @@-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/catalog_hive_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/catalog_hive_prepare.sql-index 67ea924ba..b392ae230 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/catalog_hive_prepare.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/catalog_hive_prepare.sql-@@ -2,7 +2,7 @@ call gravitino.system.create_catalog(- 'gt_hive',- 'hive',- map(-- array['metastore.uris', 'trino.bypass.fs.hadoop.enabled'],-- array['${hive_uri}', 'true']-+ array['metastore.uris'],-+ array['${hive_uri}']- )- );-\ No newline at end of file+diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql+index 46cf682b1..4d3fcb5d2 100644+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql+@@ -26,7 +26,7 @@ SELECT val1 + val2 FROM tb03;++ SELECT val1 * val2 FROM tb03;++-SELECT CAST(val1 / val2 AS DECIMAL(38, 2)) FROM tb03;++SELECT val1 / val2 FROM tb03;++ CREATE TABLE tb04 (max_min_val DECIMAL(18, 4));++diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00002_alter_table.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00002_alter_table.txt+index 58ca30d38..bef1b08b1 100644+--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00002_alter_table.txt++++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00002_alter_table.txt+@@ -110,3 +110,4 @@ DROP TABLE++ DROP SCHEMA+++diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt-index edd8257ad..c4f271add 100644+index 156b5136f..c4f271add 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/jdbc-postgresql/00004_query_pushdown.txt@@ -12,26 +12,26 @@ INSERT: 15000 rows"Trino version: %%-- └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db.gt_db1.customer limit=10 columns=[custkey:bigint:int8]]+- └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer %gt_db1.customer limit=10 columns=[custkey:bigint:int8]]+ %TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer limit=10 columns=[custkey:bigint:int8]]Layout: [custkey:bigint]%@@ -29,40 +36,25 @@ index edd8257ad..c4f271add 100644"Trino version: %%-- └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db.gt_db1.customer%constraints=%phone%LIKE%]+- └─ TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer %gt_db1.customer%constraints=%phone%LIKE%]+ %TableScan[table = gt_postgresql:gt_db1.customer->gt_db1.customer gt_db1.customer%constraints=%phone%LIKE%]%""Trino version: %%-- └─ TableScan[table = gt_postgresql:gt_db1.orders->Query[SELECT sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db"".""gt_db1"".""orders""]%columns=[_pfgnrtd_0:decimal(38,2):decimal]]+- └─ TableScan[table = gt_postgresql:gt_db1.orders->Query[SELECT sum(""totalprice"") AS ""_pfgnrtd_0"" FROM %""gt_db1"".""orders""]%columns=[_pfgnrtd_0:decimal(38,2):decimal]]+ %TableScan[table = gt_postgresql:gt_db1.orders->Query[SELECT sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders""]%columns=[_pfgnrtd_0:decimal(38,2):decimal]]%""Trino version: %%-- └─ TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT ""orderdate"", sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db"".""gt_db1"".""orders"" GROUP BY ""orderdate""]%sortOrder=[orderdate:date:date ASC NULLS LAST]%limit=10%columns=[orderdate:date:date, _pfgnrtd_0:decimal(38,2):decimal]]+- └─ TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT ""orderdate"", sum(""totalprice"") AS ""_pfgnrtd_0"" FROM %""gt_db1"".""orders"" GROUP BY ""orderdate""]%sortOrder=[orderdate:date:date ASC NULLS LAST]%limit=10%columns=[orderdate:date:date, _pfgnrtd_0:decimal(38,2):decimal]]+ %TableScan[table = gt_postgresql:gt_db1.%->Query[SELECT ""orderdate"", sum(""totalprice"") AS ""_pfgnrtd_0"" FROM ""gt_db1"".""orders"" GROUP BY ""orderdate""]%sortOrder=[orderdate:date:date ASC NULLS LAST]%limit=10%columns=[orderdate:date:date, _pfgnrtd_0:decimal(38,2):decimal]]%"-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql-index e310c051d..46ad6a38c 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/catalog_iceberg_prepare.sql-@@ -2,8 +2,8 @@ call gravitino.system.create_catalog(- 'gt_iceberg',- 'lakehouse-iceberg',- map(-- array['uri', 'catalog-backend', 'warehouse', 'trino.bypass.fs.hadoop.enabled'],-- array['${hive_uri}', 'hive', '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT', 'true']-+ array['uri', 'catalog-backend', 'warehouse'],-+ array['${hive_uri}', 'hive', '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT']- )- );-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpcds/00002.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpcds/00002.sqlindex 7ed8fbf18..0e797b639 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpcds/00002.sql@@ -301,84 +293,19 @@ index 10e47d07e..72ddd155e 100644store_sales, itemdiff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.sql-index 11b768749..ea3b1fa72 100644+index 02f52dc5f..ea3b1fa72 100644--- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.sql+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.sql@@ -1,10 +1,10 @@SELECTo_year,-- CAST((sum(CASE+- CAST(sum(CASE+ sum(CASEWHEN nation = 'BRAZIL'THEN volumeELSE 0-- END) / sum(volume)) AS DECIMAL(38, 2)) AS mkt_share+- END) / sum(volume) AS DECIMAL(38, 4)) AS mkt_share+ END) / sum(volume) AS mkt_shareFROM (SELECTextract(YEAR FROM o.orderdate) AS o_year,-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.txt b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.txt-index cdea0396b..8be6da155 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.txt-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00008.txt-@@ -1,2 +1,2 @@--"1995","0.00"--"1996","0.00"-\ No newline at end of file-+"1995","0.0000"-+"1996","0.0000"-\ No newline at end of file-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00017.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00017.sql-index d712f45bb..7150e90ec 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00017.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/00017.sql-@@ -1,5 +1,5 @@- SELECT-- CAST(sum(l.extendedprice)/7.0 AS DECIMAL(38, 2)) as avg_yearly-+ sum(l.extendedprice)/7.0 as avg_yearly- FROM- lineitem l,- part p-diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_hive_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_hive_prepare.sql-index 2a35d4340..2fb4294af 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_hive_prepare.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_hive_prepare.sql-@@ -2,8 +2,8 @@ call gravitino.system.create_catalog(- 'gt_hive2',- 'hive',- map(-- array['metastore.uris', 'trino.bypass.fs.hadoop.enabled'],-- array['${hive_uri}', 'true']-+ array['metastore.uris'],-+ array['${hive_uri}']- )- );--diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_iceberg_prepare.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_iceberg_prepare.sql-index 22826aa98..a5a0669f8 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_iceberg_prepare.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/tpch/catalog_iceberg_prepare.sql-@@ -2,8 +2,8 @@ call gravitino.system.create_catalog(- 'gt_iceberg2',- 'lakehouse-iceberg',- map(-- array['uri', 'catalog-backend', 'warehouse', 'trino.bypass.fs.hadoop.enabled'],-- array['${hive_uri}', 'hive', '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT', 'true']-+ array['uri', 'catalog-backend', 'warehouse'],-+ array['${hive_uri}', 'hive', '${hdfs_uri}/user/iceberg/warehouse/TrinoQueryIT']- )- );--diff --git a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql-index 46cf682b1..4d3fcb5d2 100644---- a/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql-+++ b/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets/hive/00008_decimal.sql-@@ -26,7 +26,7 @@ SELECT val1 + val2 FROM tb03;-- SELECT val1 * val2 FROM tb03;---SELECT CAST(val1 / val2 AS DECIMAL(38, 2)) FROM tb03;-+SELECT val1 / val2 FROM tb03;-- CREATE TABLE tb04 (max_min_val DECIMAL(18, 4));-diff --git a/trino-connector/integration-test/trino-test-tools/trino_integration_test.sh b/trino-connector/integration-test/trino-test-tools/trino_integration_test.shindex 41305d7301..54032704c6 100755--- a/trino-connector/integration-test/trino-test-tools/trino_integration_test.sh+++ b/trino-connector/integration-test/trino-test-tools/trino_integration_test.sh@@ -26,6 +26,84 @@ export HADOOP_USER_NAME=anonymousecho $GRAVITINO_ROOT_DIRcd $GRAVITINO_ROOT_DIR-args="\"$@\""+# Parse --auto_patch and --trino_version from arguments.+# --auto_patch is consumed here and not forwarded to Gradle.+# --trino_version is forwarded to Gradle and also used for patch selection.+auto_patch=false+trino_version=""+args=""+for arg in "$@"; do+ case "$arg" in+ --auto_patch)+ auto_patch=true+ ;;+ --trino_version=*)+ trino_version="${arg#*=}"+ args="$args $arg"+ ;;+ *)+ args="$args $arg"+ ;;+ esac+done+args="${args# }"-./gradlew :trino-connector:integration-test:TrinoTest -PappArgs="$args"+TESTSETS_DIR="$GRAVITINO_ROOT_DIR/trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets"++# Apply version-specific patches cumulatively based on the target Trino version.+# Patches are applied in descending order (newest first):+# version <= 473: apply trino-478-473.patch+# version <= 452: also apply trino-473-452.patch+# version <= 446: also apply trino-452-446.patch+apply_version_patches() {+ local version=$1+ # Each entry is "max_version:patch_file"; patches are applied in order.+ local patches=(+ "473:trino-478-473.patch"+ "452:trino-473-452.patch"+ "446:trino-452-446.patch"+ )+ for entry in "${patches[@]}"; do+ local max_ver="${entry%%:*}"+ local patch="${entry##*:}"+ if [[ $version -le $max_ver ]]; then+ echo "Applying patch: $patch"+ git -C "$GRAVITINO_ROOT_DIR" apply "$TESTSETS_DIR/$patch" \+ || { echo "ERROR: Failed to apply $patch"; exit 1; }+ fi+ done+}++# Restore test resources to their original state by reverting any patch changes.+restore_test_files() {+ echo "Restoring test files..."+ git -C "$GRAVITINO_ROOT_DIR" checkout -- \+ trino-connector/integration-test/src/test/resources/ \+ integration-test-common/docker-script/+ git -C "$GRAVITINO_ROOT_DIR" clean -fd \+ trino-connector/integration-test/src/test/resources/ \+ integration-test-common/docker-script/+}++if [ "$auto_patch" = true ]; then+ # Abort if the testsets directory has uncommitted changes, to avoid+ # patch conflicts or accidental loss of in-progress work.+ TESTSETS_REL="trino-connector/integration-test/src/test/resources/trino-ci-testset/testsets"+ INTEGRATION_TEST_COMMON_REL="integration-test-common/docker-script"+ for dir in "$TESTSETS_REL" "$INTEGRATION_TEST_COMMON_REL"; do+ if ! git -C "$GRAVITINO_ROOT_DIR" diff --quiet -- "$dir" || \+ ! git -C "$GRAVITINO_ROOT_DIR" diff --cached --quiet -- "$dir"; then+ echo "ERROR: Uncommitted changes detected in $dir."+ echo "Please commit or stash your changes before running with --auto_patch."+ exit 1+ fi+ done+ # Register trap to ensure test files are always restored on exit,+ # even if the script is interrupted or exits abnormally.+ if [ -n "$trino_version" ]; then+ trap 'restore_test_files' EXIT+ apply_version_patches "$trino_version"+ fi+fi++./gradlew :trino-connector:integration-test:TrinoTest -PappArgs="\"$args\""