@gscdump/engine 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/duckdb-node.d.mts +7 -0
- package/dist/adapters/duckdb-node.mjs +94 -0
- package/dist/adapters/filesystem.d.mts +1 -1
- package/dist/adapters/filesystem.mjs +1 -1
- package/dist/adapters/hyparquet.d.mts +4 -3
- package/dist/adapters/hyparquet.mjs +7 -3
- package/dist/adapters/node-harness.d.mts +38 -0
- package/dist/adapters/node-harness.mjs +47 -0
- package/dist/adapters/node.d.mts +4 -100
- package/dist/adapters/node.mjs +4 -240
- package/dist/adapters/parquet-attach.d.mts +23 -0
- package/dist/adapters/parquet-attach.mjs +21 -0
- package/dist/adapters/r2-manifest.d.mts +82 -0
- package/dist/adapters/r2-manifest.mjs +364 -0
- package/dist/adapters/r2.d.mts +1 -1
- package/dist/adapters/read-optional.mjs +15 -0
- package/dist/adapters/snapshot-attach.d.mts +38 -0
- package/dist/adapters/snapshot-attach.mjs +85 -0
- package/dist/analysis-types.d.mts +56 -1
- package/dist/analyzer/define.d.mts +48 -0
- package/dist/analyzer/define.mjs +60 -0
- package/dist/analyzer/dispatch.d.mts +17 -0
- package/dist/analyzer/index.d.mts +4 -14
- package/dist/analyzer/index.mjs +4 -112
- package/dist/analyzer/registry.d.mts +33 -0
- package/dist/analyzer/registry.mjs +49 -0
- package/dist/analyzer/types.d.mts +95 -0
- package/dist/analyzer/types.mjs +5 -0
- package/dist/coerce.d.mts +4 -0
- package/dist/compaction.d.mts +14 -0
- package/dist/{_chunks/parquet-plan.mjs → compaction.mjs} +2 -138
- package/dist/contracts.d.mts +1 -2
- package/dist/{_chunks/schema.d.mts → drizzle-schema.d.mts} +152 -184
- package/dist/{_chunks/schema.mjs → drizzle-schema.mjs} +6 -78
- package/dist/{_chunks/snapshot.d.mts → duckdb.d.mts} +1 -14
- package/dist/duckdb.mjs +207 -0
- package/dist/engine.d.mts +4 -0
- package/dist/engine.mjs +385 -0
- package/dist/entities.d.mts +3 -52
- package/dist/entities.mjs +867 -2
- package/dist/errors.d.mts +114 -1
- package/dist/gc.mjs +92 -0
- package/dist/iceberg/append-sink.d.mts +14 -0
- package/dist/iceberg/append-sink.mjs +142 -0
- package/dist/iceberg/catalog.d.mts +71 -0
- package/dist/iceberg/catalog.mjs +109 -0
- package/dist/iceberg/index.d.mts +4 -13
- package/dist/iceberg/index.mjs +3 -244
- package/dist/iceberg/overwrite-writer.d.mts +161 -0
- package/dist/iceberg/overwrite-writer.mjs +102 -0
- package/dist/iceberg/pyiceberg-runtime.mjs +34 -0
- package/dist/iceberg/schema.d.mts +69 -0
- package/dist/{_chunks/schema2.mjs → iceberg/schema.mjs} +3 -2
- package/dist/index.d.mts +14 -190
- package/dist/index.mjs +10 -645
- package/dist/ingest-accumulator.d.mts +1 -1
- package/dist/ingest.d.mts +1 -1
- package/dist/layout.d.mts +31 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.bitreader.mjs +88 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.blocks.mjs +120 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.context.mjs +1805 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.contextmap.mjs +49 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.dictionary.mjs +984 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.huffman.mjs +266 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.mjs +340 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.prefix.mjs +109 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.streams.mjs +21 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/brotli.transform.mjs +190 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/compressors.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.huffman.mjs +121 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.mjs +176 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/lz4.mjs +52 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bloom.mjs +93 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/bytewriter.mjs +91 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/column.mjs +186 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/datapage.mjs +113 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/delta.mjs +111 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dictionary.mjs +99 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/dremel.mjs +116 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/encoding.mjs +51 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/geospatial.mjs +84 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/indexes.mjs +31 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/metadata.mjs +138 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/node.mjs +8 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/parquet-writer.mjs +139 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/plain.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/schema.mjs +254 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/snappy.mjs +125 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/splitstream.mjs +38 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/thrift.mjs +79 -0
- package/dist/{_chunks/libs/hyparquet-writer.d.mts → node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/types.d.mts} +2 -2
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/unconvert.mjs +247 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/variant.mjs +321 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/wkb.mjs +79 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write-rows.mjs +122 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/src/write.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/bytewriter.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/node.d.mts +3 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/parquet-writer.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/schema.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/wkb.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write-rows.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.1_patch_hash_7a5e451ac7634d7546ac56bcc5eadacf7715a6241640c2b5a5bc0cfc9763b8ec/node_modules/hyparquet-writer/types/write.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/assemble.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/bloom.mjs +69 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/column.mjs +8 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/constants.mjs +80 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/convert.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/datapage.mjs +6 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/delta.mjs +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/encoding.mjs +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/filter.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/geoparquet.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/indexes.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/metadata.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/node.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plain.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/plan.mjs +5 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/query.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/read.mjs +6 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/rowgroup.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/schema.mjs +54 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/snappy.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/thrift.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/utils.mjs +19 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/variant.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/wkb.mjs +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/src/xxhash.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/index.d.mts +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/indexes.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/node.d.mts +2 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/query.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/read.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/snappy.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.1/node_modules/hyparquet/types/utils.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/assemble.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/bloom.mjs +124 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/column.mjs +127 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/constants.mjs +75 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/convert.mjs +118 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/datapage.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/delta.mjs +65 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/encoding.mjs +76 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/filter.mjs +98 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/geoparquet.mjs +24 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/index.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/indexes.mjs +16 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/metadata.mjs +235 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/node.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plain.mjs +78 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/plan.mjs +147 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/query.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/read.mjs +106 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/rowgroup.mjs +154 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/schema.mjs +75 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/snappy.mjs +70 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/thrift.mjs +86 -0
- package/dist/{_chunks/libs/hyparquet.d.mts → node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/types.d.mts} +6 -8
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/utils.mjs +31 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/variant.mjs +225 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/wkb.mjs +94 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/src/xxhash.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/indexes.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/node.d.mts +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/query.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/read.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/snappy.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.26.2/node_modules/hyparquet/types/utils.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.metadata.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.read.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/avro/avro.write.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/file.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/loadTable.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/catalog/rest.mjs +73 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/create.mjs +67 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/delete.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/fetch.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/index.mjs +13 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/json.mjs +147 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/manifest.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/metadata.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/prune.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/deletion-vector.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/puffin.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/puffin/roaring.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/read.mjs +9 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/s3.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/schema.mjs +76 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sigv4.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergDataSource.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/icebergQuery.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/sql/whereFilter.mjs +1 -0
- package/dist/{_chunks/libs/icebird.d.mts → node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/types.d.mts} +5 -33
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/utils.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/commit.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/conversions.mjs +19 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/delete-file.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/geospatial.mjs +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest-list.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/manifest.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/parquet.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/partition.mjs +75 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/rewrite.mjs +10 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/serde.mjs +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/snapshot.mjs +5 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/sort.mjs +3 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-deletion-vector.mjs +11 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage-position-delete.mjs +8 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stage.mjs +10 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/stats.mjs +4 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/transform.mjs +60 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/src/write/write.mjs +45 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/file.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/catalog/rest.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/create.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/fetch.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/index.d.mts +13 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/manifest.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/read.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/s3.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.15_patch_hash_d1902372376af18885e7c7dce807f1ecab86c2f86a9d1ff65d51e3b63b64b057/node_modules/icebird/types/write/write.d.mts +32 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/ast.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/backend/dataSource.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/accumulator.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/aggregates.mjs +10 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/execute.mjs +15 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/join.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/scanColumn.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/sort.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/streamingAggregate.mjs +9 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/utils.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/window.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/execute/yield.mjs +17 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/alias.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/binary.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/date.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/evaluate.mjs +15 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/math.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/regexp.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/expression/strings.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/index.mjs +9 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/expression.mjs +6 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/extractTables.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/functions.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/joins.mjs +7 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/parse.mjs +10 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/primary.mjs +8 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/state.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/tokenize.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/parse/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/columns.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/plan.mjs +7 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/plan/types.d.mts +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/bbox.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/equality.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/operations.mjs +5 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/pointRelations.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/primitives.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/segments.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/spatial.mjs +6 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/spatial/wkt.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/types.d.mts +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/aggregates.mjs +3 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/executionErrors.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/functions.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/keywords.mjs +1 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/parseErrors.mjs +2 -0
- package/dist/node_modules/.pnpm/squirreling@0.15.0/node_modules/squirreling/src/validation/tables.mjs +2 -0
- package/dist/parquet-plan.d.mts +15 -0
- package/dist/parquet-plan.mjs +139 -0
- package/dist/parquet-pushdown.mjs +58 -0
- package/dist/period/index.d.mts +52 -1
- package/dist/planner.d.mts +2 -14
- package/dist/planner.mjs +2 -1
- package/dist/profile.d.mts +21 -0
- package/dist/profile.mjs +27 -0
- package/dist/query-dim.d.mts +54 -0
- package/dist/query-dim.mjs +91 -0
- package/dist/report/define.d.mts +8 -0
- package/dist/report/define.mjs +15 -0
- package/dist/report/hash.d.mts +13 -0
- package/dist/report/hash.mjs +29 -0
- package/dist/report/index.d.mts +4 -170
- package/dist/report/index.mjs +3 -55
- package/dist/report/registry.d.mts +18 -0
- package/dist/report/registry.mjs +14 -0
- package/dist/report/types.d.mts +139 -0
- package/dist/resolver/adapter.d.mts +13 -0
- package/dist/resolver/adapter.mjs +27 -0
- package/dist/resolver/canonical-source.d.mts +5 -0
- package/dist/resolver/canonical-source.mjs +14 -0
- package/dist/resolver/compile.d.mts +15 -0
- package/dist/resolver/compile.mjs +396 -0
- package/dist/resolver/datasets.d.mts +16 -0
- package/dist/resolver/datasets.mjs +159 -0
- package/dist/resolver/extras-overlay.d.mts +37 -0
- package/dist/resolver/extras-overlay.mjs +17 -0
- package/dist/resolver/filter-utils.d.mts +10 -0
- package/dist/resolver/filter-utils.mjs +59 -0
- package/dist/resolver/fragments.d.mts +60 -0
- package/dist/resolver/fragments.mjs +206 -0
- package/dist/resolver/index.d.mts +11 -371
- package/dist/resolver/index.mjs +10 -1
- package/dist/resolver/pg-adapter.d.mts +56 -0
- package/dist/resolver/pg-adapter.mjs +112 -0
- package/dist/resolver/run-query.d.mts +172 -0
- package/dist/resolver/run-query.mjs +241 -0
- package/dist/resolver/schema-drift.d.mts +15 -0
- package/dist/resolver/schema-drift.mjs +12 -0
- package/dist/rollups.d.mts +4 -4
- package/dist/rollups.mjs +3 -2
- package/dist/schedule.mjs +100 -0
- package/dist/schema.d.mts +34 -1
- package/dist/schema.mjs +78 -1
- package/dist/sink-node.d.mts +1 -159
- package/dist/sink-node.mjs +1 -133
- package/dist/sink.d.mts +125 -0
- package/dist/sinks/in-memory-sink.d.mts +25 -0
- package/dist/sinks/in-memory-sink.mjs +61 -0
- package/dist/sinks/index.d.mts +2 -0
- package/dist/sinks/index.mjs +2 -0
- package/dist/snapshot.d.mts +14 -0
- package/dist/source/attached-table.d.mts +45 -0
- package/dist/source/attached-table.mjs +55 -0
- package/dist/source/create-sql-query-source.d.mts +24 -0
- package/dist/source/create-sql-query-source.mjs +28 -0
- package/dist/source/index.d.mts +6 -66
- package/dist/source/index.mjs +9 -82
- package/dist/source/source-types.d.mts +49 -0
- package/dist/{_chunks/storage.d.mts → storage.d.mts} +4 -14
- package/dist/sync-config.d.mts +36 -0
- package/dist/sync-config.mjs +98 -0
- package/dist/vendor/hysnappy-purejs.mjs +12 -1
- package/package.json +9 -4
- package/dist/_chunks/analysis-types.d.mts +0 -57
- package/dist/_chunks/contracts.d.mts +0 -1
- package/dist/_chunks/engine.mjs +0 -731
- package/dist/_chunks/entities.mjs +0 -967
- package/dist/_chunks/errors.d.mts +0 -115
- package/dist/_chunks/index.d.mts +0 -53
- package/dist/_chunks/libs/hyparquet-compressors.mjs +0 -2796
- package/dist/_chunks/libs/hyparquet-writer.mjs +0 -2524
- package/dist/_chunks/libs/hyparquet.mjs +0 -2596
- package/dist/_chunks/libs/icebird.mjs +0 -564
- package/dist/_chunks/registry.d.mts +0 -213
- package/dist/_chunks/resolver.mjs +0 -1220
- package/dist/_chunks/sink.d.mts +0 -257
- /package/dist/{_chunks → analyzer}/dispatch.mjs +0 -0
- /package/dist/{_chunks/coerce.mjs → coerce.mjs} +0 -0
- /package/dist/{_chunks/layout.mjs → layout.mjs} +0 -0
- /package/dist/{_chunks/manifest-store-utils.mjs → manifest-store-utils.mjs} +0 -0
- /package/dist/{_chunks/libs/fzstd.mjs → node_modules/.pnpm/fzstd@0.1.1/node_modules/fzstd/esm/index.mjs} +0 -0
- /package/dist/{_chunks → resolver}/types.d.mts +0 -0
- /package/dist/{_chunks/schedule.d.mts → schedule.d.mts} +0 -0
|
@@ -1,564 +0,0 @@
|
|
|
1
|
-
import "./hyparquet.mjs";
|
|
2
|
-
import "./hyparquet-writer.mjs";
|
|
3
|
-
import "./hyparquet-compressors.mjs";
|
|
4
|
-
function uuid4() {
|
|
5
|
-
if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();
|
|
6
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
7
|
-
const r = Math.random() * 16 | 0;
|
|
8
|
-
return (c === "x" ? r : r & 3 | 8).toString(16);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
12
|
-
function parseIcebergJson(text) {
|
|
13
|
-
let i = 0;
|
|
14
|
-
function skipWs() {
|
|
15
|
-
while (i < text.length) {
|
|
16
|
-
const c = text.charCodeAt(i);
|
|
17
|
-
if (c !== 32 && c !== 9 && c !== 10 && c !== 13) break;
|
|
18
|
-
i++;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function parseString() {
|
|
22
|
-
if (text[i] !== "\"") throw new Error(`expected " at ${i}`);
|
|
23
|
-
i++;
|
|
24
|
-
let s = "";
|
|
25
|
-
while (i < text.length) {
|
|
26
|
-
const c = text[i++];
|
|
27
|
-
if (c === "\"") return s;
|
|
28
|
-
if (c !== "\\") {
|
|
29
|
-
s += c;
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
const e = text[i++];
|
|
33
|
-
if (e === "u") {
|
|
34
|
-
s += String.fromCharCode(parseInt(text.slice(i, i + 4), 16));
|
|
35
|
-
i += 4;
|
|
36
|
-
} else if (e === "n") s += "\n";
|
|
37
|
-
else if (e === "t") s += " ";
|
|
38
|
-
else if (e === "r") s += "\r";
|
|
39
|
-
else if (e === "b") s += "\b";
|
|
40
|
-
else if (e === "f") s += "\f";
|
|
41
|
-
else s += e;
|
|
42
|
-
}
|
|
43
|
-
throw new Error("unterminated string");
|
|
44
|
-
}
|
|
45
|
-
function parseNumber() {
|
|
46
|
-
const start = i;
|
|
47
|
-
if (text[i] === "-") i++;
|
|
48
|
-
while (text[i] >= "0" && text[i] <= "9") i++;
|
|
49
|
-
const intEnd = i;
|
|
50
|
-
let isFloat = false;
|
|
51
|
-
if (text[i] === ".") {
|
|
52
|
-
isFloat = true;
|
|
53
|
-
i++;
|
|
54
|
-
while (text[i] >= "0" && text[i] <= "9") i++;
|
|
55
|
-
}
|
|
56
|
-
if (text[i] === "e" || text[i] === "E") {
|
|
57
|
-
isFloat = true;
|
|
58
|
-
i++;
|
|
59
|
-
if (text[i] === "+" || text[i] === "-") i++;
|
|
60
|
-
while (text[i] >= "0" && text[i] <= "9") i++;
|
|
61
|
-
}
|
|
62
|
-
if (isFloat) return Number(text.slice(start, i));
|
|
63
|
-
const intStr = text.slice(start, intEnd);
|
|
64
|
-
if (intStr.length >= 16) {
|
|
65
|
-
const n = BigInt(intStr);
|
|
66
|
-
if (n > MAX_SAFE || n < -MAX_SAFE) return n;
|
|
67
|
-
}
|
|
68
|
-
return Number(intStr);
|
|
69
|
-
}
|
|
70
|
-
function parseLiteral(lit, val) {
|
|
71
|
-
if (text.slice(i, i + lit.length) !== lit) throw new Error(`bad literal at ${i}`);
|
|
72
|
-
i += lit.length;
|
|
73
|
-
return val;
|
|
74
|
-
}
|
|
75
|
-
function parseValue() {
|
|
76
|
-
skipWs();
|
|
77
|
-
const ch = text[i];
|
|
78
|
-
if (ch === "\"") return parseString();
|
|
79
|
-
if (ch === "{") return parseObject();
|
|
80
|
-
if (ch === "[") return parseArray();
|
|
81
|
-
if (ch === "t") return parseLiteral("true", true);
|
|
82
|
-
if (ch === "f") return parseLiteral("false", false);
|
|
83
|
-
if (ch === "n") return parseLiteral("null", null);
|
|
84
|
-
return parseNumber();
|
|
85
|
-
}
|
|
86
|
-
function parseObject() {
|
|
87
|
-
i++;
|
|
88
|
-
skipWs();
|
|
89
|
-
const obj = {};
|
|
90
|
-
if (text[i] === "}") {
|
|
91
|
-
i++;
|
|
92
|
-
return obj;
|
|
93
|
-
}
|
|
94
|
-
while (true) {
|
|
95
|
-
skipWs();
|
|
96
|
-
const key = parseString();
|
|
97
|
-
skipWs();
|
|
98
|
-
if (text[i] !== ":") throw new Error(`expected : at ${i}`);
|
|
99
|
-
i++;
|
|
100
|
-
obj[key] = parseValue();
|
|
101
|
-
skipWs();
|
|
102
|
-
if (text[i] === ",") {
|
|
103
|
-
i++;
|
|
104
|
-
continue;
|
|
105
|
-
}
|
|
106
|
-
if (text[i] === "}") {
|
|
107
|
-
i++;
|
|
108
|
-
return obj;
|
|
109
|
-
}
|
|
110
|
-
throw new Error(`expected , or } at ${i}`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
function parseArray() {
|
|
114
|
-
i++;
|
|
115
|
-
skipWs();
|
|
116
|
-
const arr = [];
|
|
117
|
-
if (text[i] === "]") {
|
|
118
|
-
i++;
|
|
119
|
-
return arr;
|
|
120
|
-
}
|
|
121
|
-
while (true) {
|
|
122
|
-
arr.push(parseValue());
|
|
123
|
-
skipWs();
|
|
124
|
-
if (text[i] === ",") {
|
|
125
|
-
i++;
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
if (text[i] === "]") {
|
|
129
|
-
i++;
|
|
130
|
-
return arr;
|
|
131
|
-
}
|
|
132
|
-
throw new Error(`expected , or ] at ${i}`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
const value = parseValue();
|
|
136
|
-
skipWs();
|
|
137
|
-
if (i !== text.length) throw new Error(`unexpected trailing input at ${i}`);
|
|
138
|
-
return value;
|
|
139
|
-
}
|
|
140
|
-
function stringifyIcebergJson(value, indent = 2) {
|
|
141
|
-
const pad = " ".repeat(indent);
|
|
142
|
-
function serialize(val, depth) {
|
|
143
|
-
if (typeof val === "bigint") return val.toString();
|
|
144
|
-
if (val === null || typeof val !== "object") return JSON.stringify(val);
|
|
145
|
-
const inner = pad.repeat(depth + 1);
|
|
146
|
-
const outer = pad.repeat(depth);
|
|
147
|
-
if (Array.isArray(val)) {
|
|
148
|
-
if (val.length === 0) return "[]";
|
|
149
|
-
return `[\n${val.map((v) => inner + serialize(v === void 0 ? null : v, depth + 1)).join(",\n")}\n${outer}]`;
|
|
150
|
-
}
|
|
151
|
-
const keys = Object.keys(val).filter((k) => val[k] !== void 0);
|
|
152
|
-
if (keys.length === 0) return "{}";
|
|
153
|
-
return `{\n${keys.map((k) => `${inner}${JSON.stringify(k)}: ${serialize(val[k], depth + 1)}`).join(",\n")}\n${outer}}`;
|
|
154
|
-
}
|
|
155
|
-
return serialize(value, 0);
|
|
156
|
-
}
|
|
157
|
-
async function restCatalogCreateTable(ctx, { namespace, table, schema, location, partitionSpec, writeOrder, stageCreate, properties }) {
|
|
158
|
-
const ns = encodeNamespace(namespace);
|
|
159
|
-
const body = {
|
|
160
|
-
name: table,
|
|
161
|
-
schema
|
|
162
|
-
};
|
|
163
|
-
if (location !== void 0) body.location = location;
|
|
164
|
-
if (partitionSpec !== void 0) body["partition-spec"] = partitionSpec;
|
|
165
|
-
if (writeOrder !== void 0) body["write-order"] = writeOrder;
|
|
166
|
-
if (stageCreate !== void 0) body["stage-create"] = stageCreate;
|
|
167
|
-
if (properties !== void 0) body.properties = properties;
|
|
168
|
-
const responseBody = parseIcebergJson(await (await restFetch(ctx, `namespaces/${ns}/tables`, {
|
|
169
|
-
method: "POST",
|
|
170
|
-
headers: { "content-type": "application/json" },
|
|
171
|
-
body: stringifyIcebergJson(body)
|
|
172
|
-
})).text());
|
|
173
|
-
return {
|
|
174
|
-
metadataLocation: responseBody["metadata-location"],
|
|
175
|
-
metadata: responseBody.metadata,
|
|
176
|
-
config: responseBody.config ?? {}
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
function encodeNamespace(namespace) {
|
|
180
|
-
return (Array.isArray(namespace) ? namespace : namespace.split(".")).map((p) => encodeURIComponent(p)).join("%1F");
|
|
181
|
-
}
|
|
182
|
-
async function restFetch(ctx, path, init) {
|
|
183
|
-
const prefixSegment = ctx.prefix ? `${ctx.prefix.replace(/^\/|\/$/g, "")}/` : "";
|
|
184
|
-
const fullUrl = `${ctx.url}/v1/${prefixSegment}${path}`;
|
|
185
|
-
let merged = mergeRequestInit(ctx.requestInit, init);
|
|
186
|
-
if (ctx.signRequest) merged = await ctx.signRequest(fullUrl, merged);
|
|
187
|
-
const res = await fetch(fullUrl, merged);
|
|
188
|
-
if (!res.ok) await throwRestError(res);
|
|
189
|
-
return res;
|
|
190
|
-
}
|
|
191
|
-
function mergeRequestInit(a, b) {
|
|
192
|
-
if (!a) return b;
|
|
193
|
-
if (!b) return a;
|
|
194
|
-
return {
|
|
195
|
-
...a,
|
|
196
|
-
...b,
|
|
197
|
-
headers: {
|
|
198
|
-
...headersToObject(a.headers),
|
|
199
|
-
...headersToObject(b.headers)
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
function headersToObject(h) {
|
|
204
|
-
if (!h) return {};
|
|
205
|
-
if (h instanceof Headers) {
|
|
206
|
-
const out = {};
|
|
207
|
-
h.forEach((v, k) => {
|
|
208
|
-
out[k] = v;
|
|
209
|
-
});
|
|
210
|
-
return out;
|
|
211
|
-
}
|
|
212
|
-
if (Array.isArray(h)) return Object.fromEntries(h);
|
|
213
|
-
return h;
|
|
214
|
-
}
|
|
215
|
-
async function throwRestError(res) {
|
|
216
|
-
let detail = "";
|
|
217
|
-
try {
|
|
218
|
-
const body = parseIcebergJson(await res.text());
|
|
219
|
-
if (body?.error) {
|
|
220
|
-
const { code, type, message } = body.error;
|
|
221
|
-
detail = `${code ?? res.status} ${type ?? ""}: ${message ?? ""}`.trim();
|
|
222
|
-
}
|
|
223
|
-
} catch {}
|
|
224
|
-
const err = new Error(detail || `${res.status} ${res.statusText}`);
|
|
225
|
-
err.status = res.status;
|
|
226
|
-
throw err;
|
|
227
|
-
}
|
|
228
|
-
function validateSchemaForVersion(schema, formatVersion) {
|
|
229
|
-
for (const field of schema.fields) validateFieldForVersion(field, formatVersion, field.name);
|
|
230
|
-
}
|
|
231
|
-
function maxFieldId(fields = []) {
|
|
232
|
-
let max = 0;
|
|
233
|
-
for (const field of fields) {
|
|
234
|
-
if (max < field.id) max = field.id;
|
|
235
|
-
const nested = maxNestedFieldId(field.type);
|
|
236
|
-
if (max < nested) max = nested;
|
|
237
|
-
}
|
|
238
|
-
return max;
|
|
239
|
-
}
|
|
240
|
-
function maxNestedFieldId(type) {
|
|
241
|
-
if (typeof type === "string") return 0;
|
|
242
|
-
if (type.type === "list") {
|
|
243
|
-
const elementId = type["element-id"] ?? 0;
|
|
244
|
-
return Math.max(elementId, maxNestedFieldId(type.element));
|
|
245
|
-
}
|
|
246
|
-
if (type.type === "map") {
|
|
247
|
-
const keyId = type["key-id"] ?? 0;
|
|
248
|
-
const valueId = type["value-id"] ?? 0;
|
|
249
|
-
return Math.max(keyId, valueId, maxNestedFieldId(type.key), maxNestedFieldId(type.value));
|
|
250
|
-
}
|
|
251
|
-
if (type.type === "struct") return maxFieldId(type.fields);
|
|
252
|
-
return 0;
|
|
253
|
-
}
|
|
254
|
-
const MAX_USER_FIELD_ID = 2147483447;
|
|
255
|
-
function validateFieldForVersion(field, formatVersion, path) {
|
|
256
|
-
if (typeof field.id === "number" && field.id > MAX_USER_FIELD_ID) throw new Error(`field id ${field.id} is in the reserved range (> ${MAX_USER_FIELD_ID}) (field: ${path})`);
|
|
257
|
-
if (formatVersion < 3) {
|
|
258
|
-
checkTypeForV2(field.type, path);
|
|
259
|
-
if (field["initial-default"] !== void 0) throw new Error(`initial-default requires format-version 3 (field: ${path})`);
|
|
260
|
-
if (field["write-default"] !== void 0) throw new Error(`write-default requires format-version 3 (field: ${path})`);
|
|
261
|
-
} else checkV3Default(field, path);
|
|
262
|
-
checkNestedFieldsForVersion(field.type, formatVersion, path);
|
|
263
|
-
}
|
|
264
|
-
function checkTypeForV2(type, path) {
|
|
265
|
-
if (typeof type === "string") {
|
|
266
|
-
if (type === "unknown" || type === "variant" || type === "timestamp_ns" || type === "timestamptz_ns" || type === "geometry" || type.startsWith("geometry(") || type === "geography" || type.startsWith("geography(")) throw new Error(`type ${type} requires format-version 3 (field: ${path})`);
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (type.type === "struct") for (const f of type.fields) checkTypeForV2(f.type, `${path}.${f.name}`);
|
|
270
|
-
else if (type.type === "list") checkTypeForV2(type.element, `${path}.element`);
|
|
271
|
-
else if (type.type === "map") {
|
|
272
|
-
checkTypeForV2(type.key, `${path}.key`);
|
|
273
|
-
checkTypeForV2(type.value, `${path}.value`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
function checkV3Default(field, path) {
|
|
277
|
-
const type = typeName(field.type);
|
|
278
|
-
if (!requiresNullDefault(type)) return;
|
|
279
|
-
for (const key of ["initial-default", "write-default"]) if (field[key] != null) throw new Error(`${key} for field ${path} of type ${type} must default to null`);
|
|
280
|
-
}
|
|
281
|
-
function checkNestedFieldsForVersion(type, formatVersion, path) {
|
|
282
|
-
if (typeof type === "string") return;
|
|
283
|
-
if (type.type === "struct") for (const f of type.fields) validateFieldForVersion(f, formatVersion, `${path}.${f.name}`);
|
|
284
|
-
else if (type.type === "list") {
|
|
285
|
-
checkReservedFieldId(type["element-id"], `${path}.element`);
|
|
286
|
-
checkNestedFieldsForVersion(type.element, formatVersion, `${path}.element`);
|
|
287
|
-
} else if (type.type === "map") {
|
|
288
|
-
checkReservedFieldId(type["key-id"], `${path}.key`);
|
|
289
|
-
checkReservedFieldId(type["value-id"], `${path}.value`);
|
|
290
|
-
checkNestedFieldsForVersion(type.key, formatVersion, `${path}.key`);
|
|
291
|
-
checkNestedFieldsForVersion(type.value, formatVersion, `${path}.value`);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
function checkReservedFieldId(id, path) {
|
|
295
|
-
if (typeof id === "number" && id > MAX_USER_FIELD_ID) throw new Error(`field id ${id} is in the reserved range (> ${MAX_USER_FIELD_ID}) (field: ${path})`);
|
|
296
|
-
}
|
|
297
|
-
function typeName(type) {
|
|
298
|
-
return typeof type === "string" ? type : type.type;
|
|
299
|
-
}
|
|
300
|
-
function requiresNullDefault(type) {
|
|
301
|
-
return type === "unknown" || type === "variant" || type === "geometry" || type.startsWith("geometry(") || type === "geography" || type.startsWith("geography(");
|
|
302
|
-
}
|
|
303
|
-
function parseDecimalType(type) {
|
|
304
|
-
const m = /^decimal\((\d+),\s*(\d+)\)$/.exec(type);
|
|
305
|
-
if (!m) return void 0;
|
|
306
|
-
return {
|
|
307
|
-
precision: parseInt(m[1], 10),
|
|
308
|
-
scale: parseInt(m[2], 10)
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
function decimalRequiredBytes(precision) {
|
|
312
|
-
const limit = 10n ** BigInt(precision);
|
|
313
|
-
let n = 1;
|
|
314
|
-
let bound = 128n;
|
|
315
|
-
while (limit > bound) {
|
|
316
|
-
n++;
|
|
317
|
-
bound <<= 8n;
|
|
318
|
-
}
|
|
319
|
-
return n;
|
|
320
|
-
}
|
|
321
|
-
function parseTransform(transform) {
|
|
322
|
-
if (transform === "identity" || transform === "void" || transform === "year" || transform === "month" || transform === "day" || transform === "hour") return { kind: transform };
|
|
323
|
-
let m = /^bucket\[(\d+)\]$/.exec(transform);
|
|
324
|
-
if (m) {
|
|
325
|
-
const n = parseInt(m[1], 10);
|
|
326
|
-
if (n > 0) return {
|
|
327
|
-
kind: "bucket",
|
|
328
|
-
n
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
m = /^truncate\[(\d+)\]$/.exec(transform);
|
|
332
|
-
if (m) {
|
|
333
|
-
const w = parseInt(m[1], 10);
|
|
334
|
-
if (w > 0) return {
|
|
335
|
-
kind: "truncate",
|
|
336
|
-
w
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
throw new Error(`unsupported partition transform: ${transform}`);
|
|
340
|
-
}
|
|
341
|
-
function transformResultType(transform, sourceType) {
|
|
342
|
-
const parsed = parseTransform(transform);
|
|
343
|
-
validateTransformSource(parsed, sourceType);
|
|
344
|
-
switch (parsed.kind) {
|
|
345
|
-
case "identity":
|
|
346
|
-
case "truncate": return sourceType;
|
|
347
|
-
case "void": return "int";
|
|
348
|
-
case "year":
|
|
349
|
-
case "month":
|
|
350
|
-
case "day":
|
|
351
|
-
case "hour":
|
|
352
|
-
case "bucket": return "int";
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
function validateTransformSource(parsed, sourceType) {
|
|
356
|
-
const t = typeName(sourceType);
|
|
357
|
-
switch (parsed.kind) {
|
|
358
|
-
case "identity":
|
|
359
|
-
if (t === "variant" || t === "geometry" || t.startsWith("geometry(") || t === "geography" || t.startsWith("geography(")) throw new Error(`identity transform: unsupported source type ${t}`);
|
|
360
|
-
return;
|
|
361
|
-
case "void": return;
|
|
362
|
-
case "bucket":
|
|
363
|
-
if (t === "int" || t === "long" || t.startsWith("decimal(") || t === "date" || t === "time" || t === "timestamp" || t === "timestamptz" || t === "timestamp_ns" || t === "timestamptz_ns" || t === "string" || t === "uuid" || t.startsWith("fixed[") || t === "binary" || t === "fixed") return;
|
|
364
|
-
throw new Error(`bucket transform: unsupported source type ${t}`);
|
|
365
|
-
case "truncate":
|
|
366
|
-
if (t === "int" || t === "long" || t.startsWith("decimal(") || t === "string" || t === "binary") return;
|
|
367
|
-
throw new Error(`truncate transform: unsupported source type ${t}`);
|
|
368
|
-
case "year":
|
|
369
|
-
case "month":
|
|
370
|
-
case "day":
|
|
371
|
-
if (t === "date" || t === "timestamp" || t === "timestamptz" || t === "timestamp_ns" || t === "timestamptz_ns") return;
|
|
372
|
-
throw new Error(`${parsed.kind} transform: unsupported source type ${t}`);
|
|
373
|
-
case "hour":
|
|
374
|
-
if (t === "timestamp" || t === "timestamptz" || t === "timestamp_ns" || t === "timestamptz_ns") return;
|
|
375
|
-
throw new Error("hour transform: unsupported source type " + t);
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
function validatePartitionSpecForWrite(schema, partitionSpec, label = "partition spec") {
|
|
379
|
-
for (const pf of partitionSpec.fields) {
|
|
380
|
-
const sourceId = pf["source-id"];
|
|
381
|
-
if (sourceId === void 0) throw new Error(`${label}: partition field ${pf.name} is missing source-id`);
|
|
382
|
-
const sourceField = schema.fields.find((f) => f.id === sourceId);
|
|
383
|
-
if (!sourceField) throw new Error(`${label}: partition source field id ${sourceId} not found in schema`);
|
|
384
|
-
icebergTypeToAvro(transformResultType(pf.transform, sourceField.type), pf["field-id"]);
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
function icebergTypeToAvro(type, fieldId) {
|
|
388
|
-
const name = typeof type === "string" ? type : type.type;
|
|
389
|
-
const decimal = parseDecimalType(name);
|
|
390
|
-
if (decimal) return {
|
|
391
|
-
type: "fixed",
|
|
392
|
-
name: `r102_${fieldId}`,
|
|
393
|
-
size: decimalRequiredBytes(decimal.precision),
|
|
394
|
-
logicalType: "decimal",
|
|
395
|
-
precision: decimal.precision,
|
|
396
|
-
scale: decimal.scale
|
|
397
|
-
};
|
|
398
|
-
const fixed = /^fixed\[(\d+)\]$/.exec(name);
|
|
399
|
-
if (fixed) return {
|
|
400
|
-
type: "fixed",
|
|
401
|
-
name: `r102_${fieldId}`,
|
|
402
|
-
size: parseInt(fixed[1], 10)
|
|
403
|
-
};
|
|
404
|
-
switch (name) {
|
|
405
|
-
case "boolean": return "boolean";
|
|
406
|
-
case "int": return "int";
|
|
407
|
-
case "long": return "long";
|
|
408
|
-
case "float": return "float";
|
|
409
|
-
case "double": return "double";
|
|
410
|
-
case "string": return "string";
|
|
411
|
-
case "uuid": return {
|
|
412
|
-
type: "fixed",
|
|
413
|
-
name: `r102_${fieldId}`,
|
|
414
|
-
size: 16,
|
|
415
|
-
logicalType: "uuid"
|
|
416
|
-
};
|
|
417
|
-
case "binary": return "bytes";
|
|
418
|
-
case "date": return {
|
|
419
|
-
type: "int",
|
|
420
|
-
logicalType: "date"
|
|
421
|
-
};
|
|
422
|
-
case "time": return {
|
|
423
|
-
type: "long",
|
|
424
|
-
logicalType: "time-micros"
|
|
425
|
-
};
|
|
426
|
-
case "timestamp": return {
|
|
427
|
-
type: "long",
|
|
428
|
-
logicalType: "timestamp-micros",
|
|
429
|
-
"adjust-to-utc": false
|
|
430
|
-
};
|
|
431
|
-
case "timestamptz": return {
|
|
432
|
-
type: "long",
|
|
433
|
-
logicalType: "timestamp-micros",
|
|
434
|
-
"adjust-to-utc": true
|
|
435
|
-
};
|
|
436
|
-
case "timestamp_ns": return {
|
|
437
|
-
type: "long",
|
|
438
|
-
logicalType: "timestamp-nanos",
|
|
439
|
-
"adjust-to-utc": false
|
|
440
|
-
};
|
|
441
|
-
case "timestamptz_ns": return {
|
|
442
|
-
type: "long",
|
|
443
|
-
logicalType: "timestamp-nanos",
|
|
444
|
-
"adjust-to-utc": true
|
|
445
|
-
};
|
|
446
|
-
default: throw new Error(`unsupported partition source type: ${name}`);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
async function icebergCreate({ tableUrl, resolver, schema, formatVersion, partitionSpec, sortOrder, properties, conditionalCommits }) {
|
|
450
|
-
if (!tableUrl) throw new Error("tableUrl is required");
|
|
451
|
-
if (formatVersion === void 0) {
|
|
452
|
-
const propVersion = properties?.["format-version"];
|
|
453
|
-
formatVersion = propVersion !== void 0 ? Number(propVersion) : 2;
|
|
454
|
-
}
|
|
455
|
-
if (formatVersion !== 2 && formatVersion !== 3) throw new Error(`unsupported format-version: ${formatVersion}`);
|
|
456
|
-
const metadataVersion = 1;
|
|
457
|
-
const metadataUrl = `${tableUrl}/metadata/v${metadataVersion}.metadata.json`;
|
|
458
|
-
const initialSchema = schema ?? {
|
|
459
|
-
type: "struct",
|
|
460
|
-
"schema-id": 0,
|
|
461
|
-
fields: []
|
|
462
|
-
};
|
|
463
|
-
validateSchemaForVersion(initialSchema, formatVersion);
|
|
464
|
-
const initialPartitionSpec = partitionSpec ?? {
|
|
465
|
-
"spec-id": 0,
|
|
466
|
-
fields: []
|
|
467
|
-
};
|
|
468
|
-
validatePartitionSpecForWrite(initialSchema, initialPartitionSpec);
|
|
469
|
-
const initialSortOrder = sortOrder ?? {
|
|
470
|
-
"order-id": 0,
|
|
471
|
-
fields: []
|
|
472
|
-
};
|
|
473
|
-
const metadata = {
|
|
474
|
-
"format-version": formatVersion,
|
|
475
|
-
"table-uuid": uuid4(),
|
|
476
|
-
location: tableUrl,
|
|
477
|
-
"last-sequence-number": 0,
|
|
478
|
-
"last-updated-ms": Date.now(),
|
|
479
|
-
"last-column-id": maxFieldId(initialSchema.fields),
|
|
480
|
-
"current-schema-id": initialSchema["schema-id"] ?? 0,
|
|
481
|
-
schemas: [initialSchema],
|
|
482
|
-
"default-spec-id": initialPartitionSpec["spec-id"],
|
|
483
|
-
"partition-specs": [initialPartitionSpec],
|
|
484
|
-
"last-partition-id": maxPartitionFieldId(initialPartitionSpec.fields),
|
|
485
|
-
"sort-orders": [initialSortOrder],
|
|
486
|
-
"default-sort-order-id": initialSortOrder["order-id"]
|
|
487
|
-
};
|
|
488
|
-
if (properties) metadata.properties = properties;
|
|
489
|
-
if (formatVersion >= 3) metadata["next-row-id"] = 0;
|
|
490
|
-
if (!resolver.writer) throw new Error("resolver.writer is required");
|
|
491
|
-
const metadataWriter = conditionalCommits ? resolver.writer(metadataUrl, { ifNoneMatch: "*" }) : resolver.writer(metadataUrl);
|
|
492
|
-
const metadataBytes = new TextEncoder().encode(stringifyIcebergJson(metadata));
|
|
493
|
-
metadataWriter.appendBytes(metadataBytes);
|
|
494
|
-
await metadataWriter.finish();
|
|
495
|
-
const versionHintUrl = `${tableUrl}/metadata/version-hint.text`;
|
|
496
|
-
try {
|
|
497
|
-
const versionHintWriter = resolver.writer(versionHintUrl);
|
|
498
|
-
const versionHintBytes = new TextEncoder().encode(String(metadataVersion));
|
|
499
|
-
versionHintWriter.appendBytes(versionHintBytes);
|
|
500
|
-
await versionHintWriter.finish();
|
|
501
|
-
} catch (err) {
|
|
502
|
-
if (!conditionalCommits) throw err;
|
|
503
|
-
}
|
|
504
|
-
return metadata;
|
|
505
|
-
}
|
|
506
|
-
function maxPartitionFieldId(partitionFields = []) {
|
|
507
|
-
let max = 0;
|
|
508
|
-
for (const pf of partitionFields) if (max < pf["field-id"]) max = pf["field-id"];
|
|
509
|
-
return max;
|
|
510
|
-
}
|
|
511
|
-
Object.freeze({
|
|
512
|
-
maxAttempts: 50,
|
|
513
|
-
initialMs: 50,
|
|
514
|
-
maxMs: 3e3,
|
|
515
|
-
factor: 2,
|
|
516
|
-
totalTimeoutMs: 1800 * 1e3
|
|
517
|
-
});
|
|
518
|
-
async function icebergCreateTable({ catalog, namespace, table, tableUrl, schema, partitionSpec, sortOrder, properties, formatVersion, stageCreate }) {
|
|
519
|
-
if (catalog.type === "rest") {
|
|
520
|
-
if (!namespace || !table) throw new Error("namespace and table are required for rest catalogs");
|
|
521
|
-
if (!schema) throw new Error("schema is required for rest catalogs");
|
|
522
|
-
const { metadata } = await restCatalogCreateTable(catalog, {
|
|
523
|
-
namespace,
|
|
524
|
-
table,
|
|
525
|
-
schema,
|
|
526
|
-
location: tableUrl,
|
|
527
|
-
partitionSpec,
|
|
528
|
-
writeOrder: sortOrder,
|
|
529
|
-
stageCreate,
|
|
530
|
-
properties
|
|
531
|
-
});
|
|
532
|
-
return metadata;
|
|
533
|
-
}
|
|
534
|
-
if (!tableUrl) throw new Error("tableUrl is required for file catalogs");
|
|
535
|
-
return await icebergCreate({
|
|
536
|
-
tableUrl,
|
|
537
|
-
resolver: catalog.resolver,
|
|
538
|
-
schema,
|
|
539
|
-
formatVersion,
|
|
540
|
-
partitionSpec,
|
|
541
|
-
sortOrder,
|
|
542
|
-
properties,
|
|
543
|
-
conditionalCommits: catalog.conditionalCommits
|
|
544
|
-
});
|
|
545
|
-
}
|
|
546
|
-
new TextEncoder();
|
|
547
|
-
(() => {
|
|
548
|
-
if (typeof setImmediate === "function") return () => new Promise((resolve) => setImmediate(resolve));
|
|
549
|
-
if (typeof MessageChannel !== "undefined") {
|
|
550
|
-
const channel = new MessageChannel();
|
|
551
|
-
const queue = [];
|
|
552
|
-
channel.port1.onmessage = () => {
|
|
553
|
-
const resolve = queue.shift();
|
|
554
|
-
if (resolve) resolve();
|
|
555
|
-
};
|
|
556
|
-
return () => new Promise((resolve) => {
|
|
557
|
-
queue.push(resolve);
|
|
558
|
-
channel.port2.postMessage(0);
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
return () => new Promise((resolve) => setTimeout(resolve, 0));
|
|
562
|
-
})();
|
|
563
|
-
new TextEncoder();
|
|
564
|
-
export { icebergCreateTable };
|