@gscdump/lakehouse 3.2.0 → 3.4.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/LICENSE +21 -0
- package/dist/THIRD-PARTY-LICENSES.md +2 -2
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/index.mjs +2 -1
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/node.mjs +2 -1
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/plan.mjs +115 -87
- package/dist/_virtual/node_modules/.pnpm/hyparquet@1.29.1/node_modules/hyparquet/src/read.mjs +78 -0
- package/dist/_virtual/node_modules/.pnpm/hyparquet@1.29.1/node_modules/hyparquet/src/scan.mjs +203 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/index.d.mts +1 -0
- package/dist/_virtual/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/snappy.mjs +68 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/avro/avro.read.mjs +1 -1
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/fetch.mjs +14 -6
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/index.mjs +1 -1
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/manifest.mjs +1 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/metadata.mjs +1 -9
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/read.mjs +45 -110
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/sql/icebergDataSource.mjs +1 -1
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/sql/icebergQuery.mjs +1 -1
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/types.d.mts +2 -2
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/manifest.mjs +45 -1
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/src/write/rewrite.mjs +296 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/stage.mjs +14 -8
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/write.mjs +2 -1
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/fetch.d.mts +1 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/index.d.mts +1 -1
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/types/metadata.d.mts +1 -0
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/types/read.d.mts +3 -0
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/types/sql/icebergDataSource.d.mts +2 -0
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/types/sql/icebergQuery.d.mts +2 -0
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/backend/batchAdapters.mjs +3 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/aggregates.mjs +2 -1
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/execute/batchResults.mjs +3 -0
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/execute/batches.mjs +4 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/execute.mjs +7 -1
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/execute/rowScope.mjs +2 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/streamingAggregate.mjs +4 -1
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/execute/utils.mjs +2 -0
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/expression/batch.mjs +10 -0
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/expression/binary.mjs +2 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/evaluate.mjs +4 -3
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.16.2/node_modules/squirreling/src/expression/scalar.mjs +4 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/index.mjs +2 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/plan/columns.mjs +1 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/tables.mjs +1 -0
- package/dist/_virtual/node_modules/.pnpm/unstorage@1.17.5_aws4fetch@1.0.20_db0@0.3.4_ioredis@5.10.1_supports-color@10.2.2_/node_modules/unstorage/drivers/db0.d.mts +1 -1
- package/dist/catalog.d.mts +3 -3
- package/dist/catalog.mjs +5 -5
- package/dist/dataset-runtime.mjs +1 -1
- package/dist/orphan-sweep.mjs +3 -3
- package/dist/unsafe-raw.d.mts +5 -5
- package/dist/unsafe-raw.mjs +5 -5
- package/dist/vendor/hysnappy-purejs.mjs +1 -1
- package/package.json +5 -5
- package/dist/_virtual/node_modules/.pnpm/hyparquet@1.28.2/node_modules/hyparquet/src/read.mjs +0 -128
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/src/write/rewrite.mjs +0 -174
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/types/read.d.mts +0 -2
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/types/sql/icebergDataSource.d.mts +0 -2
- package/dist/_virtual/node_modules/.pnpm/icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/types/sql/icebergQuery.d.mts +0 -2
- package/dist/_virtual/node_modules/.pnpm/squirreling@0.15.3/node_modules/squirreling/src/expression/binary.mjs +0 -1
- package/dist/_virtual/node_modules/.pnpm/{db0@0.3.4_drizzle-orm@1.0.0-rc.4_@cloudflare+workers-types@5.20260816.1_valibot@1.4.2_typescript@6.0.3__zod@4.4.3_ → db0@0.3.4_drizzle-orm@1.0.0-rc.4_@cloudflare+workers-types@5.20260827.1_valibot@1.4.2_typescript@6.0.3__zod@4.4.3_}/node_modules/db0/dist/index.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/assemble.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/bloom.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/column.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/constants.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/convert.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/datapage.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/delta.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/encoding.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/filter.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/geoparquet.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/indexes.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/metadata.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/plain.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/query.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/rowgroup.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/schema.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/snappy.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/thrift.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/types.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/utils.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/variant.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/wkb.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/src/xxhash.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/indexes.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/metadata.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/node.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/query.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/read.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2/node_modules/hyparquet/types/utils.d.mts → hyparquet@1.29.1/node_modules/hyparquet/types/scan.d.mts} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{hyparquet@1.28.2 → hyparquet@1.29.1}/node_modules/hyparquet/types/snappy.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/types/create.d.mts → hyparquet@1.29.1/node_modules/hyparquet/types/utils.d.mts} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/avro/avro.metadata.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/avro/avro.write.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/catalog/file.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/catalog/loadTable.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/catalog/rest.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/create.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/delete.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/json.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/prune.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/puffin/deletion-vector.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/puffin/puffin.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/puffin/roaring.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/s3.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/schema.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/sigv4.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/sql/whereFilter.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/utils.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/commit.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/conversions.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/delete-file.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/geospatial.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/manifest-list.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/parquet.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/partition.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/serde.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/snapshot.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/sort.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/stage-deletion-vector.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/stage-position-delete.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/stats.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/src/write/transform.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/catalog/file.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/catalog/rest.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6/node_modules/icebird/types/metadata.d.mts → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244/node_modules/icebird/types/create.d.mts} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/manifest.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/s3.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{icebird@0.8.22_patch_hash=4fa7fd5702c4ce432fb2902c6abe07cc55565e87f6375b96ece63a10999712e6 → icebird@0.8.26_patch_hash=75eacba5b0363ee2a40baa0ef77c7fb20d06389025186ca95b514a927cad0244}/node_modules/icebird/types/write/write.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/ast.d.mts +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3/node_modules/squirreling/src/backend/dataSource.mjs → squirreling@0.16.2/node_modules/squirreling/src/backend/batch.mjs} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3/node_modules/squirreling/src/execute/scanColumn.mjs → squirreling@0.16.2/node_modules/squirreling/src/backend/dataSource.mjs} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/accumulator.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/join.mjs +1 -1
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3/node_modules/squirreling/src/execute/utils.mjs → squirreling@0.16.2/node_modules/squirreling/src/execute/scanColumn.mjs} +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/sort.mjs +0 -0
- package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/window.mjs +1 -1
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/execute/yield.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/alias.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/date.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/math.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/regexp.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/expression/strings.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/index.d.mts +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/expression.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/extractTables.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/functions.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/joins.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/parse.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/primary.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/state.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/tokenize.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/parse/types.d.mts +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/plan/plan.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/plan/types.d.mts +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/bbox.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/equality.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/operations.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/pointRelations.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/primitives.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/segments.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/spatial.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/spatial/wkt.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/types.d.mts +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/aggregates.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/executionErrors.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/functions.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/keywords.mjs +0 -0
- /package/dist/_virtual/node_modules/.pnpm/{squirreling@0.15.3 → squirreling@0.16.2}/node_modules/squirreling/src/validation/parseErrors.mjs +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Harlan Wilton
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -304,11 +304,11 @@ Repository: https://github.com/101arrowz/fzstd
|
|
|
304
304
|
|
|
305
305
|
---------------------------------------
|
|
306
306
|
|
|
307
|
-
## hyparquet, hyparquet, hyparquet-compressors, hyparquet-writer, icebird, squirreling
|
|
307
|
+
## hyparquet, hyparquet, hyparquet, hyparquet-compressors, hyparquet-writer, icebird, squirreling
|
|
308
308
|
|
|
309
309
|
License: MIT
|
|
310
310
|
By: Hyperparam
|
|
311
|
-
Repositories: https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet-compressors, https://github.com/hyparam/hyparquet-writer, https://github.com/hyparam/icebird, https://github.com/hyparam/squirreling
|
|
311
|
+
Repositories: https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet, https://github.com/hyparam/hyparquet-compressors, https://github.com/hyparam/hyparquet-writer, https://github.com/hyparam/icebird, https://github.com/hyparam/squirreling
|
|
312
312
|
|
|
313
313
|
> The MIT License (MIT)
|
|
314
314
|
>
|
|
@@ -2,6 +2,7 @@ import { parquetMetadataAsync } from "./metadata.mjs";
|
|
|
2
2
|
import "./indexes.mjs";
|
|
3
3
|
import { asyncBufferFromUrl, cachedAsyncBuffer } from "./utils.mjs";
|
|
4
4
|
import "./snappy.mjs";
|
|
5
|
+
import { parquetScan } from "./scan.mjs";
|
|
5
6
|
import { parquetReadObjects } from "./read.mjs";
|
|
6
7
|
import "./query.mjs";
|
|
7
|
-
export { asyncBufferFromUrl, cachedAsyncBuffer, parquetMetadataAsync, parquetReadObjects };
|
|
8
|
+
export { asyncBufferFromUrl, cachedAsyncBuffer, parquetMetadataAsync, parquetReadObjects, parquetScan };
|
|
@@ -2,6 +2,7 @@ import { parquetMetadataAsync } from "./metadata.mjs";
|
|
|
2
2
|
import "./indexes.mjs";
|
|
3
3
|
import { asyncBufferFromUrl, cachedAsyncBuffer } from "./utils.mjs";
|
|
4
4
|
import "./snappy.mjs";
|
|
5
|
+
import { parquetScan } from "./scan.mjs";
|
|
5
6
|
import { parquetReadObjects } from "./read.mjs";
|
|
6
7
|
import "./index.mjs";
|
|
7
|
-
export { asyncBufferFromUrl, cachedAsyncBuffer, parquetMetadataAsync, parquetReadObjects };
|
|
8
|
+
export { asyncBufferFromUrl, cachedAsyncBuffer, parquetMetadataAsync, parquetReadObjects, parquetScan };
|
|
@@ -4,123 +4,151 @@ import { readColumnIndex, readOffsetIndex } from "./indexes.mjs";
|
|
|
4
4
|
import { bloomEligibleColumns, readBloomFilter } from "./bloom.mjs";
|
|
5
5
|
import { canSkipRowGroup, filterPageRanges, pathsNeededForFilter } from "./filter.mjs";
|
|
6
6
|
const runLimit = 1 << 21;
|
|
7
|
-
function parquetPlan(
|
|
7
|
+
function parquetPlan(options) {
|
|
8
|
+
const { metadata, rowStart = 0, columns, useOffsetIndex = false } = options;
|
|
8
9
|
if (!metadata) throw new Error("parquetPlan requires metadata");
|
|
9
10
|
const groups = [];
|
|
10
11
|
const fetches = [];
|
|
11
12
|
const indexes = [];
|
|
13
|
+
const scanPlan = parquetPlanGroups(options);
|
|
14
|
+
for (const group of scanPlan.groups) {
|
|
15
|
+
const groupPlan = parquetPlanGroup({
|
|
16
|
+
...group,
|
|
17
|
+
columns,
|
|
18
|
+
useOffsetIndex
|
|
19
|
+
});
|
|
20
|
+
groups.push(...groupPlan.groups);
|
|
21
|
+
fetches.push(...groupPlan.fetches);
|
|
22
|
+
indexes.push(...groupPlan.indexes);
|
|
23
|
+
}
|
|
24
|
+
fetches.push(...indexes);
|
|
25
|
+
return {
|
|
26
|
+
metadata,
|
|
27
|
+
rowStart,
|
|
28
|
+
rowEnd: scanPlan.rowEnd,
|
|
29
|
+
columns,
|
|
30
|
+
fetches,
|
|
31
|
+
groups
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function parquetPlanGroups({ metadata, rowStart = 0, rowEnd = Infinity, columns, filter, filterStrict = true, bloomFiltersByGroup, schemaElements, pageRangesByGroup, pageLocationsByGroup }) {
|
|
35
|
+
if (!metadata) throw new Error("parquetPlan requires metadata");
|
|
12
36
|
const schemaTree = parquetSchema(metadata);
|
|
13
37
|
const physicalColumns = getPhysicalColumns(schemaTree);
|
|
14
38
|
const elementsByPath = filter ? {
|
|
15
39
|
...physicalSchemaElements(schemaTree),
|
|
16
40
|
...schemaElements
|
|
17
41
|
} : schemaElements;
|
|
42
|
+
const groups = [];
|
|
18
43
|
let groupStart = 0;
|
|
19
|
-
let
|
|
20
|
-
|
|
44
|
+
for (let groupIndex = 0; groupIndex < metadata.row_groups.length; groupIndex++) {
|
|
45
|
+
const rowGroup = metadata.row_groups[groupIndex];
|
|
21
46
|
const groupRows = Number(rowGroup.num_rows);
|
|
22
47
|
const groupEnd = groupStart + groupRows;
|
|
23
|
-
const bloomFilters = bloomFiltersByGroup?.[rgIdx];
|
|
24
48
|
if (groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd && !canSkipRowGroup({
|
|
25
49
|
rowGroup,
|
|
26
50
|
physicalColumns,
|
|
27
51
|
filter,
|
|
28
52
|
strict: filterStrict,
|
|
29
|
-
bloomFilters,
|
|
53
|
+
bloomFilters: bloomFiltersByGroup?.[groupIndex],
|
|
30
54
|
schemaElements: elementsByPath
|
|
31
55
|
})) {
|
|
32
56
|
const selectStart = Math.max(rowStart - groupStart, 0);
|
|
33
57
|
const selectEnd = Math.min(rowEnd - groupStart, groupRows);
|
|
34
|
-
const pageRanges = pageRangesByGroup?.[
|
|
35
|
-
const pageLocations = pageLocationsByGroup?.[
|
|
36
|
-
let
|
|
58
|
+
const pageRanges = pageRangesByGroup?.[groupIndex];
|
|
59
|
+
const pageLocations = pageLocationsByGroup?.[groupIndex];
|
|
60
|
+
let ranges = pageRanges ? pageRanges.map(([start, end]) => {
|
|
37
61
|
return [Math.max(start, selectStart), Math.min(end, selectEnd)];
|
|
38
62
|
}).filter(([start, end]) => start < end) : [[selectStart, selectEnd]];
|
|
39
|
-
if (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
if (ranges.length > 1) ranges = rowGroup.columns.every((chunk) => {
|
|
64
|
+
const columnName = chunk.meta_data?.path_in_schema[0];
|
|
65
|
+
const columnPath = chunk.meta_data?.path_in_schema.join(".");
|
|
66
|
+
if (columns && columnName && !columns.includes(columnName)) return true;
|
|
67
|
+
return !!(chunk.offset_index_offset && chunk.offset_index_length) || !!(columnPath && pageLocations?.[columnPath]);
|
|
68
|
+
}) ? coalesceOverlappingPageRanges(ranges, rowGroup, columns, pageLocations) : [[ranges[0][0], ranges[ranges.length - 1][1]]];
|
|
69
|
+
if (ranges.length) groups.push({
|
|
70
|
+
rowGroup,
|
|
71
|
+
groupIndex,
|
|
72
|
+
groupStart,
|
|
73
|
+
groupRows,
|
|
74
|
+
ranges,
|
|
75
|
+
pageRanges,
|
|
76
|
+
pageLocations
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
groupStart = groupEnd;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
groups,
|
|
83
|
+
rowEnd: isFinite(rowEnd) ? rowEnd : groupStart
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function parquetPlanGroup({ rowGroup, groupStart, groupRows, ranges, columns, useOffsetIndex = false, pageRanges, pageLocations }) {
|
|
87
|
+
const chunks = [];
|
|
88
|
+
const fetches = [];
|
|
89
|
+
const indexes = [];
|
|
90
|
+
const narrowed = ranges.length > 1 || ranges[0][0] > 0 || ranges[0][1] < groupRows;
|
|
91
|
+
for (const chunk of rowGroup.columns) {
|
|
92
|
+
const meta = chunk.meta_data;
|
|
93
|
+
if (chunk.file_path) throw new Error("parquet file_path not supported");
|
|
94
|
+
if (!meta) throw new Error("parquet column metadata is undefined");
|
|
95
|
+
if (columns && !columns.includes(meta.path_in_schema[0])) continue;
|
|
96
|
+
const columnOffset = meta.dictionary_page_offset || meta.data_page_offset;
|
|
97
|
+
const startByte = Number(columnOffset);
|
|
98
|
+
const endByte = Number(columnOffset + meta.total_compressed_size);
|
|
99
|
+
const chunkPageLocations = pageLocations?.[meta.path_in_schema.join(".")];
|
|
100
|
+
if (chunkPageLocations && narrowed) chunks.push({
|
|
101
|
+
columnMetadata: meta,
|
|
102
|
+
pageLocations: chunkPageLocations,
|
|
103
|
+
range: {
|
|
104
|
+
startByte,
|
|
105
|
+
endByte
|
|
47
106
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (chunkPageLocations && narrowed) chunks.push({
|
|
61
|
-
columnMetadata: meta,
|
|
62
|
-
pageLocations: chunkPageLocations,
|
|
63
|
-
range: {
|
|
64
|
-
startByte,
|
|
65
|
-
endByte
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
else if ((useOffsetIndex || pageRanges) && chunk.offset_index_offset && chunk.offset_index_length && narrowed) {
|
|
69
|
-
const offsetIndexStart = Number(chunk.offset_index_offset);
|
|
70
|
-
chunks.push({
|
|
71
|
-
columnMetadata: meta,
|
|
72
|
-
offsetIndex: {
|
|
73
|
-
startByte: offsetIndexStart,
|
|
74
|
-
endByte: offsetIndexStart + chunk.offset_index_length
|
|
75
|
-
},
|
|
76
|
-
range: {
|
|
77
|
-
startByte,
|
|
78
|
-
endByte
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
} else chunks.push({
|
|
82
|
-
columnMetadata: meta,
|
|
83
|
-
range: {
|
|
84
|
-
startByte,
|
|
85
|
-
endByte
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
for (const [subStart, subEnd] of subranges) groups.push({
|
|
91
|
-
chunks,
|
|
92
|
-
rowGroup,
|
|
93
|
-
groupStart,
|
|
94
|
-
groupRows,
|
|
95
|
-
selectStart: subStart,
|
|
96
|
-
selectEnd: subEnd
|
|
97
|
-
});
|
|
98
|
-
let run;
|
|
99
|
-
for (const chunk of chunks) if ("pageLocations" in chunk) {} else if ("offsetIndex" in chunk) indexes.push(chunk.offsetIndex);
|
|
100
|
-
else {
|
|
101
|
-
const { range } = chunk;
|
|
102
|
-
if (columns) fetches.push(range);
|
|
103
|
-
else if (run && range.endByte - run.startByte <= runLimit) run.endByte = range.endByte;
|
|
104
|
-
else {
|
|
105
|
-
if (run) fetches.push(run);
|
|
106
|
-
run = { ...range };
|
|
107
|
-
}
|
|
107
|
+
});
|
|
108
|
+
else if ((useOffsetIndex || pageRanges) && chunk.offset_index_offset && chunk.offset_index_length && narrowed) {
|
|
109
|
+
const startByte = Number(chunk.offset_index_offset);
|
|
110
|
+
chunks.push({
|
|
111
|
+
columnMetadata: meta,
|
|
112
|
+
offsetIndex: {
|
|
113
|
+
startByte,
|
|
114
|
+
endByte: startByte + chunk.offset_index_length
|
|
115
|
+
},
|
|
116
|
+
range: {
|
|
117
|
+
startByte: Number(columnOffset),
|
|
118
|
+
endByte
|
|
108
119
|
}
|
|
109
|
-
|
|
120
|
+
});
|
|
121
|
+
} else chunks.push({
|
|
122
|
+
columnMetadata: meta,
|
|
123
|
+
range: {
|
|
124
|
+
startByte,
|
|
125
|
+
endByte
|
|
110
126
|
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
let run;
|
|
130
|
+
for (const chunk of chunks) {
|
|
131
|
+
if ("pageLocations" in chunk) continue;
|
|
132
|
+
if ("offsetIndex" in chunk) indexes.push(chunk.offsetIndex);
|
|
133
|
+
else if (columns) fetches.push(chunk.range);
|
|
134
|
+
else if (run && chunk.range.endByte - run.startByte <= runLimit) run.endByte = chunk.range.endByte;
|
|
135
|
+
else {
|
|
136
|
+
if (run) fetches.push(run);
|
|
137
|
+
run = { ...chunk.range };
|
|
111
138
|
}
|
|
112
|
-
groupStart = groupEnd;
|
|
113
|
-
rgIdx++;
|
|
114
139
|
}
|
|
115
|
-
if (
|
|
116
|
-
fetches.push(...indexes);
|
|
140
|
+
if (run) fetches.push(run);
|
|
117
141
|
return {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
142
|
+
groups: ranges.map(([selectStart, selectEnd]) => ({
|
|
143
|
+
chunks,
|
|
144
|
+
rowGroup,
|
|
145
|
+
groupStart,
|
|
146
|
+
groupRows,
|
|
147
|
+
selectStart,
|
|
148
|
+
selectEnd
|
|
149
|
+
})),
|
|
122
150
|
fetches,
|
|
123
|
-
|
|
151
|
+
indexes
|
|
124
152
|
};
|
|
125
153
|
}
|
|
126
154
|
function coalesceOverlappingPageRanges(ranges, rowGroup, columns, pageLocations) {
|
|
@@ -344,4 +372,4 @@ function prefetchAsyncBuffer(file, { fetches }) {
|
|
|
344
372
|
}
|
|
345
373
|
};
|
|
346
374
|
}
|
|
347
|
-
export { parquetPlan, prefetchAsyncBuffer, prefetchBloomFilters, prefetchPageIndexes };
|
|
375
|
+
export { parquetPlan, parquetPlanGroup, parquetPlanGroups, prefetchAsyncBuffer, prefetchBloomFilters, prefetchPageIndexes };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { parquetMetadataAsync, parquetSchema } from "./metadata.mjs";
|
|
2
|
+
import { concat } from "./utils.mjs";
|
|
3
|
+
import { columnsNeededForFilter, matchFilter } from "./filter.mjs";
|
|
4
|
+
import "./plan.mjs";
|
|
5
|
+
import { assembleAsync, asyncGroupToRows } from "./rowgroup.mjs";
|
|
6
|
+
import { prepareParquetRead, readParquetPlan } from "./scan.mjs";
|
|
7
|
+
async function parquetRead(options) {
|
|
8
|
+
options.metadata ??= await parquetMetadataAsync(options.file, options);
|
|
9
|
+
const { rowStart = 0, rowEnd, columns, onChunk, onComplete, rowFormat, filter, filterStrict = true } = options;
|
|
10
|
+
if (filter && rowFormat !== "object") throw new Error("parquet filter requires rowFormat: \"object\"");
|
|
11
|
+
const filterColumns = columnsNeededForFilter(filter);
|
|
12
|
+
let readColumns = columns;
|
|
13
|
+
if (columns && filterColumns.length) {
|
|
14
|
+
const selectedColumns = new Set(columns);
|
|
15
|
+
const extraColumns = filterColumns.filter((column) => !selectedColumns.has(column));
|
|
16
|
+
if (extraColumns.length) readColumns = [...columns, ...extraColumns];
|
|
17
|
+
}
|
|
18
|
+
const readOptions = readColumns === columns ? options : {
|
|
19
|
+
...options,
|
|
20
|
+
columns: readColumns
|
|
21
|
+
};
|
|
22
|
+
const prepared = await prepareParquetRead(readOptions);
|
|
23
|
+
const preparedOptions = prepared.options;
|
|
24
|
+
const requiresProjection = readColumns !== columns;
|
|
25
|
+
const asyncGroups = readParquetPlan(preparedOptions, prepared.plan);
|
|
26
|
+
if (!onComplete && !onChunk) {
|
|
27
|
+
await awaitAllColumns(asyncGroups);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!preparedOptions.metadata) throw new Error("parquet requires metadata");
|
|
31
|
+
const schemaTree = parquetSchema(preparedOptions.metadata);
|
|
32
|
+
const assembled = asyncGroups.map((arg) => assembleAsync(arg, schemaTree, options.parsers));
|
|
33
|
+
if (onChunk) for (const asyncGroup of assembled) for (const asyncColumn of asyncGroup.asyncColumns) asyncColumn.data.then(({ data, skipped }) => {
|
|
34
|
+
let rowStart = asyncGroup.groupStart + skipped;
|
|
35
|
+
for (const columnData of data) {
|
|
36
|
+
onChunk({
|
|
37
|
+
columnName: asyncColumn.pathInSchema[0],
|
|
38
|
+
columnData,
|
|
39
|
+
rowStart,
|
|
40
|
+
rowEnd: rowStart + columnData.length
|
|
41
|
+
});
|
|
42
|
+
rowStart += columnData.length;
|
|
43
|
+
}
|
|
44
|
+
}, () => {});
|
|
45
|
+
if (onComplete) {
|
|
46
|
+
await awaitAllColumns(assembled);
|
|
47
|
+
const rows = [];
|
|
48
|
+
for (const asyncGroup of assembled) {
|
|
49
|
+
const selectStart = asyncGroup.selectStart ?? Math.max(rowStart - asyncGroup.groupStart, 0);
|
|
50
|
+
const selectEnd = asyncGroup.selectEnd ?? Math.min((rowEnd ?? Infinity) - asyncGroup.groupStart, asyncGroup.groupRows);
|
|
51
|
+
const groupData = rowFormat === "object" ? await asyncGroupToRows(asyncGroup, selectStart, selectEnd, readColumns, "object") : await asyncGroupToRows(asyncGroup, selectStart, selectEnd, columns, "array");
|
|
52
|
+
if (filter) {
|
|
53
|
+
for (const row of groupData) if (matchFilter(row, filter, filterStrict)) {
|
|
54
|
+
if (requiresProjection && columns) {
|
|
55
|
+
for (const col of filterColumns) if (!columns.includes(col)) delete row[col];
|
|
56
|
+
}
|
|
57
|
+
rows.push(row);
|
|
58
|
+
}
|
|
59
|
+
} else concat(rows, groupData);
|
|
60
|
+
}
|
|
61
|
+
onComplete(rows);
|
|
62
|
+
} else await awaitAllColumns(assembled);
|
|
63
|
+
}
|
|
64
|
+
async function awaitAllColumns(asyncGroups) {
|
|
65
|
+
const all = asyncGroups.flatMap((g) => g.asyncColumns.map((c) => c.data));
|
|
66
|
+
const failed = (await Promise.allSettled(all)).find((r) => r.status === "rejected");
|
|
67
|
+
if (failed) throw failed.reason;
|
|
68
|
+
}
|
|
69
|
+
function parquetReadObjects(options) {
|
|
70
|
+
return new Promise((onComplete, reject) => {
|
|
71
|
+
parquetRead({
|
|
72
|
+
...options,
|
|
73
|
+
rowFormat: "object",
|
|
74
|
+
onComplete
|
|
75
|
+
}).catch(reject);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
export { parquetRead, parquetReadObjects };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { parquetMetadataAsync, parquetSchema } from "./metadata.mjs";
|
|
2
|
+
import { flatten } from "./utils.mjs";
|
|
3
|
+
import { columnsNeededForFilter } from "./filter.mjs";
|
|
4
|
+
import { parquetPlan, parquetPlanGroup, parquetPlanGroups, prefetchAsyncBuffer, prefetchBloomFilters, prefetchPageIndexes } from "./plan.mjs";
|
|
5
|
+
import { assembleAsync, readRowGroup } from "./rowgroup.mjs";
|
|
6
|
+
async function parquetScan(options) {
|
|
7
|
+
options.metadata ??= await parquetMetadataAsync(options.file, options);
|
|
8
|
+
const { pruningFilter, ...readOptions } = options;
|
|
9
|
+
let { columns } = readOptions;
|
|
10
|
+
if (columns && pruningFilter) {
|
|
11
|
+
const selectedColumns = new Set(columns);
|
|
12
|
+
const extraColumns = columnsNeededForFilter(pruningFilter).filter((column) => !selectedColumns.has(column));
|
|
13
|
+
if (extraColumns.length) columns = [...columns, ...extraColumns];
|
|
14
|
+
}
|
|
15
|
+
const preparedOptions = await prepareParquetOptions({
|
|
16
|
+
...readOptions,
|
|
17
|
+
columns,
|
|
18
|
+
filter: pruningFilter,
|
|
19
|
+
useOffsetIndex: readOptions.useOffsetIndex ?? true
|
|
20
|
+
});
|
|
21
|
+
const { metadata } = preparedOptions;
|
|
22
|
+
if (!metadata) throw new Error("parquet requires metadata");
|
|
23
|
+
const schemaTree = parquetSchema(metadata);
|
|
24
|
+
const availableColumns = new Set(columns ?? schemaTree.children.map((child) => child.element.name));
|
|
25
|
+
const candidates = parquetPlanGroups(preparedOptions).groups.flatMap((group) => group.ranges.map(([selectStart, selectEnd]) => ({
|
|
26
|
+
rowStart: group.groupStart + selectStart,
|
|
27
|
+
rowEnd: group.groupStart + selectEnd,
|
|
28
|
+
group
|
|
29
|
+
})));
|
|
30
|
+
const ranges = candidates.map(({ rowStart, rowEnd }) => ({
|
|
31
|
+
rowStart,
|
|
32
|
+
rowEnd
|
|
33
|
+
}));
|
|
34
|
+
const cache = /* @__PURE__ */ new Map();
|
|
35
|
+
function readColumn({ column, rowStart, rowEnd }) {
|
|
36
|
+
if (!availableColumns.has(column)) throw new Error(`parquet column not found in scan: ${column}`);
|
|
37
|
+
validateRange(rowStart, rowEnd);
|
|
38
|
+
if (rowStart === rowEnd) return Promise.resolve([]);
|
|
39
|
+
const candidateIndex = findCandidate(candidates, rowStart, rowEnd);
|
|
40
|
+
if (candidateIndex < 0) throw new RangeError(`parquet row range [${rowStart}, ${rowEnd}) is outside scan ranges`);
|
|
41
|
+
const { group } = candidates[candidateIndex];
|
|
42
|
+
const cached = cache.get(column);
|
|
43
|
+
if (cached && rowStart >= cached.rowStart && rowEnd <= cached.rowEnd) return cached.data.then((data) => sliceDecodedArray(data, rowStart - cached.rowStart, rowEnd - cached.rowStart));
|
|
44
|
+
const data = readColumnRange({
|
|
45
|
+
options: preparedOptions,
|
|
46
|
+
schemaTree,
|
|
47
|
+
group,
|
|
48
|
+
column,
|
|
49
|
+
rowStart,
|
|
50
|
+
rowEnd
|
|
51
|
+
});
|
|
52
|
+
cache.set(column, {
|
|
53
|
+
rowStart,
|
|
54
|
+
rowEnd,
|
|
55
|
+
data
|
|
56
|
+
});
|
|
57
|
+
return data;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
metadata,
|
|
61
|
+
ranges,
|
|
62
|
+
readColumn
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function prepareParquetRead(options) {
|
|
66
|
+
const prepared = await prepareParquetOptions(options);
|
|
67
|
+
return {
|
|
68
|
+
options: prepared,
|
|
69
|
+
plan: parquetPlan(prepared)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
async function prepareParquetOptions(options) {
|
|
73
|
+
const metadata = options.metadata ?? await parquetMetadataAsync(options.file, options);
|
|
74
|
+
const schemaColumns = parquetSchema(metadata).children.map((child) => child.element.name);
|
|
75
|
+
const missingFilterColumns = columnsNeededForFilter(options.filter).filter((column) => !schemaColumns.includes(column));
|
|
76
|
+
if (missingFilterColumns.length) throw new Error(`parquet filter columns not found: ${missingFilterColumns.join(", ")}`);
|
|
77
|
+
if (options.columns) {
|
|
78
|
+
const missingColumns = options.columns.filter((column) => !schemaColumns.includes(column));
|
|
79
|
+
if (missingColumns.length) throw new Error(`parquet column not found: ${missingColumns[0]}`);
|
|
80
|
+
}
|
|
81
|
+
let prepared = {
|
|
82
|
+
...options,
|
|
83
|
+
metadata
|
|
84
|
+
};
|
|
85
|
+
prepared = await withBloomFilters(prepared);
|
|
86
|
+
prepared = await withPageIndexes(prepared);
|
|
87
|
+
return prepared;
|
|
88
|
+
}
|
|
89
|
+
function readParquetPlan(options, plan) {
|
|
90
|
+
const readOptions = {
|
|
91
|
+
...options,
|
|
92
|
+
file: prefetchAsyncBuffer(options.file, plan)
|
|
93
|
+
};
|
|
94
|
+
return plan.groups.map((group) => readRowGroup(readOptions, plan, group));
|
|
95
|
+
}
|
|
96
|
+
async function readColumnRange({ options, schemaTree, group, column, rowStart, rowEnd }) {
|
|
97
|
+
const [asyncGroup] = readParquetPlan({
|
|
98
|
+
...options,
|
|
99
|
+
columns: [column],
|
|
100
|
+
filter: void 0,
|
|
101
|
+
rowStart,
|
|
102
|
+
rowEnd,
|
|
103
|
+
useBloomFilters: false,
|
|
104
|
+
useOffsetIndex: options.useOffsetIndex ?? true,
|
|
105
|
+
usePageIndex: false,
|
|
106
|
+
pageRangesByGroup: void 0
|
|
107
|
+
}, planCandidateColumn({
|
|
108
|
+
options,
|
|
109
|
+
group,
|
|
110
|
+
column,
|
|
111
|
+
rowStart,
|
|
112
|
+
rowEnd
|
|
113
|
+
}));
|
|
114
|
+
if (!asyncGroup) throw new Error("parquet scan range not planned");
|
|
115
|
+
const assembled = assembleAsync(asyncGroup, schemaTree, options.parsers);
|
|
116
|
+
const asyncColumn = assembled.asyncColumns.find((child) => child.pathInSchema[0] === column);
|
|
117
|
+
if (!asyncColumn) throw new Error(`parquet column not found: ${column}`);
|
|
118
|
+
const result = await asyncColumn.data;
|
|
119
|
+
const data = flatten(result.data);
|
|
120
|
+
const selectStart = assembled.selectStart ?? rowStart - assembled.groupStart;
|
|
121
|
+
const selectEnd = assembled.selectEnd ?? rowEnd - assembled.groupStart;
|
|
122
|
+
return sliceDecodedArray(data, selectStart - result.skipped, selectEnd - result.skipped);
|
|
123
|
+
}
|
|
124
|
+
function planCandidateColumn({ options, group, column, rowStart, rowEnd }) {
|
|
125
|
+
if (!options.metadata) throw new Error("parquet requires metadata");
|
|
126
|
+
const localPlan = parquetPlanGroup({
|
|
127
|
+
rowGroup: group.rowGroup,
|
|
128
|
+
groupStart: group.groupStart,
|
|
129
|
+
groupRows: group.groupRows,
|
|
130
|
+
ranges: [[rowStart - group.groupStart, rowEnd - group.groupStart]],
|
|
131
|
+
columns: [column],
|
|
132
|
+
useOffsetIndex: options.useOffsetIndex ?? true,
|
|
133
|
+
pageLocations: group.pageLocations
|
|
134
|
+
});
|
|
135
|
+
const [localGroupPlan] = localPlan.groups;
|
|
136
|
+
if (!localGroupPlan) throw new Error(`parquet column not found: ${column}`);
|
|
137
|
+
return {
|
|
138
|
+
metadata: options.metadata,
|
|
139
|
+
rowStart,
|
|
140
|
+
rowEnd,
|
|
141
|
+
columns: [column],
|
|
142
|
+
fetches: [...localPlan.fetches, ...localPlan.indexes],
|
|
143
|
+
groups: [localGroupPlan]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function findCandidate(candidates, rowStart, rowEnd) {
|
|
147
|
+
let low = 0;
|
|
148
|
+
let high = candidates.length - 1;
|
|
149
|
+
while (low <= high) {
|
|
150
|
+
const middle = Math.floor((low + high) / 2);
|
|
151
|
+
const candidate = candidates[middle];
|
|
152
|
+
if (rowStart < candidate.rowStart) high = middle - 1;
|
|
153
|
+
else if (rowStart >= candidate.rowEnd) low = middle + 1;
|
|
154
|
+
else return rowEnd <= candidate.rowEnd ? middle : -1;
|
|
155
|
+
}
|
|
156
|
+
return -1;
|
|
157
|
+
}
|
|
158
|
+
function validateRange(rowStart, rowEnd) {
|
|
159
|
+
if (!Number.isSafeInteger(rowStart) || rowStart < 0) throw new RangeError("parquet rowStart must be a non-negative safe integer");
|
|
160
|
+
if (!Number.isSafeInteger(rowEnd) || rowEnd < rowStart) throw new RangeError("parquet rowEnd must be a safe integer greater than or equal to rowStart");
|
|
161
|
+
}
|
|
162
|
+
function sliceDecodedArray(data, start, end) {
|
|
163
|
+
if (start === 0 && end === data.length) return data;
|
|
164
|
+
return Array.isArray(data) ? data.slice(start, end) : data.subarray(start, end);
|
|
165
|
+
}
|
|
166
|
+
async function withBloomFilters(options) {
|
|
167
|
+
if (!options.useBloomFilters || !options.filter || !options.metadata) return options;
|
|
168
|
+
const schemaTree = parquetSchema(options.metadata);
|
|
169
|
+
const schemaElements = {};
|
|
170
|
+
for (const child of schemaTree.children) schemaElements[child.element.name] = child.element;
|
|
171
|
+
const bloomFiltersByGroup = await prefetchBloomFilters({
|
|
172
|
+
file: options.file,
|
|
173
|
+
metadata: options.metadata,
|
|
174
|
+
filter: options.filter,
|
|
175
|
+
filterStrict: options.filterStrict
|
|
176
|
+
});
|
|
177
|
+
return {
|
|
178
|
+
...options,
|
|
179
|
+
bloomFiltersByGroup,
|
|
180
|
+
schemaElements
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
async function withPageIndexes(options) {
|
|
184
|
+
if (!options.usePageIndex || !options.filter || !options.metadata) return options;
|
|
185
|
+
const { pageRangesByGroup, pageLocationsByGroup } = await prefetchPageIndexes({
|
|
186
|
+
file: options.file,
|
|
187
|
+
metadata: options.metadata,
|
|
188
|
+
filter: options.filter,
|
|
189
|
+
filterStrict: options.filterStrict,
|
|
190
|
+
rowStart: options.rowStart,
|
|
191
|
+
rowEnd: options.rowEnd,
|
|
192
|
+
columns: options.columns,
|
|
193
|
+
bloomFiltersByGroup: options.bloomFiltersByGroup,
|
|
194
|
+
schemaElements: options.schemaElements,
|
|
195
|
+
parsers: options.parsers
|
|
196
|
+
});
|
|
197
|
+
return {
|
|
198
|
+
...options,
|
|
199
|
+
pageRangesByGroup,
|
|
200
|
+
pageLocationsByGroup
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export { parquetScan, prepareParquetRead, readParquetPlan };
|
package/dist/_virtual/node_modules/.pnpm/hyparquet@1.29.2/node_modules/hyparquet/src/snappy.mjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const WORD_MASK = [
|
|
2
|
+
0,
|
|
3
|
+
255,
|
|
4
|
+
65535,
|
|
5
|
+
16777215,
|
|
6
|
+
4294967295
|
|
7
|
+
];
|
|
8
|
+
function copyBytes(fromArray, fromPos, toArray, toPos, length) {
|
|
9
|
+
for (let i = 0; i < length; i++) toArray[toPos + i] = fromArray[fromPos + i];
|
|
10
|
+
}
|
|
11
|
+
function snappyUncompress(input, output) {
|
|
12
|
+
const inputLength = input.byteLength;
|
|
13
|
+
const outputLength = output.byteLength;
|
|
14
|
+
let pos = 0;
|
|
15
|
+
let outPos = 0;
|
|
16
|
+
while (pos < inputLength) {
|
|
17
|
+
const c = input[pos];
|
|
18
|
+
pos++;
|
|
19
|
+
if (c < 128) break;
|
|
20
|
+
}
|
|
21
|
+
if (outputLength && pos >= inputLength) throw new Error("invalid snappy length header");
|
|
22
|
+
while (pos < inputLength) {
|
|
23
|
+
const c = input[pos];
|
|
24
|
+
let len = 0;
|
|
25
|
+
pos++;
|
|
26
|
+
if (pos >= inputLength) throw new Error("missing eof marker");
|
|
27
|
+
if ((c & 3) === 0) {
|
|
28
|
+
let len = (c >>> 2) + 1;
|
|
29
|
+
if (len > 60) {
|
|
30
|
+
if (pos + 3 >= inputLength) throw new Error("snappy error literal pos + 3 >= inputLength");
|
|
31
|
+
const lengthSize = len - 60;
|
|
32
|
+
len = input[pos] + (input[pos + 1] << 8) + (input[pos + 2] << 16) + (input[pos + 3] << 24);
|
|
33
|
+
len = (len & WORD_MASK[lengthSize]) + 1;
|
|
34
|
+
pos += lengthSize;
|
|
35
|
+
}
|
|
36
|
+
if (pos + len > inputLength) throw new Error("snappy error literal exceeds input length");
|
|
37
|
+
copyBytes(input, pos, output, outPos, len);
|
|
38
|
+
pos += len;
|
|
39
|
+
outPos += len;
|
|
40
|
+
} else {
|
|
41
|
+
let offset = 0;
|
|
42
|
+
switch (c & 3) {
|
|
43
|
+
case 1:
|
|
44
|
+
len = (c >>> 2 & 7) + 4;
|
|
45
|
+
offset = input[pos] + (c >>> 5 << 8);
|
|
46
|
+
pos++;
|
|
47
|
+
break;
|
|
48
|
+
case 2:
|
|
49
|
+
if (inputLength <= pos + 1) throw new Error("snappy error end of input");
|
|
50
|
+
len = (c >>> 2) + 1;
|
|
51
|
+
offset = input[pos] + (input[pos + 1] << 8);
|
|
52
|
+
pos += 2;
|
|
53
|
+
break;
|
|
54
|
+
case 3:
|
|
55
|
+
if (inputLength <= pos + 3) throw new Error("snappy error end of input");
|
|
56
|
+
len = (c >>> 2) + 1;
|
|
57
|
+
offset = input[pos] + (input[pos + 1] << 8) + (input[pos + 2] << 16) + (input[pos + 3] << 24);
|
|
58
|
+
pos += 4;
|
|
59
|
+
}
|
|
60
|
+
if (offset === 0 || isNaN(offset)) throw new Error(`invalid offset ${offset} pos ${pos} inputLength ${inputLength}`);
|
|
61
|
+
if (offset > outPos) throw new Error("cannot copy from before start of buffer");
|
|
62
|
+
copyBytes(output, outPos - offset, output, outPos, len);
|
|
63
|
+
outPos += len;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (outPos !== outputLength) throw new Error("premature end of input");
|
|
67
|
+
}
|
|
68
|
+
export { snappyUncompress };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseDecimal } from "../../../../../hyparquet@1.
|
|
1
|
+
import { parseDecimal } from "../../../../../hyparquet@1.29.1/node_modules/hyparquet/src/convert.mjs";
|
|
2
2
|
import { gunzip } from "../../../../../hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/gzip.mjs";
|
|
3
3
|
import "../../../../../hyparquet-compressors@1.1.1/node_modules/hyparquet-compressors/src/index.mjs";
|
|
4
4
|
import { readZigZag, readZigZagBigInt } from "./avro.metadata.mjs";
|