-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1511] feat(trino-connector): Support partition, distribution and so…
…rt order of Iceberg table created by Trino (#1563) ### What changes were proposed in this pull request? We can create a Hive table with partitioning, distribution, and sorting ordered by Trino. ### Why are the changes needed? It's a crucial feature of the Trino connector. Fix: #1511 ### Does this PR introduce _any_ user-facing change? ```text trino:db1> create table t4(id int, name varchar) with (partitioning = ARRAY['name'], sorted_by = ARRAY['id']); CREATE TABLE trino:db1> show create table t4; Create Table ---------------------------------------------- CREATE TABLE "test.iceberg_catalog".db1.t4 ( id integer, name varchar ) COMMENT '' WITH ( partitioning = ARRAY['name'], sorted_by = ARRAY['id'] ) (1 row) Query 20240117_092158_00001_qufcr, FINISHED, 1 node Splits: 1 total, 1 done (100.00%) 1.08 [0 rows, 0B] [0 rows/s, 0B/s] ``` ### How was this patch tested? IT
- Loading branch information
Showing
5 changed files
with
300 additions
and
5 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
59 changes: 58 additions & 1 deletion
59
...est/src/test/resources/trino-ci-testset/testsets/lakehouse-iceberg/00000_create_table.sql
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 |
---|---|---|
@@ -1,10 +1,67 @@ | ||
CREATE SCHEMA "test.gt_iceberg".gt_db2; | ||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb01 ( | ||
CREATE TABLE "test.gt_iceberg".gt_db2.tb01( | ||
name varchar, | ||
salary int | ||
); | ||
|
||
show create table "test.gt_iceberg".gt_db2.tb01; | ||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb02 ( | ||
name varchar, | ||
salary int | ||
) with ( | ||
partitioning = ARRAY['name'], | ||
sorted_by = ARRAY['salary'] | ||
); | ||
|
||
show create table "test.gt_iceberg".gt_db2.tb02; | ||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb03 ( | ||
name varchar, | ||
salary int | ||
) with ( | ||
partitioning = ARRAY['name'], | ||
sorted_by = ARRAY['salary_wrong_name'] | ||
); | ||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb03 ( | ||
name varchar, | ||
salary int | ||
) with ( | ||
partitioning = ARRAY['name'], | ||
sorted_by = ARRAY['name'] | ||
); | ||
|
||
show create table "test.gt_iceberg".gt_db2.tb03; | ||
|
||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb04 ( | ||
name varchar, | ||
salary int | ||
) with ( | ||
sorted_by = ARRAY['name'] | ||
); | ||
|
||
show create table "test.gt_iceberg".gt_db2.tb04; | ||
|
||
CREATE TABLE "test.gt_iceberg".gt_db2.tb05 ( | ||
name varchar, | ||
salary int | ||
) with ( | ||
partitioning = ARRAY['name'] | ||
); | ||
|
||
show create table "test.gt_iceberg".gt_db2.tb05; | ||
|
||
drop table "test.gt_iceberg".gt_db2.tb01; | ||
|
||
drop table "test.gt_iceberg".gt_db2.tb02; | ||
|
||
drop table "test.gt_iceberg".gt_db2.tb03; | ||
|
||
drop table "test.gt_iceberg".gt_db2.tb04; | ||
|
||
drop table "test.gt_iceberg".gt_db2.tb05; | ||
|
||
drop schema "test.gt_iceberg".gt_db2; |
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