Skip to content

[#11072] feat(trino-connector): Add Glue catalog connector adapter#11073

Open
diqiu50 wants to merge 8 commits into
apache:mainfrom
diqiu50:trino-glue
Open

[#11072] feat(trino-connector): Add Glue catalog connector adapter#11073
diqiu50 wants to merge 8 commits into
apache:mainfrom
diqiu50:trino-glue

Conversation

@diqiu50
Copy link
Copy Markdown
Contributor

@diqiu50 diqiu50 commented May 13, 2026

What changes were proposed in this pull request?

Add Trino connector support for Gravitino's Glue catalog:

  • GlueConnectorAdapter – wires Gravitino Glue catalog properties into Trino's lakehouse connector config
  • GlueMetadataAdapter – converts table/schema properties between Gravitino and Trino formats
  • GlueTablePropertyConverter – maps Glue-specific table properties (table-format → type, etc.)

Also includes fixes to GlueCatalogOperations and GlueIcebergHelper found during integration testing.

Why are the changes needed?

Without a dedicated connector adapter, Trino cannot proxy queries to Glue-managed tables (Hive, Iceberg) through Gravitino.

Fix: #11072

Does this PR introduce any user-facing change?

Yes — users can now configure a Trino catalog backed by Gravitino's Glue catalog.

How was this patch tested?

Manual integration tests with Trino against a real AWS Glue environment.

diqiu50 and others added 4 commits May 6, 2026 12:23
- Upgrade AWS SDK from 2.29.52 to 2.31.73 to access IcebergTableUpdate
  and related Glue native Iceberg alter APIs
- createTable: route tables with table-format=iceberg through
  OpenTableFormatInput.IcebergInput.CREATE so Glue writes metadata.json
- alterTable: detect existing Iceberg tables via table_type=ICEBERG and
  route through UpdateTable + UpdateOpenTableFormatInput + IcebergTableUpdate,
  keeping Iceberg metadata consistent instead of only updating Glue columns
- Add GlueIcebergHelper with type conversion (Hive/Gravitino → Iceberg
  Document), field-ID-preserving schema building, and column change application
- Fix matchesFormatFilter to recognize Iceberg tables created via
  default-table-format config (table_type=ICEBERG without table-format key)
- Add 30 unit tests covering routing, type conversion, schema evolution,
  field ID tracking, and error paths
Copilot AI review requested due to automatic review settings May 13, 2026 07:36
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 13, 2026

Code Coverage Report

Overall Project 65.96% -0.17% 🟢
Files changed 53.16% 🔴

Module Coverage
aliyun 1.72% 🔴
api 47.13% 🟢
authorization-common 85.96% 🟢
aws 1.08% 🔴
azure 2.47% 🔴
catalog-common 10.2% -0.02% 🔴
catalog-fileset 80.02% 🟢
catalog-glue 64.93% -23.82% 🟢
catalog-hive 81.83% 🟢
catalog-jdbc-clickhouse 79.18% 🟢
catalog-jdbc-common 43.93% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.05% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.14% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 86.98% 🟢
catalog-lakehouse-paimon 76.85% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.96% 🟢
common 50.0% 🟢
core 82.29% 🟢
filesystem-hadoop3 76.97% 🟢
flink 0.0% 🔴
flink-common 43.17% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 46.83% 🟢
iceberg-common 55.46% 🟢
iceberg-rest-server 69.61% 🟢
idp-basic 94.68% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 19.95% 🔴
lance-rest-server 62.78% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.96% 🟢
server-common 71.23% 🟢
spark 32.79% 🔴
spark-common 39.09% 🔴
trino-connector 38.78% -0.03% 🔴
Files
Module File Coverage
catalog-common HiveStorageConstants.java 0.0% 🔴
catalog-glue GlueCatalogPropertiesMetadata.java 100.0% 🟢
GlueTablePropertiesMetadata.java 100.0% 🟢
GlueTable.java 85.71% 🟢
GlueCatalogOperations.java 66.53% 🟢
GlueIcebergTableHelper.java 24.11% 🔴
GlueConstants.java 0.0% 🔴
trino-connector GlueTablePropertyConverter.java 100.0% 🟢
GlueMetadataAdapter.java 67.74% 🟢
CatalogConnectorMetadataAdapter.java 33.33% 🔴
DefaultCatalogConnectorFactory.java 0.0% 🔴
GlueConnectorAdapter.java 0.0% 🔴

diqiu50 added 2 commits May 14, 2026 07:11
…rms and fix GlueMetadataAdapter properties

- Use Iceberg SDK to create Iceberg tables in Glue (writes metadata.json to S3)
- Recover Iceberg partitioning and sort orders from Iceberg metadata on loadTable
- Add GlueIcebergCatalogHelper for Iceberg table creation via GlueCatalog
- Refactor GlueMetadataAdapter to use ExpressionUtil for partition expression parsing
- Fix bucket_count to integerProperty and sorted_by to ArrayType property metadata
- Add TestGlueMetadataAdapter for round-trip partition/bucket/sort verification
- Combine GlueIcebergHelper and GlueIcebergCatalogHelper into a single
  GlueIcebergTableHelper that delegates all Iceberg operations to the
  Iceberg SDK GlueCatalog.
- createTable: uses Iceberg SDK for non-register-mode tables.
- alterTable: uses Iceberg SDK UpdateSchema/UpdateProperties for
  SDK-managed tables; falls back to native Glue SDK for register-mode
  tables (METADATA_LOCATION present).
- loadTable: recovers partitioning and sort orders from Iceberg metadata.
- Update TestGlueIceberg to match the new delegation paths.
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.

[Subtask] Add Trino connector support for Glue catalog

1 participant