Yes, you can use the *`identifier-fields`* option ...
# questions-and-troubleshooting
r
Yes, you can use the
identifier-fields
option within the
PROPERTIES
clause when creating a StarRocks Iceberg table. While
identifier-fields
is not a StarRocks-specific configuration, StarRocks allows you to pass arbitrary Iceberg table properties through the
PROPERTIES
block of the
CREATE TABLE
statement. These properties are then passed directly to the underlying Iceberg catalog. Usage Example When creating an Iceberg table, you can define the unique identifier columns like this:
Copy code
sql
CREATE TABLE iceberg_catalog.db_name.my_table (
    id INT NOT NULL,
    name STRING,
    event_time TIMESTAMP
)
PROPERTIES (
    "identifier-fields" = "id" -- Specifies 'id' as the identifier field
);
Key Points to Note: * Iceberg Specification:
identifier-fields
is part of the Apache Iceberg specification (often referred to as
identifier-field-ids
in metadata). It is used to define the set of columns that uniquely identify a row, which is essential for certain operations like Equality Deletes in Iceberg v2 tables. * Property Format: The value is typically a comma-separated string of column names (e.g.,
"id, tenant_id"
). * StarRocks Support: StarRocks (starting from v3.1.8, v3.2.3, and v3.3+) supports querying Iceberg v2 tables that use equality deletes based on these identifier fields. * Requirements: In the Iceberg spec, columns used as identifier fields must be defined as
NOT NULL
. If you are looking to define a primary key for a native StarRocks table (not an Iceberg table), you should instead use the
PRIMARY KEY
syntax within the table schema definition. For more details, you can refer to the Iceberg DDL operations in the L/) documentation. Referencesdata_source/catalog/iceberg/iceberg_catalog.mddata_source/feature-support-data-lake-analytics.mdloading/Spark-connector-starrocks.mddata_source/catalog/iceberg/iceberg_meta_table.md