@gscdump/engine 3.5.0 → 3.6.0
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/README.md +28 -18
- package/dist/THIRD-PARTY-LICENSES.md +2 -2
- package/dist/adapters/duckdb-node.d.mts +4 -4
- package/dist/adapters/duckdb-node.mjs +103 -77
- package/dist/adapters/filesystem.d.mts +6 -7
- package/dist/adapters/filesystem.mjs +11 -6
- package/dist/adapters/hyparquet.d.mts +9 -10
- package/dist/adapters/hyparquet.mjs +84 -44
- package/dist/adapters/node-harness.d.mts +3 -4
- package/dist/adapters/parquet-attach.d.mts +4 -5
- package/dist/adapters/parquet-attach.mjs +7 -2
- package/dist/adapters/r2-manifest.d.mts +4 -5
- package/dist/adapters/r2.d.mts +2 -3
- package/dist/adapters/snapshot-attach.d.mts +7 -8
- package/dist/adapters/snapshot-attach.mjs +7 -2
- package/dist/analysis-range.d.mts +2 -3
- package/dist/analysis-types.d.mts +4 -5
- package/dist/analyzer/define.d.mts +6 -7
- package/dist/analyzer/dispatch.d.mts +2 -3
- package/dist/analyzer/registry.d.mts +4 -5
- package/dist/analyzer/types.d.mts +11 -12
- package/dist/arrow-utils.d.mts +4 -5
- package/dist/arrow-utils.mjs +10 -0
- package/dist/coerce.d.mts +1 -2
- package/dist/compaction.d.mts +2 -3
- package/dist/drizzle-schema.d.mts +14 -15
- package/dist/duckdb.d.mts +5 -6
- package/dist/duckdb.mjs +9 -5
- package/dist/engine.d.mts +1 -2
- package/dist/entities/empty-types.d.mts +4 -5
- package/dist/entities/indexing-metadata.d.mts +5 -6
- package/dist/entities/inspection.d.mts +9 -10
- package/dist/entities/query-dim.d.mts +7 -7
- package/dist/entities/sitemap-shared.d.mts +26 -27
- package/dist/entities/sitemap-write.d.mts +1 -2
- package/dist/entities/sitemap.d.mts +1 -2
- package/dist/entity-keys.d.mts +28 -29
- package/dist/errors.d.mts +5 -6
- package/dist/iceberg/append-sink.d.mts +2 -3
- package/dist/iceberg/catalog.d.mts +10 -10
- package/dist/iceberg/catalog.mjs +2 -2
- package/dist/iceberg/overwrite-writer.d.mts +17 -18
- package/dist/iceberg/schema.d.mts +16 -16
- package/dist/ingest-accumulator.d.mts +8 -9
- package/dist/ingest.d.mts +15 -12
- package/dist/ingest.mjs +22 -6
- package/dist/layout.d.mts +4 -5
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/datapage.mjs +1 -1
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/indexes.mjs +1 -1
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/metadata.mjs +1 -1
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/src/types.d.mts +2 -3
- package/dist/node_modules/.pnpm/hyparquet-writer@0.16.9_patch_hash_d26d002aede61ad95dd633d6557b56897cdcbc45dfc3a5d93fa0e9075ad5425f/node_modules/hyparquet-writer/types/index.d.mts +2 -3
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/assemble.mjs +3 -144
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/bloom.mjs +3 -58
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/column.mjs +8 -129
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/convert.mjs +3 -118
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/datapage.mjs +6 -144
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/delta.mjs +2 -65
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/encoding.mjs +2 -76
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/filter.mjs +4 -212
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/geoparquet.mjs +1 -24
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/index.mjs +3 -3
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/indexes.mjs +5 -32
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/metadata.mjs +7 -241
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/node.mjs +1 -5
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/plain.mjs +1 -79
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/plan.mjs +6 -375
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/read.mjs +6 -77
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/rowgroup.mjs +7 -175
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/scan.mjs +5 -73
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/schema.mjs +1 -22
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/snappy.mjs +1 -68
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/thrift.mjs +1 -86
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/types.d.mts +2 -28
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/utils.mjs +1 -31
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/variant.mjs +3 -228
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/wkb.mjs +1 -94
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/index.d.mts +2 -52
- package/dist/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/types/node.d.mts +2 -2
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/assemble.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/bloom.mjs +124 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/column.mjs +129 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/constants.mjs +80 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/convert.mjs +118 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/datapage.mjs +144 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/delta.mjs +65 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/encoding.mjs +76 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/filter.mjs +212 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/geoparquet.mjs +24 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/index.mjs +8 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/indexes.mjs +32 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/metadata.mjs +241 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/node.mjs +7 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/plain.mjs +79 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/plan.mjs +375 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/query.mjs +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/read.mjs +81 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/rowgroup.mjs +175 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/scan.mjs +74 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/schema.mjs +75 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/snappy.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/thrift.mjs +86 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/types.d.mts +25 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/utils.mjs +32 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/variant.mjs +228 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/wkb.mjs +94 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/src/xxhash.mjs +68 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/index.d.mts +58 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/node.d.mts +3 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/scan.d.mts +1 -0
- package/dist/node_modules/.pnpm/hyparquet@1.30.0/node_modules/hyparquet/types/utils.d.mts +1 -0
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/read.mjs +1 -1
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/icebergDataSource.mjs +1 -1
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/icebergQuery.mjs +1 -1
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/types.d.mts +17 -18
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/create.d.mts +1 -0
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/index.d.mts +1 -1
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/manifest.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/metadata.d.mts +1 -0
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/read.d.mts +1 -1
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/s3.d.mts +1 -0
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
- package/dist/node_modules/.pnpm/icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
- package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/write/write.d.mts +2 -3
- package/dist/node_modules/.pnpm/squirreling@0.16.4/node_modules/squirreling/src/ast.d.mts +1 -0
- package/dist/parquet-plan.d.mts +5 -6
- package/dist/period/index.d.mts +8 -8
- package/dist/profile.d.mts +3 -3
- package/dist/report/define.d.mts +1 -2
- package/dist/report/hash.d.mts +3 -4
- package/dist/report/registry.d.mts +3 -4
- package/dist/report/types.d.mts +22 -23
- package/dist/resolver/adapter.d.mts +2 -3
- package/dist/resolver/canonical-source.d.mts +1 -2
- package/dist/resolver/compile.d.mts +12 -8
- package/dist/resolver/compile.mjs +7 -3
- package/dist/resolver/datasets.d.mts +9 -9
- package/dist/resolver/extras-overlay.d.mts +2 -3
- package/dist/resolver/filter-utils.d.mts +7 -7
- package/dist/resolver/fragments.d.mts +3 -4
- package/dist/resolver/pg-adapter.d.mts +7 -8
- package/dist/resolver/run-query.d.mts +16 -17
- package/dist/resolver/run-query.mjs +16 -15
- package/dist/resolver/schema-drift.d.mts +2 -3
- package/dist/resolver/types.d.mts +8 -9
- package/dist/rollups/canonical.d.mts +4 -5
- package/dist/rollups/core.d.mts +12 -13
- package/dist/rollups/defaults.d.mts +2 -3
- package/dist/rollups/hourly.d.mts +3 -4
- package/dist/rollups/indexing.d.mts +5 -6
- package/dist/rollups/traffic.d.mts +5 -6
- package/dist/rollups/windows.d.mts +7 -8
- package/dist/schedule.d.mts +6 -7
- package/dist/schema.d.mts +9 -9
- package/dist/scope.d.mts +6 -7
- package/dist/sink.d.mts +9 -10
- package/dist/sinks/in-memory-sink.d.mts +3 -4
- package/dist/snapshot.d.mts +2 -3
- package/dist/source/attached-table.d.mts +4 -5
- package/dist/source/create-sql-query-source.d.mts +2 -3
- package/dist/source/index.d.mts +6 -6
- package/dist/source/source-types.d.mts +7 -8
- package/dist/sql-bind.d.mts +3 -4
- package/dist/sql-fragments.d.mts +5 -6
- package/dist/storage.d.mts +37 -37
- package/dist/sync-config.d.mts +20 -21
- package/dist/vendor/hysnappy-purejs.d.mts +2 -3
- package/dist/vendor/hysnappy-purejs.mjs +1 -1
- package/package.json +12 -10
- package/dist/node_modules/.pnpm/icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergDataSource.d.mts +0 -2
- package/dist/node_modules/.pnpm/icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/sql/icebergQuery.d.mts +0 -2
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/create.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/indexes.d.mts} +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird → hyparquet@1.30.0/node_modules/hyparquet}/types/metadata.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/manifest.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/query.d.mts} +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7/node_modules/icebird/types/s3.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/read.d.mts} +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3/node_modules/squirreling/src/ast.d.mts → hyparquet@1.30.0/node_modules/hyparquet/types/snappy.d.mts} +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.metadata.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.read.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/avro/avro.write.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/file.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/loadTable.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/catalog/rest.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/create.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/delete.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/fetch.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/json.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/manifest.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/metadata.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/prune.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/deletion-vector.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/puffin.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/puffin/roaring.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/s3.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/schema.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sigv4.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/sql/whereFilter.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/utils.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/commit.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/conversions.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/delete-file.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/geospatial.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/manifest-list.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/manifest.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/parquet.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/partition.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/rewrite.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/serde.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/snapshot.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/sort.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage-deletion-vector.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage-position-delete.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stage.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/stats.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/transform.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/src/write/write.mjs +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/catalog/file.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/catalog/rest.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{icebird@0.8.27_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7 → icebird@0.8.28_patch_hash_651b5cc1b513184638c98e21a0852c4559044ae60f8449fbe9d81a894ea5b4d7}/node_modules/icebird/types/fetch.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/batch.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/batchAdapters.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/backend/dataSource.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/accumulator.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/aggregates.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/batchResults.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/batches.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/execute.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/fold.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/join.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/rowScope.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/scanColumn.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/sort.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/streamingAggregate.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/utils.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/window.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/execute/yield.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/alias.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/batch.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/binary.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/date.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/evaluate.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/math.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/regexp.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/scalar.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/expression/strings.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/index.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/index.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/expression.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/extractTables.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/functions.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/joins.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/parse.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/primary.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/state.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/tokenize.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/parse/types.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/columns.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/plan.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/plan/types.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/bbox.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/equality.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/operations.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/pointRelations.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/primitives.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/segments.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/spatial.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/spatial/wkt.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/types.d.mts +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/aggregates.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/executionErrors.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/functions.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/keywords.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/parseErrors.mjs +0 -0
- /package/dist/node_modules/.pnpm/{squirreling@0.16.3 → squirreling@0.16.4}/node_modules/squirreling/src/validation/tables.mjs +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { getMaxDefinitionLevel, getMaxRepetitionLevel } from "./schema.mjs";
|
|
2
|
+
import { deltaBinaryUnpack, deltaByteArray, deltaLengthByteArray } from "./delta.mjs";
|
|
3
|
+
import { byteStreamSplit, readRleBitPackedHybrid } from "./encoding.mjs";
|
|
4
|
+
import { readPlain } from "./plain.mjs";
|
|
5
|
+
import { snappyUncompress } from "./snappy.mjs";
|
|
6
|
+
function readDataPage(bytes, daph, { type, element, schemaPath }) {
|
|
7
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
8
|
+
const reader = {
|
|
9
|
+
view,
|
|
10
|
+
offset: 0
|
|
11
|
+
};
|
|
12
|
+
let dataPage;
|
|
13
|
+
const repetitionLevels = readRepetitionLevels(reader, daph, schemaPath);
|
|
14
|
+
const { definitionLevels, numNulls } = readDefinitionLevels(reader, daph, schemaPath);
|
|
15
|
+
const nValues = daph.num_values - numNulls;
|
|
16
|
+
if (daph.encoding === "PLAIN") dataPage = readPlain(reader, type, nValues, element.type_length);
|
|
17
|
+
else if (daph.encoding === "PLAIN_DICTIONARY" || daph.encoding === "RLE_DICTIONARY" || daph.encoding === "RLE") {
|
|
18
|
+
const bitWidth = type === "BOOLEAN" ? 1 : view.getUint8(reader.offset++);
|
|
19
|
+
if (bitWidth) {
|
|
20
|
+
dataPage = new Array(nValues);
|
|
21
|
+
if (type === "BOOLEAN") {
|
|
22
|
+
readRleBitPackedHybrid(reader, bitWidth, dataPage);
|
|
23
|
+
dataPage = dataPage.map((x) => !!x);
|
|
24
|
+
} else readRleBitPackedHybrid(reader, bitWidth, dataPage, view.byteLength - reader.offset);
|
|
25
|
+
} else dataPage = new Uint8Array(nValues);
|
|
26
|
+
} else if (daph.encoding === "BYTE_STREAM_SPLIT") dataPage = byteStreamSplit(reader, nValues, type, element.type_length);
|
|
27
|
+
else if (daph.encoding === "DELTA_BINARY_PACKED") {
|
|
28
|
+
dataPage = type === "INT32" ? new Int32Array(nValues) : new BigInt64Array(nValues);
|
|
29
|
+
deltaBinaryUnpack(reader, nValues, dataPage);
|
|
30
|
+
} else if (daph.encoding === "DELTA_LENGTH_BYTE_ARRAY") {
|
|
31
|
+
dataPage = new Array(nValues);
|
|
32
|
+
deltaLengthByteArray(reader, nValues, dataPage);
|
|
33
|
+
} else throw new Error(`parquet unsupported encoding: ${daph.encoding}`);
|
|
34
|
+
return {
|
|
35
|
+
definitionLevels,
|
|
36
|
+
repetitionLevels,
|
|
37
|
+
dataPage
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function readRepetitionLevels(reader, daph, schemaPath) {
|
|
41
|
+
if (schemaPath.length > 1) {
|
|
42
|
+
const maxRepetitionLevel = getMaxRepetitionLevel(schemaPath);
|
|
43
|
+
if (maxRepetitionLevel) {
|
|
44
|
+
const values = new Array(daph.num_values);
|
|
45
|
+
readRleBitPackedHybrid(reader, bitWidth(maxRepetitionLevel), values);
|
|
46
|
+
return values;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
function readDefinitionLevels(reader, daph, schemaPath) {
|
|
52
|
+
const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath);
|
|
53
|
+
if (!maxDefinitionLevel) return {
|
|
54
|
+
definitionLevels: [],
|
|
55
|
+
numNulls: 0
|
|
56
|
+
};
|
|
57
|
+
const definitionLevels = new Array(daph.num_values);
|
|
58
|
+
readRleBitPackedHybrid(reader, bitWidth(maxDefinitionLevel), definitionLevels);
|
|
59
|
+
let numNulls = daph.num_values;
|
|
60
|
+
for (const def of definitionLevels) if (def === maxDefinitionLevel) numNulls--;
|
|
61
|
+
if (numNulls === 0) definitionLevels.length = 0;
|
|
62
|
+
return {
|
|
63
|
+
definitionLevels,
|
|
64
|
+
numNulls
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function decompressPage(compressedBytes, uncompressed_page_size, codec, compressors) {
|
|
68
|
+
let page;
|
|
69
|
+
const customDecompressor = compressors?.[codec];
|
|
70
|
+
if (codec === "UNCOMPRESSED") page = compressedBytes;
|
|
71
|
+
else if (customDecompressor) page = customDecompressor(compressedBytes, uncompressed_page_size);
|
|
72
|
+
else if (codec === "SNAPPY") {
|
|
73
|
+
page = new Uint8Array(uncompressed_page_size);
|
|
74
|
+
snappyUncompress(compressedBytes, page);
|
|
75
|
+
} else throw new Error(`parquet unsupported compression codec: ${codec}`);
|
|
76
|
+
if (page?.length !== uncompressed_page_size) throw new Error(`parquet decompressed page length ${page?.length} does not match header ${uncompressed_page_size}`);
|
|
77
|
+
return page;
|
|
78
|
+
}
|
|
79
|
+
function readDataPageV2(compressedBytes, ph, columnDecoder) {
|
|
80
|
+
const reader = {
|
|
81
|
+
view: new DataView(compressedBytes.buffer, compressedBytes.byteOffset, compressedBytes.byteLength),
|
|
82
|
+
offset: 0
|
|
83
|
+
};
|
|
84
|
+
const { type, element, schemaPath, codec, compressors } = columnDecoder;
|
|
85
|
+
const daph2 = ph.data_page_header_v2;
|
|
86
|
+
if (!daph2) throw new Error("parquet data page header v2 is undefined");
|
|
87
|
+
const repetitionLevels = readRepetitionLevelsV2(reader, daph2, schemaPath);
|
|
88
|
+
reader.offset = daph2.repetition_levels_byte_length;
|
|
89
|
+
const definitionLevels = readDefinitionLevelsV2(reader, daph2, schemaPath);
|
|
90
|
+
const uncompressedPageSize = ph.uncompressed_page_size - daph2.definition_levels_byte_length - daph2.repetition_levels_byte_length;
|
|
91
|
+
let page = compressedBytes.subarray(reader.offset);
|
|
92
|
+
if (daph2.is_compressed !== false) page = decompressPage(page, uncompressedPageSize, codec, compressors);
|
|
93
|
+
const pageView = new DataView(page.buffer, page.byteOffset, page.byteLength);
|
|
94
|
+
const pageReader = {
|
|
95
|
+
view: pageView,
|
|
96
|
+
offset: 0
|
|
97
|
+
};
|
|
98
|
+
let dataPage;
|
|
99
|
+
const nValues = daph2.num_values - daph2.num_nulls;
|
|
100
|
+
if (daph2.encoding === "PLAIN") dataPage = readPlain(pageReader, type, nValues, element.type_length);
|
|
101
|
+
else if (daph2.encoding === "RLE") {
|
|
102
|
+
dataPage = new Array(nValues);
|
|
103
|
+
readRleBitPackedHybrid(pageReader, 1, dataPage);
|
|
104
|
+
dataPage = dataPage.map((x) => !!x);
|
|
105
|
+
} else if (daph2.encoding === "PLAIN_DICTIONARY" || daph2.encoding === "RLE_DICTIONARY") {
|
|
106
|
+
const bitWidth = pageView.getUint8(pageReader.offset++);
|
|
107
|
+
dataPage = new Array(nValues);
|
|
108
|
+
readRleBitPackedHybrid(pageReader, bitWidth, dataPage, uncompressedPageSize - 1);
|
|
109
|
+
} else if (daph2.encoding === "DELTA_BINARY_PACKED") {
|
|
110
|
+
dataPage = type === "INT32" ? new Int32Array(nValues) : new BigInt64Array(nValues);
|
|
111
|
+
deltaBinaryUnpack(pageReader, nValues, dataPage);
|
|
112
|
+
} else if (daph2.encoding === "DELTA_LENGTH_BYTE_ARRAY") {
|
|
113
|
+
dataPage = new Array(nValues);
|
|
114
|
+
deltaLengthByteArray(pageReader, nValues, dataPage);
|
|
115
|
+
} else if (daph2.encoding === "DELTA_BYTE_ARRAY") {
|
|
116
|
+
dataPage = new Array(nValues);
|
|
117
|
+
deltaByteArray(pageReader, nValues, dataPage);
|
|
118
|
+
} else if (daph2.encoding === "BYTE_STREAM_SPLIT") dataPage = byteStreamSplit(pageReader, nValues, type, element.type_length);
|
|
119
|
+
else throw new Error(`parquet unsupported encoding: ${daph2.encoding}`);
|
|
120
|
+
return {
|
|
121
|
+
definitionLevels,
|
|
122
|
+
repetitionLevels,
|
|
123
|
+
dataPage
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function readRepetitionLevelsV2(reader, daph2, schemaPath) {
|
|
127
|
+
const maxRepetitionLevel = getMaxRepetitionLevel(schemaPath);
|
|
128
|
+
if (!maxRepetitionLevel) return [];
|
|
129
|
+
const values = new Array(daph2.num_values);
|
|
130
|
+
readRleBitPackedHybrid(reader, bitWidth(maxRepetitionLevel), values, daph2.repetition_levels_byte_length);
|
|
131
|
+
return values;
|
|
132
|
+
}
|
|
133
|
+
function readDefinitionLevelsV2(reader, daph2, schemaPath) {
|
|
134
|
+
const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath);
|
|
135
|
+
if (maxDefinitionLevel) {
|
|
136
|
+
const values = new Array(daph2.num_values);
|
|
137
|
+
readRleBitPackedHybrid(reader, bitWidth(maxDefinitionLevel), values, daph2.definition_levels_byte_length);
|
|
138
|
+
return values;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function bitWidth(value) {
|
|
142
|
+
return 32 - Math.clz32(value);
|
|
143
|
+
}
|
|
144
|
+
export { decompressPage, readDataPage, readDataPageV2 };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { readVarInt, readZigZagBigInt } from "./thrift.mjs";
|
|
2
|
+
function deltaBinaryUnpack(reader, count, output) {
|
|
3
|
+
const int32 = output instanceof Int32Array;
|
|
4
|
+
const blockSize = readVarInt(reader);
|
|
5
|
+
const miniblockPerBlock = readVarInt(reader);
|
|
6
|
+
readVarInt(reader);
|
|
7
|
+
let value = readZigZagBigInt(reader);
|
|
8
|
+
let outputIndex = 0;
|
|
9
|
+
output[outputIndex++] = int32 ? Number(value) : value;
|
|
10
|
+
const valuesPerMiniblock = blockSize / miniblockPerBlock;
|
|
11
|
+
while (outputIndex < count) {
|
|
12
|
+
const minDelta = readZigZagBigInt(reader);
|
|
13
|
+
const bitWidths = new Uint8Array(miniblockPerBlock);
|
|
14
|
+
for (let i = 0; i < miniblockPerBlock; i++) bitWidths[i] = reader.view.getUint8(reader.offset++);
|
|
15
|
+
for (let i = 0; i < miniblockPerBlock && outputIndex < count; i++) {
|
|
16
|
+
const bitWidth = BigInt(bitWidths[i]);
|
|
17
|
+
if (bitWidth) {
|
|
18
|
+
let bitpackPos = 0n;
|
|
19
|
+
let miniblockCount = valuesPerMiniblock;
|
|
20
|
+
const mask = (1n << bitWidth) - 1n;
|
|
21
|
+
while (miniblockCount && outputIndex < count) {
|
|
22
|
+
let bits = BigInt(reader.view.getUint8(reader.offset)) >> bitpackPos & mask;
|
|
23
|
+
bitpackPos += bitWidth;
|
|
24
|
+
while (bitpackPos >= 8) {
|
|
25
|
+
bitpackPos -= 8n;
|
|
26
|
+
reader.offset++;
|
|
27
|
+
if (bitpackPos) bits |= BigInt(reader.view.getUint8(reader.offset)) << bitWidth - bitpackPos & mask;
|
|
28
|
+
}
|
|
29
|
+
const delta = minDelta + bits;
|
|
30
|
+
value += delta;
|
|
31
|
+
output[outputIndex++] = int32 ? Number(value) : value;
|
|
32
|
+
miniblockCount--;
|
|
33
|
+
}
|
|
34
|
+
if (miniblockCount) reader.offset += Math.ceil((miniblockCount * Number(bitWidth) + Number(bitpackPos)) / 8);
|
|
35
|
+
} else for (let j = 0; j < valuesPerMiniblock && outputIndex < count; j++) {
|
|
36
|
+
value += minDelta;
|
|
37
|
+
output[outputIndex++] = int32 ? Number(value) : value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function deltaLengthByteArray(reader, count, output) {
|
|
43
|
+
const lengths = new Int32Array(count);
|
|
44
|
+
deltaBinaryUnpack(reader, count, lengths);
|
|
45
|
+
for (let i = 0; i < count; i++) {
|
|
46
|
+
output[i] = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, lengths[i]);
|
|
47
|
+
reader.offset += lengths[i];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function deltaByteArray(reader, count, output) {
|
|
51
|
+
const prefixData = new Int32Array(count);
|
|
52
|
+
deltaBinaryUnpack(reader, count, prefixData);
|
|
53
|
+
const suffixData = new Int32Array(count);
|
|
54
|
+
deltaBinaryUnpack(reader, count, suffixData);
|
|
55
|
+
for (let i = 0; i < count; i++) {
|
|
56
|
+
const suffix = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, suffixData[i]);
|
|
57
|
+
if (prefixData[i]) {
|
|
58
|
+
output[i] = new Uint8Array(prefixData[i] + suffixData[i]);
|
|
59
|
+
output[i].set(output[i - 1].subarray(0, prefixData[i]));
|
|
60
|
+
output[i].set(suffix, prefixData[i]);
|
|
61
|
+
} else output[i] = suffix;
|
|
62
|
+
reader.offset += suffixData[i];
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export { deltaBinaryUnpack, deltaByteArray, deltaLengthByteArray };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { readVarInt } from "./thrift.mjs";
|
|
2
|
+
function readRleBitPackedHybrid(reader, width, output, length) {
|
|
3
|
+
if (length === void 0) {
|
|
4
|
+
length = reader.view.getUint32(reader.offset, true);
|
|
5
|
+
reader.offset += 4;
|
|
6
|
+
}
|
|
7
|
+
const startOffset = reader.offset;
|
|
8
|
+
let seen = 0;
|
|
9
|
+
while (seen < output.length) {
|
|
10
|
+
const header = readVarInt(reader);
|
|
11
|
+
if (header & 1) seen = readBitPacked(reader, header, width, output, seen);
|
|
12
|
+
else {
|
|
13
|
+
const count = header >>> 1;
|
|
14
|
+
readRle(reader, count, width, output, seen);
|
|
15
|
+
seen += count;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
reader.offset = startOffset + length;
|
|
19
|
+
}
|
|
20
|
+
function readRle(reader, count, bitWidth, output, seen) {
|
|
21
|
+
const width = bitWidth + 7 >> 3;
|
|
22
|
+
let value = 0;
|
|
23
|
+
for (let i = 0; i < width; i++) value |= reader.view.getUint8(reader.offset++) << (i << 3);
|
|
24
|
+
for (let i = 0; i < count; i++) output[seen + i] = value;
|
|
25
|
+
}
|
|
26
|
+
function readBitPacked(reader, header, bitWidth, output, seen) {
|
|
27
|
+
let count = header >> 1 << 3;
|
|
28
|
+
const mask = (1 << bitWidth) - 1;
|
|
29
|
+
let data = 0;
|
|
30
|
+
if (reader.offset < reader.view.byteLength) data = reader.view.getUint8(reader.offset++);
|
|
31
|
+
else if (mask) throw new Error(`parquet bitpack offset ${reader.offset} out of range`);
|
|
32
|
+
let left = 8;
|
|
33
|
+
let right = 0;
|
|
34
|
+
while (count) if (right > 8) {
|
|
35
|
+
right -= 8;
|
|
36
|
+
left -= 8;
|
|
37
|
+
data >>>= 8;
|
|
38
|
+
} else if (left - right < bitWidth) {
|
|
39
|
+
data |= reader.view.getUint8(reader.offset) << left;
|
|
40
|
+
reader.offset++;
|
|
41
|
+
left += 8;
|
|
42
|
+
} else {
|
|
43
|
+
if (seen < output.length) output[seen++] = data >> right & mask;
|
|
44
|
+
count--;
|
|
45
|
+
right += bitWidth;
|
|
46
|
+
}
|
|
47
|
+
return seen;
|
|
48
|
+
}
|
|
49
|
+
function byteStreamSplit(reader, count, type, typeLength) {
|
|
50
|
+
const width = byteWidth(type, typeLength);
|
|
51
|
+
const bytes = new Uint8Array(count * width);
|
|
52
|
+
for (let b = 0; b < width; b++) for (let i = 0; i < count; i++) bytes[i * width + b] = reader.view.getUint8(reader.offset++);
|
|
53
|
+
if (type === "FLOAT") return new Float32Array(bytes.buffer);
|
|
54
|
+
else if (type === "DOUBLE") return new Float64Array(bytes.buffer);
|
|
55
|
+
else if (type === "INT32") return new Int32Array(bytes.buffer);
|
|
56
|
+
else if (type === "INT64") return new BigInt64Array(bytes.buffer);
|
|
57
|
+
else if (type === "FIXED_LEN_BYTE_ARRAY") {
|
|
58
|
+
const split = new Array(count);
|
|
59
|
+
for (let i = 0; i < count; i++) split[i] = bytes.subarray(i * width, (i + 1) * width);
|
|
60
|
+
return split;
|
|
61
|
+
}
|
|
62
|
+
throw new Error(`parquet byte_stream_split unsupported type: ${type}`);
|
|
63
|
+
}
|
|
64
|
+
function byteWidth(type, typeLength) {
|
|
65
|
+
switch (type) {
|
|
66
|
+
case "INT32":
|
|
67
|
+
case "FLOAT": return 4;
|
|
68
|
+
case "INT64":
|
|
69
|
+
case "DOUBLE": return 8;
|
|
70
|
+
case "FIXED_LEN_BYTE_ARRAY":
|
|
71
|
+
if (!typeLength) throw new Error("parquet byteWidth missing type_length");
|
|
72
|
+
return typeLength;
|
|
73
|
+
default: throw new Error(`parquet unsupported type: ${type}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export { byteStreamSplit, readRleBitPackedHybrid };
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { hashParquetValue, sbbfContains } from "./bloom.mjs";
|
|
2
|
+
import { equals } from "./utils.mjs";
|
|
3
|
+
const encoder = new TextEncoder();
|
|
4
|
+
function pathsNeededForFilter(filter) {
|
|
5
|
+
if (!filter) return [];
|
|
6
|
+
const paths = [];
|
|
7
|
+
if ("$and" in filter && Array.isArray(filter.$and)) paths.push(...filter.$and.flatMap(pathsNeededForFilter));
|
|
8
|
+
else if ("$or" in filter && Array.isArray(filter.$or)) paths.push(...filter.$or.flatMap(pathsNeededForFilter));
|
|
9
|
+
else if ("$nor" in filter && Array.isArray(filter.$nor)) paths.push(...filter.$nor.flatMap(pathsNeededForFilter));
|
|
10
|
+
else paths.push(...Object.keys(filter));
|
|
11
|
+
return [...new Set(paths)];
|
|
12
|
+
}
|
|
13
|
+
function columnsNeededForFilter(filter) {
|
|
14
|
+
return [...new Set(pathsNeededForFilter(filter).map((path) => path.split(".")[0]))];
|
|
15
|
+
}
|
|
16
|
+
function matchFilter(record, filter, strict = true) {
|
|
17
|
+
if ("$and" in filter && Array.isArray(filter.$and)) return filter.$and.every((subQuery) => matchFilter(record, subQuery, strict));
|
|
18
|
+
if ("$or" in filter && Array.isArray(filter.$or)) return filter.$or.some((subQuery) => matchFilter(record, subQuery, strict));
|
|
19
|
+
if ("$nor" in filter && Array.isArray(filter.$nor)) return !filter.$nor.some((subQuery) => matchFilter(record, subQuery, strict));
|
|
20
|
+
return Object.entries(filter).every(([field, condition]) => {
|
|
21
|
+
const value = resolve(record, field);
|
|
22
|
+
if (typeof condition !== "object" || condition === null || Array.isArray(condition)) return equals(value, condition, strict);
|
|
23
|
+
return Object.entries(condition || {}).every(([operator, target]) => {
|
|
24
|
+
if (operator === "$gt") return value !== null && value !== void 0 && value > target;
|
|
25
|
+
if (operator === "$gte") return value !== null && value !== void 0 && value >= target;
|
|
26
|
+
if (operator === "$lt") return value !== null && value !== void 0 && value < target;
|
|
27
|
+
if (operator === "$lte") return value !== null && value !== void 0 && value <= target;
|
|
28
|
+
if (operator === "$eq") return equals(value, target, strict);
|
|
29
|
+
if (operator === "$ne") return !equals(value, target, strict);
|
|
30
|
+
if (operator === "$in") return Array.isArray(target) && matchesIn(value, target, strict);
|
|
31
|
+
if (operator === "$nin") return Array.isArray(target) && !matchesIn(value, target, strict);
|
|
32
|
+
if (operator === "$not") return !matchFilter({ [field]: value }, { [field]: target }, strict);
|
|
33
|
+
return true;
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function matchesIn(value, targets, strict) {
|
|
38
|
+
return targets.some((target) => equals(value, target, strict) || Array.isArray(value) && value.some((element) => equals(element, target, strict)));
|
|
39
|
+
}
|
|
40
|
+
function canSkipRowGroup({ rowGroup, physicalColumns, filter, strict = true, bloomFilters, schemaElements }) {
|
|
41
|
+
if (!filter) return false;
|
|
42
|
+
if ("$and" in filter && Array.isArray(filter.$and)) return filter.$and.some((subFilter) => canSkipRowGroup({
|
|
43
|
+
rowGroup,
|
|
44
|
+
physicalColumns,
|
|
45
|
+
filter: subFilter,
|
|
46
|
+
strict,
|
|
47
|
+
bloomFilters,
|
|
48
|
+
schemaElements
|
|
49
|
+
}));
|
|
50
|
+
if ("$or" in filter && Array.isArray(filter.$or)) return filter.$or.every((subFilter) => canSkipRowGroup({
|
|
51
|
+
rowGroup,
|
|
52
|
+
physicalColumns,
|
|
53
|
+
filter: subFilter,
|
|
54
|
+
strict,
|
|
55
|
+
bloomFilters,
|
|
56
|
+
schemaElements
|
|
57
|
+
}));
|
|
58
|
+
if ("$nor" in filter && Array.isArray(filter.$nor)) return false;
|
|
59
|
+
for (const [field, condition] of Object.entries(filter)) {
|
|
60
|
+
const columnIndex = physicalColumns.indexOf(field);
|
|
61
|
+
if (columnIndex === -1) continue;
|
|
62
|
+
const { min, max, min_value, max_value, null_count: nullCount } = rowGroup.columns[columnIndex].meta_data?.statistics || {};
|
|
63
|
+
const minVal = min_value !== void 0 ? min_value : min;
|
|
64
|
+
const maxVal = max_value !== void 0 ? max_value : max;
|
|
65
|
+
const haveStats = minVal !== void 0 && maxVal !== void 0;
|
|
66
|
+
const bloom = bloomFilters?.[field];
|
|
67
|
+
const element = schemaElements?.[field];
|
|
68
|
+
const matchingNulls = matchFilter({ value: null }, { value: condition }, strict) && (nullCount === void 0 || nullCount > 0);
|
|
69
|
+
if (haveStats && !matchingNulls && canSkipStats(condition, minVal, maxVal, strict, element)) return true;
|
|
70
|
+
for (const [operator, target] of Object.entries(condition || {})) if (bloom && element) {
|
|
71
|
+
if (operator === "$eq") {
|
|
72
|
+
const hash = hashParquetValue(target, element);
|
|
73
|
+
if (hash !== void 0 && !sbbfContains(bloom.blocks, hash)) return true;
|
|
74
|
+
}
|
|
75
|
+
if (operator === "$in" && Array.isArray(target) && target.length > 0) {
|
|
76
|
+
let allAbsent = true;
|
|
77
|
+
for (const v of target) {
|
|
78
|
+
const h = hashParquetValue(v, element);
|
|
79
|
+
if (h === void 0 || sbbfContains(bloom.blocks, h)) {
|
|
80
|
+
allAbsent = false;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (allAbsent) return true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
function canSkipStats(condition, minVal, maxVal, strict, element) {
|
|
91
|
+
if (minVal === void 0 || maxVal === void 0) return false;
|
|
92
|
+
const mayContainNaN = element?.type === "FLOAT" || element?.type === "DOUBLE" || element?.logical_type?.type === "FLOAT16";
|
|
93
|
+
for (const [operator, target] of Object.entries(condition || {})) {
|
|
94
|
+
const minComparison = compareParquetValues(minVal, target, strict, element);
|
|
95
|
+
const maxComparison = compareParquetValues(maxVal, target, strict, element);
|
|
96
|
+
const relationalBoundsAreSafe = !(minVal instanceof Uint8Array || maxVal instanceof Uint8Array) && (element?.type !== "BYTE_ARRAY" || typeof target === "string" && [...target].every((character) => character.charCodeAt(0) <= 127));
|
|
97
|
+
if (operator === "$gt" && relationalBoundsAreSafe && maxComparison !== void 0 && maxComparison <= 0) return true;
|
|
98
|
+
if (operator === "$gte" && relationalBoundsAreSafe && maxComparison !== void 0 && maxComparison < 0) return true;
|
|
99
|
+
if (operator === "$lt" && relationalBoundsAreSafe && minComparison !== void 0 && minComparison >= 0) return true;
|
|
100
|
+
if (operator === "$lte" && relationalBoundsAreSafe && minComparison !== void 0 && minComparison > 0) return true;
|
|
101
|
+
if (operator === "$eq") {
|
|
102
|
+
const targetMinComparison = compareParquetValues(target, minVal, strict, element);
|
|
103
|
+
const targetMaxComparison = compareParquetValues(target, maxVal, strict, element);
|
|
104
|
+
if (targetMinComparison !== void 0 && targetMinComparison < 0 || targetMaxComparison !== void 0 && targetMaxComparison > 0) return true;
|
|
105
|
+
}
|
|
106
|
+
if (operator === "$ne" && !mayContainNaN && equals(minVal, maxVal, strict) && equals(minVal, target, strict)) return true;
|
|
107
|
+
if (operator === "$in" && Array.isArray(target) && target.every((value) => {
|
|
108
|
+
const valueMinComparison = compareParquetValues(value, minVal, strict, element);
|
|
109
|
+
const valueMaxComparison = compareParquetValues(value, maxVal, strict, element);
|
|
110
|
+
return valueMinComparison !== void 0 && valueMinComparison < 0 || valueMaxComparison !== void 0 && valueMaxComparison > 0;
|
|
111
|
+
})) return true;
|
|
112
|
+
if (operator === "$nin" && !mayContainNaN && Array.isArray(target) && equals(minVal, maxVal, strict) && target.some((value) => equals(minVal, value, strict))) return true;
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
function compareParquetValues(a, b, strict, element) {
|
|
117
|
+
if (element?.type === "BYTE_ARRAY") {
|
|
118
|
+
if (typeof a !== "string" || typeof b !== "string") return void 0;
|
|
119
|
+
return compareBytes(encoder.encode(a), encoder.encode(b));
|
|
120
|
+
}
|
|
121
|
+
if (a instanceof Uint8Array || b instanceof Uint8Array) {
|
|
122
|
+
if (!(a instanceof Uint8Array) || !(b instanceof Uint8Array)) return void 0;
|
|
123
|
+
return compareBytes(a, b);
|
|
124
|
+
}
|
|
125
|
+
if (a < b) return -1;
|
|
126
|
+
if (a > b) return 1;
|
|
127
|
+
if (equals(a, b, strict)) return 0;
|
|
128
|
+
}
|
|
129
|
+
function compareBytes(a, b) {
|
|
130
|
+
const length = Math.min(a.length, b.length);
|
|
131
|
+
for (let i = 0; i < length; i++) {
|
|
132
|
+
if (a[i] < b[i]) return -1;
|
|
133
|
+
if (a[i] > b[i]) return 1;
|
|
134
|
+
}
|
|
135
|
+
if (a.length < b.length) return -1;
|
|
136
|
+
if (a.length > b.length) return 1;
|
|
137
|
+
return 0;
|
|
138
|
+
}
|
|
139
|
+
function matchesNull(condition, strict) {
|
|
140
|
+
return matchFilter({ value: null }, { value: condition }, strict);
|
|
141
|
+
}
|
|
142
|
+
function filterPageRanges(filter, columnPages, groupRows, strict = true) {
|
|
143
|
+
if (!filter) return void 0;
|
|
144
|
+
if ("$and" in filter && Array.isArray(filter.$and)) {
|
|
145
|
+
let ranges;
|
|
146
|
+
for (const subFilter of filter.$and) ranges = intersectRanges(ranges, filterPageRanges(subFilter, columnPages, groupRows, strict));
|
|
147
|
+
return ranges;
|
|
148
|
+
}
|
|
149
|
+
if ("$or" in filter && Array.isArray(filter.$or)) {
|
|
150
|
+
let ranges = [];
|
|
151
|
+
for (const subFilter of filter.$or) {
|
|
152
|
+
const subRanges = filterPageRanges(subFilter, columnPages, groupRows, strict);
|
|
153
|
+
if (!subRanges) return void 0;
|
|
154
|
+
ranges = unionRanges(ranges, subRanges);
|
|
155
|
+
}
|
|
156
|
+
return ranges;
|
|
157
|
+
}
|
|
158
|
+
if ("$nor" in filter && Array.isArray(filter.$nor)) return;
|
|
159
|
+
let result;
|
|
160
|
+
for (const [field, condition] of Object.entries(filter)) {
|
|
161
|
+
const pages = columnPages[field];
|
|
162
|
+
if (!pages) continue;
|
|
163
|
+
const nullCanMatch = matchesNull(condition, strict);
|
|
164
|
+
const keep = [];
|
|
165
|
+
for (let i = 0; i < pages.pageStarts.length; i++) {
|
|
166
|
+
const start = pages.pageStarts[i];
|
|
167
|
+
const end = i + 1 < pages.pageStarts.length ? pages.pageStarts[i + 1] : groupRows;
|
|
168
|
+
const nullCount = pages.nullCounts?.[i];
|
|
169
|
+
const matchingNulls = nullCanMatch && (nullCount === void 0 || nullCount > 0);
|
|
170
|
+
if (!(!pages.nullPages[i] && !matchingNulls && canSkipStats(condition, pages.minValues[i], pages.maxValues[i], strict, pages.element))) {
|
|
171
|
+
const last = keep[keep.length - 1];
|
|
172
|
+
if (last && last[1] === start) last[1] = end;
|
|
173
|
+
else keep.push([start, end]);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
result = intersectRanges(result, keep);
|
|
177
|
+
}
|
|
178
|
+
return result;
|
|
179
|
+
}
|
|
180
|
+
function intersectRanges(a, b) {
|
|
181
|
+
if (!a) return b;
|
|
182
|
+
if (!b) return a;
|
|
183
|
+
const out = [];
|
|
184
|
+
let i = 0;
|
|
185
|
+
let j = 0;
|
|
186
|
+
while (i < a.length && j < b.length) {
|
|
187
|
+
const start = Math.max(a[i][0], b[j][0]);
|
|
188
|
+
const end = Math.min(a[i][1], b[j][1]);
|
|
189
|
+
if (start < end) out.push([start, end]);
|
|
190
|
+
if (a[i][1] < b[j][1]) i++;
|
|
191
|
+
else j++;
|
|
192
|
+
}
|
|
193
|
+
return out;
|
|
194
|
+
}
|
|
195
|
+
function unionRanges(a, b) {
|
|
196
|
+
const out = [];
|
|
197
|
+
let i = 0;
|
|
198
|
+
let j = 0;
|
|
199
|
+
while (i < a.length || j < b.length) {
|
|
200
|
+
const next = j >= b.length || i < a.length && a[i][0] <= b[j][0] ? a[i++] : b[j++];
|
|
201
|
+
const last = out[out.length - 1];
|
|
202
|
+
if (last && next[0] <= last[1]) last[1] = Math.max(last[1], next[1]);
|
|
203
|
+
else out.push([next[0], next[1]]);
|
|
204
|
+
}
|
|
205
|
+
return out;
|
|
206
|
+
}
|
|
207
|
+
function resolve(record, path) {
|
|
208
|
+
let value = record;
|
|
209
|
+
for (const part of path.split(".")) value = value?.[part];
|
|
210
|
+
return value;
|
|
211
|
+
}
|
|
212
|
+
export { canSkipRowGroup, columnsNeededForFilter, filterPageRanges, intersectRanges, matchFilter, pathsNeededForFilter, unionRanges };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function markGeoColumns(schema, key_value_metadata) {
|
|
2
|
+
const columns = /* @__PURE__ */ new Map();
|
|
3
|
+
const geo = key_value_metadata?.find(({ key }) => key === "geo")?.value;
|
|
4
|
+
const decodedColumns = (geo && JSON.parse(geo)?.columns) ?? {};
|
|
5
|
+
for (const [name, column] of Object.entries(decodedColumns)) {
|
|
6
|
+
if (column.encoding !== "WKB") continue;
|
|
7
|
+
const type = column.edges === "spherical" ? "GEOGRAPHY" : "GEOMETRY";
|
|
8
|
+
const id = column.crs?.id ?? column.crs?.ids?.[0];
|
|
9
|
+
const crs = id ? `${id.authority}:${id.code.toString()}` : void 0;
|
|
10
|
+
columns.set(name, {
|
|
11
|
+
type,
|
|
12
|
+
crs
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
for (let i = 1; i < schema.length; i++) {
|
|
16
|
+
const { logical_type, name, num_children, type } = schema[i];
|
|
17
|
+
if (num_children) {
|
|
18
|
+
i += num_children;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (type === "BYTE_ARRAY" && !logical_type) schema[i].logical_type = columns.get(name);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export { markGeoColumns };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { parquetMetadataAsync, parquetSchema } from "./metadata.mjs";
|
|
2
|
+
import "./indexes.mjs";
|
|
3
|
+
import "./utils.mjs";
|
|
4
|
+
import "./snappy.mjs";
|
|
5
|
+
import "./scan.mjs";
|
|
6
|
+
import { parquetReadObjects } from "./read.mjs";
|
|
7
|
+
import "./query.mjs";
|
|
8
|
+
export { parquetMetadataAsync, parquetReadObjects, parquetSchema };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { BoundaryOrders } from "./constants.mjs";
|
|
2
|
+
import { DEFAULT_PARSERS } from "./convert.mjs";
|
|
3
|
+
import { deserializeTCompactProtocol } from "./thrift.mjs";
|
|
4
|
+
import { convertMetadata } from "./metadata.mjs";
|
|
5
|
+
function readColumnIndex(reader, schema, parsers = void 0) {
|
|
6
|
+
parsers = {
|
|
7
|
+
...DEFAULT_PARSERS,
|
|
8
|
+
...parsers
|
|
9
|
+
};
|
|
10
|
+
const thrift = deserializeTCompactProtocol(reader);
|
|
11
|
+
return {
|
|
12
|
+
null_pages: thrift.field_1,
|
|
13
|
+
min_values: thrift.field_2.map((m) => convertMetadata(m, schema, parsers)),
|
|
14
|
+
max_values: thrift.field_3.map((m) => convertMetadata(m, schema, parsers)),
|
|
15
|
+
boundary_order: BoundaryOrders[thrift.field_4],
|
|
16
|
+
null_counts: thrift.field_5,
|
|
17
|
+
repetition_level_histograms: thrift.field_6,
|
|
18
|
+
definition_level_histograms: thrift.field_7
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function readOffsetIndex(reader) {
|
|
22
|
+
const thrift = deserializeTCompactProtocol(reader);
|
|
23
|
+
return {
|
|
24
|
+
page_locations: thrift.field_1.map((loc) => ({
|
|
25
|
+
offset: loc.field_1,
|
|
26
|
+
compressed_page_size: loc.field_2,
|
|
27
|
+
first_row_index: loc.field_3
|
|
28
|
+
})),
|
|
29
|
+
unencoded_byte_array_data_bytes: thrift.field_2
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export { readColumnIndex, readOffsetIndex };
|