import { EngineError } from "../errors.mjs"; import { IcebergTableName, PartitionKeyEncoding } from "./schema.mjs"; import { icebergCreateTable } from "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.mjs"; import "../node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.mjs"; import { Result } from "gscdump/result"; import { CommitRetryOptions, ConnectIcebergOptions, IcebergCatalogConfig, IcebergConnection, IcebergListedDataFile, QueryProfiler } from "@gscdump/lakehouse"; type IcebirdCreateTableOptions = Parameters[0]; type IcebirdSchema = NonNullable; type IcebirdPartitionSpec = NonNullable; type IcebirdSortOrder = NonNullable; /** * Build the icebird `Schema` for one of the 9 fact tables from the frozen * `ICEBERG_SCHEMAS` contract. Field ids are advisory — R2 Data Catalog * re-assigns them on `createTable`. */ declare function icebergSchemaFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdSchema; /** * Build the icebird `PartitionSpec` for one of the 9 fact tables: the locked * spec `identity(site_id) + identity(search_type) + month(date)`. */ declare function icebergPartitionSpecFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdPartitionSpec; /** * Build the icebird `SortOrder` for a fact table from its `clusterKey` * (dimension-first, then `date`). */ declare function icebergSortOrderFor(table: IcebergTableName, encoding?: PartitionKeyEncoding): IcebirdSortOrder; /** * Outcome of a single table create/drop: the table name plus a `Result` — * `Ok(void)` on success, `Err(iceberg-table-op-failed)` carrying the failure * message when the catalog rejects the op. Per-table so a partial * provisioning run is fully observable. */ interface IcebergTableOpResult { table: string; outcome: Result; } /** * Create the global Iceberg fact tables with the locked partition spec and * the schema derived from {@link ICEBERG_SCHEMAS}. Per-table errors are * captured rather than thrown so a partial run is observable. */ declare function createIcebergTables(conn: IcebergConnection, tables?: readonly IcebergTableName[], encoding?: PartitionKeyEncoding): Promise; /** * Drop tables from the catalog namespace, purging their data objects. * Defaults to every table currently in the namespace. Delegates the walk to * `@gscdump/lakehouse`'s generic `dropIcebergTables`, mapping its simpler * `{table, ok, error?}` result back onto the engine's original `Result`-typed * {@link IcebergTableOpResult} contract. */ declare function dropIcebergTables$1(conn: IcebergConnection, tables?: readonly string[]): Promise; interface ListIcebergDataFilesOptions { table: IcebergTableName; /** Partition identity column. `number` for `'int'`-encoded catalogs. */ siteId: string | number; /** Partition identity column. `number` (int code) for `'int'`-encoded catalogs. */ searchType: string | number; encoding?: PartitionKeyEncoding; range: { start: string; end: string; }; cache?: import('@gscdump/lakehouse').CatalogCache; clock?: () => number; profiler?: QueryProfiler; } /** * List the parquet data files in the current snapshot of `table`, filtered to * a single partition slice `(siteId, searchType, month(date) ∈ range)`. */ declare function listIcebergDataFiles(conn: IcebergConnection, opts: ListIcebergDataFilesOptions): Promise; export { type CommitRetryOptions, type ConnectIcebergOptions, type IcebergCatalogConfig, IcebergTableOpResult, ListIcebergDataFilesOptions, createIcebergTables, dropIcebergTables$1 as dropIcebergTables, icebergPartitionSpecFor, icebergSchemaFor, icebergSortOrderFor, listIcebergDataFiles };