This is an automated email from the ASF dual-hosted git repository. diqiu50 pushed a commit to branch glue-pr03 in repository https://gitbox.apache.org/repos/asf/gravitino.git
commit 026c7fe642501a018d90757d363e12c5d9aca6a3 Author: diqiu50 <[email protected]> AuthorDate: Thu Apr 9 10:02:31 2026 +0800 [MINOR] fix(catalog-glue): address PR-02 review comments - Change DEFAULT_TABLE_FORMAT_VALUE from iceberg to hive - Rename TABLE_TYPE -> TABLE_FORMAT_TYPE, value "table_type" -> "table_format_type" - Remove LOCATION constant: not universal across table formats; per-format location handling deferred to PR-05 (Table CRUD) - Add official AWS docs references for GlueCatalogCapability limitations (case-insensitive names, no NOT NULL, no DEFAULT) - Fix Locale.ROOT for toLowerCase in caseSensitiveOnName --- .../catalog/glue/GlueCatalogCapability.java | 26 +++++++++++++++++----- .../gravitino/catalog/glue/GlueConstants.java | 11 ++++----- .../catalog/glue/GlueTablePropertiesMetadata.java | 20 ++++++----------- 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueCatalogCapability.java b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueCatalogCapability.java index 0a863b3d1b..527b36de0a 100644 --- a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueCatalogCapability.java +++ b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueCatalogCapability.java @@ -27,21 +27,34 @@ import org.apache.gravitino.connector.capability.CapabilityResult; * <p>AWS Glue constraints that deviate from Gravitino defaults: * * <ul> - * <li>Names (database, table, column) are case-insensitive — Glue normalises them to lowercase. - * <li>Column NOT NULL constraints are not enforced by Glue. - * <li>Column DEFAULT values are not supported by Glue. + * <li><b>Case-insensitive names</b>: Glue folds database and table names to lowercase on storage. + * See <a + * href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-databases.html">Database + * API</a> and <a + * href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html">Table + * API</a>: <i>"folded to lowercase when it is stored"</i>. + * <li><b>No NOT NULL constraints</b>: The Glue {@code Column} structure has no nullable / + * constraint field. See <a + * href="https://docs.aws.amazon.com/glue/latest/webapi/API_Column.html">Column API</a>. + * <li><b>No DEFAULT values</b>: The Glue {@code Column} structure has no {@code defaultValue} + * field. See <a href="https://docs.aws.amazon.com/glue/latest/webapi/API_Column.html">Column + * API</a>. * </ul> */ public class GlueCatalogCapability implements Capability { @Override public CapabilityResult columnNotNull() { + // Glue Column structure has no nullable/constraint field — NOT NULL cannot be expressed. + // See https://docs.aws.amazon.com/glue/latest/webapi/API_Column.html return CapabilityResult.unsupported( - "AWS Glue Data Catalog does not enforce NOT NULL constraints on columns."); + "AWS Glue Data Catalog does not support NOT NULL constraints on columns."); } @Override public CapabilityResult columnDefaultValue() { + // Glue Column structure has no defaultValue field — DEFAULT cannot be expressed. + // See https://docs.aws.amazon.com/glue/latest/webapi/API_Column.html return CapabilityResult.unsupported( "AWS Glue Data Catalog does not support DEFAULT values on columns."); } @@ -52,10 +65,11 @@ public class GlueCatalogCapability implements Capability { case SCHEMA: case TABLE: case COLUMN: - // Glue normalises database/table/column names to lowercase. + // Glue folds database/table names to lowercase on storage. + // See https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-databases.html return CapabilityResult.unsupported( "AWS Glue Data Catalog is case-insensitive for " - + scope.name().toLowerCase() + + scope.name().toLowerCase(java.util.Locale.ROOT) + " names."); default: return CapabilityResult.SUPPORTED; diff --git a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueConstants.java b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueConstants.java index fde675afe5..a7a9e99783 100644 --- a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueConstants.java +++ b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueConstants.java @@ -50,7 +50,7 @@ public final class GlueConstants { public static final String DEFAULT_TABLE_FORMAT = "default-table-format"; /** Default value for {@link #DEFAULT_TABLE_FORMAT}. */ - public static final String DEFAULT_TABLE_FORMAT_VALUE = "iceberg"; + public static final String DEFAULT_TABLE_FORMAT_VALUE = "hive"; /** * Comma-separated list of table types exposed by {@code listTables()} and {@code loadTable()} @@ -67,16 +67,13 @@ public final class GlueConstants { // ------------------------------------------------------------------------- /** - * Glue table type parameter key. Common values: {@code ICEBERG}, {@code HIVE}, {@code DELTA}, - * {@code PARQUET}, {@code VIRTUAL_VIEW}. + * Glue table format type parameter key stored in {@code Table.parameters()}. Common values: + * {@code ICEBERG}, {@code HIVE}, {@code DELTA}, {@code PARQUET}, {@code VIRTUAL_VIEW}. */ - public static final String TABLE_TYPE = "table_type"; + public static final String TABLE_FORMAT_TYPE = "table_format_type"; /** Iceberg table metadata location stored in Glue {@code Table.parameters()}. */ public static final String METADATA_LOCATION = "metadata_location"; - /** Storage location for the table data. */ - public static final String LOCATION = "location"; - private GlueConstants() {} } diff --git a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueTablePropertiesMetadata.java b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueTablePropertiesMetadata.java index 2439d9a139..1b8fc6c738 100644 --- a/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueTablePropertiesMetadata.java +++ b/catalogs/catalog-glue/src/main/java/org/apache/gravitino/catalog/glue/GlueTablePropertiesMetadata.java @@ -18,9 +18,8 @@ */ package org.apache.gravitino.catalog.glue; -import static org.apache.gravitino.catalog.glue.GlueConstants.LOCATION; import static org.apache.gravitino.catalog.glue.GlueConstants.METADATA_LOCATION; -import static org.apache.gravitino.catalog.glue.GlueConstants.TABLE_TYPE; +import static org.apache.gravitino.catalog.glue.GlueConstants.TABLE_FORMAT_TYPE; import static org.apache.gravitino.connector.PropertyEntry.stringOptionalPropertyEntry; import com.google.common.collect.ImmutableMap; @@ -35,16 +34,19 @@ import org.apache.gravitino.connector.PropertyEntry; * are optional and mutable, reflecting that Glue stores them as free-form key-value pairs. Unknown * parameters from {@code Table.parameters()} are passed through transparently by the catalog * operations layer and are not validated here. + * + * <p>Note: storage location ({@code StorageDescriptor.location}) varies by table format and is + * handled per-format in the Table CRUD layer (PR-05), not declared here. */ public class GlueTablePropertiesMetadata extends BasePropertiesMetadata { private static final Map<String, PropertyEntry<?>> PROPERTIES_METADATA = ImmutableMap.<String, PropertyEntry<?>>builder() .put( - TABLE_TYPE, + TABLE_FORMAT_TYPE, stringOptionalPropertyEntry( - TABLE_TYPE, - "Glue table type stored in Table.parameters(). Common values:" + TABLE_FORMAT_TYPE, + "Glue table format type stored in Table.parameters(). Common values:" + " ICEBERG, HIVE, DELTA, PARQUET.", false /* immutable */, null /* defaultValue */, @@ -57,14 +59,6 @@ public class GlueTablePropertiesMetadata extends BasePropertiesMetadata { false /* immutable */, null /* defaultValue */, false /* hidden */)) - .put( - LOCATION, - stringOptionalPropertyEntry( - LOCATION, - "Storage location for the table data.", - false /* immutable */, - null /* defaultValue */, - false /* hidden */)) .build(); @Override
