/** * Iceberg (parquet) format-version-2 table type. * * Iceberg partitions are transforms applied to a data column, so duplicate * detection keys on the (source column, normalized transform) pair — `year(ts)` * and `month(ts)` are distinct, while `day` and `DAY` collapse. * * The format version is encoded in the `tableType` discriminator: this engine is * inherently v2, so a present `formatVersion` must equal `EXPECTED_FORMAT_VERSION`. * A future `iceberg_parquet_v3` sibling subclass overrides that one constant. */ import { Violation } from '../model'; import { TableTypeBase } from '../table-type'; /** Iceberg (parquet) format-version-2 table. */ export declare class IcebergParquetV2Table extends TableTypeBase { /** * The Iceberg format version this engine pins to. A present `formatVersion` * must equal this. A future v3 sibling subclass overrides this single value. */ protected static readonly EXPECTED_FORMAT_VERSION = 2; /** * The lowest legal Iceberg partition field id. Iceberg reserves ids below * 1000 for data-schema fields and starts partition field ids at 1000. */ private static readonly MIN_PARTITION_FIELD_ID; /** * Validate a column type against the Iceberg type registry. * * @param type Type string from a column definition. * @returns True when the type is a valid Iceberg type. */ isValidColumnType(type: string): boolean; /** * Diagnose a single column's type. A well-formed nested type is accepted; a * malformed nested string gets a precise code rather than the generic * `COLUMN_TYPE_VALID`. * * Emits `ICEBERG_STRUCT_DUPLICATE_FIELD` (two fields share a name in one * struct), `ICEBERG_NESTED_TYPE_MALFORMED` (unbalanced brackets, empty * struct, malformed field, or an invalid inner type), or the generic * `COLUMN_TYPE_VALID` (a plain unrecognized scalar type). * * @param type Column type string. * @param name Column name, for the message. * @param index Column index, for the `field` path. * @returns A violation, or null when the type is valid. */ protected columnTypeViolation(type: string, name: string, index: number): Violation | null; /** * Iceberg partition rules. * * Emits: `NO_DUPLICATE_PARTITIONS` (keyed by `${name} ${transformKind}:${param}`, * falling back to a lowercased trim of the raw transform when it doesn't * parse, so whitespace / case variants of the same transform collapse), * `ICEBERG_TRANSFORM_SOURCE_EXISTS`, `ICEBERG_TRANSFORM_VALID`, and * `ICEBERG_TRANSFORM_SOURCE_TYPE_LEGAL`. * * @returns Every partition-related violation. */ partitionViolations(): Violation[]; private static readonly ENUM_PROPERTIES; private static readonly POSITIVE_INT_PROPERTIES; private static readonly NON_NEGATIVE_INT_PROPERTIES; private static readonly INT_RANGE_PROPERTIES; private static readonly SORT_DIRECTIONS; private static readonly SORT_NULL_ORDERS; /** * Iceberg engine-specific rules: format version, table properties, and sort * order. * * @returns Every engine-specific violation. */ engineSpecificViolations(): Violation[]; /** * Validate Iceberg column field ids — the ids Iceberg uses for schema * evolution. Pinning them keeps old data files readable across renames and * drops, so they are all-or-nothing per table: either every column declares * an `id` or none do. When present, each id must be a positive integer and * unique within the table. * * Emits `ICEBERG_FIELD_ID_ALL_OR_NONE`, `ICEBERG_FIELD_ID_POSITIVE`, and * `ICEBERG_FIELD_ID_UNIQUE`. * * @returns Every field-id violation. */ private fieldIdViolations; /** * Validate Iceberg partition field ids — the ids Iceberg assigns to * partition fields for spec evolution. Pinning them is what lets a source * translator populate the required `fieldId` on `cdk-glue-iceberg-table` * without falling back to positional allocation, so they are * all-or-nothing per table: either every partition declares a `fieldId` or * none do. When present, each id must be an integer >= 1000 (Iceberg * reserves lower ids for data-schema fields) and unique within the table's * partition list. * * Emits `ICEBERG_PARTITION_FIELD_ID_ALL_OR_NONE`, * `ICEBERG_PARTITION_FIELD_ID_RANGE`, and * `ICEBERG_PARTITION_FIELD_ID_UNIQUE`. * * @returns Every partition-field-id violation. */ private partitionFieldIdViolations; /** * Validate the Iceberg sort order. * * Emits `NO_DUPLICATE_SORT_FIELDS` (keyed by source column + normalized * transform), `ICEBERG_SORT_COLUMN_EXISTS`, `ICEBERG_SORT_DIRECTION_VALID`, * `ICEBERG_SORT_NULL_ORDER_VALID`, `ICEBERG_SORT_TRANSFORM_VALID`, and * `ICEBERG_SORT_TRANSFORM_TYPE_LEGAL`. * * @returns Every sort-order violation. */ private sortOrderViolations; /** * Normalize a sort field into its identity key. An omitted transform and an * explicit `identity` collapse to the same key so they count as duplicates. * * @param field Sort field to key. * @returns The identity string for duplicate detection. */ private sortFieldKey; private formatVersionViolations; /** * Validate the closed-domain Iceberg table properties. Keys outside the * known set pass through unvalidated. * * Emits `ICEBERG_PROPERTY_ENUM_VALID`, `ICEBERG_PROPERTY_POSITIVE_INT`, * `ICEBERG_PROPERTY_NON_NEGATIVE_INT`, `ICEBERG_PROPERTY_INT_RANGE`, and * `ICEBERG_COMMIT_RETRY_ORDERING`. * * @returns Every table-property violation. */ private tablePropertyViolations; private commitRetryOrderingViolations; /** * Validate Iceberg identifier fields (the row-identity / equality-delete * key). Equality deletes are a v2 feature, which this engine inherently is; * identifier fields must be required primitive columns that are not * float/double. * * Emits `ICEBERG_IDENTIFIER_COLUMN_EXISTS`, `ICEBERG_IDENTIFIER_REQUIRED`, * and `ICEBERG_IDENTIFIER_TYPE_PRIMITIVE`. * * @returns Every identifier-field violation. */ private identifierFieldViolations; /** * Normalize a partition into its identity key. When the transform parses, * collapse on `${kind}:${param}` so `day` and `DAY`, `bucket[16]` and * `bucket[ 16 ]` are the same. When the transform doesn't parse, the * lowercased trim of the raw string is the best identity we have. * * @param partition Partition to key. * @returns The identity string for duplicate detection. */ private partitionKey; }