import { SearchType } from "../storage.mjs"; import { IcebergColumn, IcebergPartitionField, IcebergS3Config, IcebergTableSpec, PartitionKeyEncoding, PartitionKeyEncoding as PartitionKeyEncoding$1 } from "@gscdump/lakehouse/schema"; import { TableName } from "@gscdump/contracts"; /** The 9 fact tables that exist as global Iceberg tables. */ type IcebergTableName = Extract; /** The 9 Iceberg table names, in canonical order. */ declare const ICEBERG_TABLES: readonly IcebergTableName[]; /** * Stable `search_type` enum → int map for `'int'`-encoded catalogs. Engine-owned * and FROZEN: never renumber or reuse an id (it's the on-disk partition value). */ declare const SEARCH_TYPE_INT: Record; /** Reverse of {@link SEARCH_TYPE_INT} — int → `search_type`, for read-result mapping. */ declare const INT_SEARCH_TYPE: Record; /** * The two partition-identity columns Iceberg rows carry that the legacy * parquet path encoded in the object-key prefix instead. Field ids 1–2 are * the first two columns; per-table metric/dimension columns follow * contiguously from id 3 (see `ICEBERG_FIELD_ID_BASE`). */ declare const ICEBERG_PARTITION_COLUMNS: readonly IcebergColumn[]; /** * The two partition-identity columns for a given {@link PartitionKeyEncoding}. * `'string'` returns {@link ICEBERG_PARTITION_COLUMNS} verbatim; `'int'` swaps * BOTH to INT — `site_id` (the app's small `user_sites.int_id`; ≪ 2.1B sites, so * INT is ample) and `search_type` (its fixed enum code). Integer identity columns * avoid R2 SQL's truncated-string-stats equality undercount and restore pruning. * Field ids are unchanged (1, 2) — only the column types differ. */ declare function icebergPartitionColumns(encoding?: PartitionKeyEncoding): readonly IcebergColumn[]; /** * First field id used for per-table (non-partition) columns — immediately * after the two partition-identity columns (`site_id`=1, `search_type`=2). * No longer read by `defineDataset` below (field ids are now assigned by * `defineIcebergDataset` itself, identity-then-dims-then-columns) — kept as a * documented, byte-identity-tested constant for existing external readers. */ declare const ICEBERG_FIELD_ID_BASE = 3; /** Shared partition spec — identical across every table. */ declare const ICEBERG_PARTITION_SPEC: readonly IcebergPartitionField[]; /** * Derive the full Iceberg table spec for a table + encoding. Thin wrapper * over {@link gscDataset}'s `tableSpec` (ADR-0021 R2-FIXES C5) — kept as a * named GSC-specific export. Generic schema authoring types are owned by * `@gscdump/lakehouse`. * * CONTRACT NOTE: implementation agents must treat the RETURNED VALUE as the * source of truth — do not hand-list columns elsewhere. */ declare function icebergTableSpec(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebergTableSpec; /** All Iceberg table specs in legacy `'string'` encoding, keyed by table name. */ declare const ICEBERG_SCHEMAS_STRING: Record; /** All Iceberg table specs in `'int'` encoding (INT site_id + INT search_type). */ declare const ICEBERG_SCHEMAS_INT: Record; /** All Iceberg table specs for the default new-catalog encoding. */ declare const ICEBERG_SCHEMAS: Record; /** Table specs for the given encoding (`'int'` default). */ declare function icebergSchemasFor(encoding?: PartitionKeyEncoding): Record; /** True when `table` is one of the canonical {@link ICEBERG_TABLES}. */ declare function isIcebergTable(table: string): table is IcebergTableName; /** * Narrow an arbitrary table name to a canonical {@link IcebergTableName}, * throwing a clear error otherwise. Guards write paths that index * `ICEBERG_SCHEMAS` (a `Record`) — a non-canonical name * silently yields `undefined` there, propagating a corrupt/empty spec into the * Iceberg job instead of failing loudly. */ declare function assertIcebergTable(table: string): IcebergTableName; export { ICEBERG_FIELD_ID_BASE, ICEBERG_PARTITION_COLUMNS, ICEBERG_PARTITION_SPEC, ICEBERG_SCHEMAS, ICEBERG_SCHEMAS_INT, ICEBERG_SCHEMAS_STRING, ICEBERG_TABLES, INT_SEARCH_TYPE, type IcebergS3Config, IcebergTableName, type PartitionKeyEncoding$1 as PartitionKeyEncoding, SEARCH_TYPE_INT, type SearchType, assertIcebergTable, icebergPartitionColumns, icebergSchemasFor, icebergTableSpec, isIcebergTable };