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

[#1511] feat(trino-connector): Support partition, distribution and sort order of Iceberg table created by Trino #1563

Merged
merged 34 commits into from
Jan 23, 2024

Conversation

yuqi1129
Copy link
Contributor

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?

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

@yuqi1129
Copy link
Contributor Author

I will convert this to a draft as it depends on issue #1455.

@yuqi1129 yuqi1129 self-assigned this Jan 17, 2024
@yuqi1129 yuqi1129 marked this pull request as draft January 17, 2024 09:24
# Conflicts:
#	catalogs/bundled-catalog/src/main/java/com/datastrato/catalog/property/PropertyConverter.java
#	common/src/main/java/com/datastrato/gravitino/dto/rel/PartitionUtils.java
#	integration-test/src/test/java/com/datastrato/gravitino/integration/test/trino/TrinoConnectorIT.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/CatalogConnectorMetadata.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveCatalogPropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveConnectorAdapter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveMetadataAdapter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HivePropertyMeta.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveSchemaPropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveTablePropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/SortingColumn.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergCatalogPropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergConnectorAdapter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergMetadataAdapter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergSchemaPropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/IcebergTablePropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/jdbc/JDBCCatalogPropertyConverter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/jdbc/mysql/MySQLConnectorAdapter.java
#	trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/catalog/jdbc/postgresql/PostgreSQLConnectorAdapter.java
#	trino-connector/src/test/java/com/datastrato/gravitino/trino/connector/catalog/hive/TestHiveCatalogPropertyConverter.java
#	trino-connector/src/test/java/com/datastrato/gravitino/trino/connector/catalog/iceberg/TestIcebergCatalogPropertyConverter.java
#	trino-connector/src/test/java/com/datastrato/gravitino/trino/connector/catalog/jdbc/TestJDBCCatalogPropertyConverter.java
@yuqi1129 yuqi1129 marked this pull request as ready for review January 22, 2024 13:27
@yuqi1129 yuqi1129 requested a review from diqiu50 January 23, 2024 06:57
Copy link
Contributor

@diqiu50 diqiu50 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuqi1129 yuqi1129 merged commit 952afe4 into apache:main Jan 23, 2024
12 checks passed
@yuqi1129 yuqi1129 deleted the issue_1511 branch January 23, 2024 09:09
mchades pushed a commit to mchades/gravitino that referenced this pull request Jan 24, 2024
…and sort order of Iceberg table created by Trino (apache#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: apache#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Support Partition/Bucket/Sorting when creating Iceberg table by Trino
2 participants