@loaders.gl/parquet 4.5.3 → 5.0.0-alpha.10
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 +14 -3
- package/dist/bundled.d.ts +9 -0
- package/dist/bundled.d.ts.map +1 -0
- package/dist/bundled.js +10 -0
- package/dist/bundled.js.map +1 -0
- package/dist/delta-format.d.ts +9 -0
- package/dist/delta-format.d.ts.map +1 -0
- package/dist/delta-format.js +12 -0
- package/dist/delta-format.js.map +1 -0
- package/dist/delta-source-loader-types.d.ts +27 -0
- package/dist/delta-source-loader-types.d.ts.map +1 -0
- package/dist/delta-source-loader-types.js +28 -0
- package/dist/delta-source-loader-types.js.map +1 -0
- package/dist/delta-source.d.ts +48 -0
- package/dist/delta-source.d.ts.map +1 -0
- package/dist/delta-source.js +222 -0
- package/dist/delta-source.js.map +1 -0
- package/dist/delta-types.d.ts +38 -0
- package/dist/delta-types.d.ts.map +1 -0
- package/dist/delta-types.js +5 -0
- package/dist/delta-types.js.map +1 -0
- package/dist/geoparquet-loader-with-parser.d.ts +33 -0
- package/dist/geoparquet-loader-with-parser.d.ts.map +1 -0
- package/dist/geoparquet-loader-with-parser.js +52 -0
- package/dist/geoparquet-loader-with-parser.js.map +1 -0
- package/dist/geoparquet-loader.d.ts +59 -0
- package/dist/geoparquet-loader.d.ts.map +1 -0
- package/dist/geoparquet-loader.js +30 -0
- package/dist/geoparquet-loader.js.map +1 -0
- package/dist/iceberg-rest-catalog.d.ts +49 -0
- package/dist/iceberg-rest-catalog.d.ts.map +1 -0
- package/dist/iceberg-rest-catalog.js +78 -0
- package/dist/iceberg-rest-catalog.js.map +1 -0
- package/dist/iceberg-table-source.d.ts +63 -0
- package/dist/iceberg-table-source.d.ts.map +1 -0
- package/dist/iceberg-table-source.js +797 -0
- package/dist/iceberg-table-source.js.map +1 -0
- package/dist/iceberg-types.d.ts +150 -0
- package/dist/iceberg-types.d.ts.map +1 -0
- package/dist/iceberg-types.js +5 -0
- package/dist/iceberg-types.js.map +1 -0
- package/dist/index.cjs +41568 -6781
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +15 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/lib/arrow/convert-columns-to-row-group.js +3 -0
- package/dist/lib/arrow/convert-columns-to-row-group.js.map +1 -1
- package/dist/lib/arrow/convert-schema-from-parquet.d.ts +3 -1
- package/dist/lib/arrow/convert-schema-from-parquet.d.ts.map +1 -1
- package/dist/lib/arrow/convert-schema-from-parquet.js +164 -29
- package/dist/lib/arrow/convert-schema-from-parquet.js.map +1 -1
- package/dist/lib/arrow/convert-schema-to-parquet.d.ts.map +1 -1
- package/dist/lib/arrow/convert-schema-to-parquet.js +16 -7
- package/dist/lib/arrow/convert-schema-to-parquet.js.map +1 -1
- package/dist/lib/arrow/create-nested-arrow-vector.d.ts +8 -0
- package/dist/lib/arrow/create-nested-arrow-vector.d.ts.map +1 -0
- package/dist/lib/arrow/create-nested-arrow-vector.js +485 -0
- package/dist/lib/arrow/create-nested-arrow-vector.js.map +1 -0
- package/dist/lib/constants.d.ts +0 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +1 -2
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/encoders/encode-arrow-to-parquet.d.ts +2 -2
- package/dist/lib/encoders/encode-arrow-to-parquet.d.ts.map +1 -1
- package/dist/lib/encoders/encode-arrow-to-parquet.js +3 -10
- package/dist/lib/encoders/encode-arrow-to-parquet.js.map +1 -1
- package/dist/lib/encoders/encode-table-to-parquet-js.d.ts +5 -0
- package/dist/lib/encoders/encode-table-to-parquet-js.d.ts.map +1 -0
- package/dist/lib/encoders/encode-table-to-parquet-js.js +394 -0
- package/dist/lib/encoders/encode-table-to-parquet-js.js.map +1 -0
- package/dist/lib/geo/geoparquet-covering.d.ts +19 -0
- package/dist/lib/geo/geoparquet-covering.d.ts.map +1 -0
- package/dist/lib/geo/geoparquet-covering.js +137 -0
- package/dist/lib/geo/geoparquet-covering.js.map +1 -0
- package/dist/lib/geo/geospatial-metadata.d.ts +67 -0
- package/dist/lib/geo/geospatial-metadata.d.ts.map +1 -0
- package/dist/lib/geo/geospatial-metadata.js +412 -0
- package/dist/lib/geo/geospatial-metadata.js.map +1 -0
- package/dist/lib/parquet-bloom-filter-planner.d.ts +16 -0
- package/dist/lib/parquet-bloom-filter-planner.d.ts.map +1 -0
- package/dist/lib/parquet-bloom-filter-planner.js +57 -0
- package/dist/lib/parquet-bloom-filter-planner.js.map +1 -0
- package/dist/lib/parquet-bloom-filter.d.ts +30 -0
- package/dist/lib/parquet-bloom-filter.d.ts.map +1 -0
- package/dist/lib/parquet-bloom-filter.js +289 -0
- package/dist/lib/parquet-bloom-filter.js.map +1 -0
- package/dist/lib/parquet-encryption.d.ts +80 -0
- package/dist/lib/parquet-encryption.d.ts.map +1 -0
- package/dist/lib/parquet-encryption.js +190 -0
- package/dist/lib/parquet-encryption.js.map +1 -0
- package/dist/lib/parquet-page-index.d.ts +91 -0
- package/dist/lib/parquet-page-index.d.ts.map +1 -0
- package/dist/lib/parquet-page-index.js +463 -0
- package/dist/lib/parquet-page-index.js.map +1 -0
- package/dist/lib/parquet-predicate.d.ts +21 -0
- package/dist/lib/parquet-predicate.d.ts.map +1 -0
- package/dist/lib/parquet-predicate.js +328 -0
- package/dist/lib/parquet-predicate.js.map +1 -0
- package/dist/lib/parquet-source-worker-client.d.ts +6 -0
- package/dist/lib/parquet-source-worker-client.d.ts.map +1 -0
- package/dist/lib/parquet-source-worker-client.js +24 -0
- package/dist/lib/parquet-source-worker-client.js.map +1 -0
- package/dist/lib/parquet-source-worker-decoder.d.ts +7 -0
- package/dist/lib/parquet-source-worker-decoder.d.ts.map +1 -0
- package/dist/lib/parquet-source-worker-decoder.js +181 -0
- package/dist/lib/parquet-source-worker-decoder.js.map +1 -0
- package/dist/lib/parquet-source-worker-file.d.ts +24 -0
- package/dist/lib/parquet-source-worker-file.d.ts.map +1 -0
- package/dist/lib/parquet-source-worker-file.js +40 -0
- package/dist/lib/parquet-source-worker-file.js.map +1 -0
- package/dist/lib/parquet-source-worker-types.d.ts +121 -0
- package/dist/lib/parquet-source-worker-types.d.ts.map +1 -0
- package/dist/lib/parquet-source-worker-types.js +5 -0
- package/dist/lib/parquet-source-worker-types.js.map +1 -0
- package/dist/lib/parquet-worker-transport.d.ts +8 -0
- package/dist/lib/parquet-worker-transport.d.ts.map +1 -0
- package/dist/lib/parquet-worker-transport.js +40 -0
- package/dist/lib/parquet-worker-transport.js.map +1 -0
- package/dist/lib/parsers/convert-parquet-tables.d.ts +16 -0
- package/dist/lib/parsers/convert-parquet-tables.d.ts.map +1 -0
- package/dist/lib/parsers/convert-parquet-tables.js +30 -0
- package/dist/lib/parsers/convert-parquet-tables.js.map +1 -0
- package/dist/lib/parsers/get-parquet-schema.d.ts.map +1 -1
- package/dist/lib/parsers/get-parquet-schema.js +6 -2
- package/dist/lib/parsers/get-parquet-schema.js.map +1 -1
- package/dist/lib/parsers/parse-geoparquet-to-geojson.d.ts +4 -4
- package/dist/lib/parsers/parse-geoparquet-to-geojson.d.ts.map +1 -1
- package/dist/lib/parsers/parse-geoparquet-to-geojson.js +19 -6
- package/dist/lib/parsers/parse-geoparquet-to-geojson.js.map +1 -1
- package/dist/lib/parsers/parse-parquet-tables.d.ts +37 -0
- package/dist/lib/parsers/parse-parquet-tables.d.ts.map +1 -0
- package/dist/lib/parsers/parse-parquet-tables.js +50 -0
- package/dist/lib/parsers/parse-parquet-tables.js.map +1 -0
- package/dist/lib/parsers/parse-parquet-to-arrow-js.d.ts +19 -0
- package/dist/lib/parsers/parse-parquet-to-arrow-js.d.ts.map +1 -0
- package/dist/lib/parsers/parse-parquet-to-arrow-js.js +921 -0
- package/dist/lib/parsers/parse-parquet-to-arrow-js.js.map +1 -0
- package/dist/lib/parsers/parse-parquet-to-arrow.d.ts +7 -7
- package/dist/lib/parsers/parse-parquet-to-arrow.d.ts.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-arrow.js +45 -32
- package/dist/lib/parsers/parse-parquet-to-arrow.js.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-columns.d.ts +3 -3
- package/dist/lib/parsers/parse-parquet-to-columns.d.ts.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-columns.js +4 -5
- package/dist/lib/parsers/parse-parquet-to-columns.js.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-json.d.ts +3 -3
- package/dist/lib/parsers/parse-parquet-to-json.d.ts.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-json.js +95 -28
- package/dist/lib/parsers/parse-parquet-to-json.js.map +1 -1
- package/dist/lib/slice-parquet-batch.d.ts +9 -0
- package/dist/lib/slice-parquet-batch.d.ts.map +1 -0
- package/dist/lib/slice-parquet-batch.js +28 -0
- package/dist/lib/slice-parquet-batch.js.map +1 -0
- package/dist/lib/sources/parquet-range-file.d.ts +80 -0
- package/dist/lib/sources/parquet-range-file.d.ts.map +1 -0
- package/dist/lib/sources/parquet-range-file.js +267 -0
- package/dist/lib/sources/parquet-range-file.js.map +1 -0
- package/dist/lib/sources/single-batch-queue.d.ts +24 -0
- package/dist/lib/sources/single-batch-queue.d.ts.map +1 -0
- package/dist/lib/sources/single-batch-queue.js +91 -0
- package/dist/lib/sources/single-batch-queue.js.map +1 -0
- package/dist/lib/utils/load-wasm-node.d.ts +3 -0
- package/dist/lib/utils/load-wasm-node.d.ts.map +1 -0
- package/dist/lib/utils/load-wasm-node.js +23 -0
- package/dist/lib/utils/load-wasm-node.js.map +1 -0
- package/dist/lib/utils/load-wasm.d.ts +2 -2
- package/dist/lib/utils/load-wasm.d.ts.map +1 -1
- package/dist/lib/utils/load-wasm.js +28 -12
- package/dist/lib/utils/load-wasm.js.map +1 -1
- package/dist/lib/utils/make-stream-iterator.d.ts +2 -0
- package/dist/lib/utils/make-stream-iterator.d.ts.map +1 -1
- package/dist/lib/utils/make-stream-iterator.js +123 -14
- package/dist/lib/utils/make-stream-iterator.js.map +1 -1
- package/dist/lib/utils/normalize-parquet-options.d.ts +5 -0
- package/dist/lib/utils/normalize-parquet-options.d.ts.map +1 -0
- package/dist/lib/utils/normalize-parquet-options.js +25 -0
- package/dist/lib/utils/normalize-parquet-options.js.map +1 -0
- package/dist/parquet-dataset-source.cjs +38974 -0
- package/dist/parquet-dataset-source.cjs.map +6 -0
- package/dist/parquet-dataset-source.d.ts +81 -0
- package/dist/parquet-dataset-source.d.ts.map +1 -0
- package/dist/parquet-dataset-source.js +602 -0
- package/dist/parquet-dataset-source.js.map +1 -0
- package/dist/parquet-encoded-page-types.d.ts +108 -0
- package/dist/parquet-encoded-page-types.d.ts.map +1 -0
- package/dist/parquet-encoded-page-types.js +5 -0
- package/dist/parquet-encoded-page-types.js.map +1 -0
- package/dist/parquet-format.d.ts +2 -0
- package/dist/parquet-format.d.ts.map +1 -1
- package/dist/parquet-format.js +2 -0
- package/dist/parquet-format.js.map +1 -1
- package/dist/parquet-js-loader-types.d.ts +59 -0
- package/dist/parquet-js-loader-types.d.ts.map +1 -0
- package/dist/parquet-js-loader-types.js +34 -0
- package/dist/parquet-js-loader-types.js.map +1 -0
- package/dist/parquet-js-loader.d.ts +18 -22
- package/dist/parquet-js-loader.d.ts.map +1 -1
- package/dist/parquet-js-loader.js +53 -14
- package/dist/parquet-js-loader.js.map +1 -1
- package/dist/parquet-js-writer.d.ts +65 -0
- package/dist/parquet-js-writer.d.ts.map +1 -0
- package/dist/parquet-js-writer.js +28 -0
- package/dist/parquet-js-writer.js.map +1 -0
- package/dist/parquet-loader-base.d.ts +25 -0
- package/dist/parquet-loader-base.d.ts.map +1 -0
- package/dist/parquet-loader-base.js +23 -0
- package/dist/parquet-loader-base.js.map +1 -0
- package/dist/parquet-loader-options.d.ts +55 -0
- package/dist/parquet-loader-options.d.ts.map +1 -0
- package/dist/parquet-loader-options.js +10 -0
- package/dist/parquet-loader-options.js.map +1 -0
- package/dist/parquet-loader-types.d.ts +61 -0
- package/dist/parquet-loader-types.d.ts.map +1 -0
- package/dist/parquet-loader-types.js +17 -0
- package/dist/parquet-loader-types.js.map +1 -0
- package/dist/parquet-loader.d.ts +42 -0
- package/dist/parquet-loader.d.ts.map +1 -0
- package/dist/parquet-loader.js +68 -0
- package/dist/parquet-loader.js.map +1 -0
- package/dist/parquet-source-capabilities.d.ts +43 -0
- package/dist/parquet-source-capabilities.d.ts.map +1 -0
- package/dist/parquet-source-capabilities.js +32 -0
- package/dist/parquet-source-capabilities.js.map +1 -0
- package/dist/parquet-source-loader-types.d.ts +82 -0
- package/dist/parquet-source-loader-types.d.ts.map +1 -0
- package/dist/parquet-source-loader-types.js +84 -0
- package/dist/parquet-source-loader-types.js.map +1 -0
- package/dist/parquet-source-loader.cjs +38261 -0
- package/dist/parquet-source-loader.cjs.map +6 -0
- package/dist/parquet-source-loader.d.ts +167 -0
- package/dist/parquet-source-loader.d.ts.map +1 -0
- package/dist/parquet-source-loader.js +1438 -0
- package/dist/parquet-source-loader.js.map +1 -0
- package/dist/parquet-source-types.d.ts +534 -0
- package/dist/parquet-source-types.d.ts.map +1 -0
- package/dist/parquet-source-types.js +5 -0
- package/dist/parquet-source-types.js.map +1 -0
- package/dist/parquet-source-worker-factory.d.ts +4 -0
- package/dist/parquet-source-worker-factory.d.ts.map +1 -0
- package/dist/parquet-source-worker-factory.js +6 -0
- package/dist/parquet-source-worker-factory.js.map +1 -0
- package/dist/parquet-source-worker-url.d.ts +3 -0
- package/dist/parquet-source-worker-url.d.ts.map +1 -0
- package/dist/parquet-source-worker-url.js +22 -0
- package/dist/parquet-source-worker-url.js.map +1 -0
- package/dist/parquet-source-worker.js +38871 -0
- package/dist/parquet-source-worker.js.map +7 -0
- package/dist/parquet-worker-node.cjs +78507 -0
- package/dist/parquet-worker-node.cjs.map +7 -0
- package/dist/parquet-worker-url.d.ts +3 -0
- package/dist/parquet-worker-url.d.ts.map +1 -0
- package/dist/parquet-worker-url.js +19 -0
- package/dist/parquet-worker-url.js.map +1 -0
- package/dist/parquet-worker.js +20094 -0
- package/dist/parquet-worker.js.map +7 -0
- package/dist/parquet-writer.d.ts +10 -0
- package/dist/parquet-writer.d.ts.map +1 -0
- package/dist/parquet-writer.js +27 -0
- package/dist/parquet-writer.js.map +1 -0
- package/dist/parquet_wasm_bg.wasm +0 -0
- package/dist/parquetjs/codecs/byte-stream-split.d.ts +9 -0
- package/dist/parquetjs/codecs/byte-stream-split.d.ts.map +1 -0
- package/dist/parquetjs/codecs/byte-stream-split.js +159 -0
- package/dist/parquetjs/codecs/byte-stream-split.js.map +1 -0
- package/dist/parquetjs/codecs/declare.d.ts +35 -3
- package/dist/parquetjs/codecs/declare.d.ts.map +1 -1
- package/dist/parquetjs/codecs/declare.js +17 -1
- package/dist/parquetjs/codecs/declare.js.map +1 -1
- package/dist/parquetjs/codecs/delta.d.ts +17 -0
- package/dist/parquetjs/codecs/delta.d.ts.map +1 -0
- package/dist/parquetjs/codecs/delta.js +788 -0
- package/dist/parquetjs/codecs/delta.js.map +1 -0
- package/dist/parquetjs/codecs/dictionary.d.ts +5 -2
- package/dist/parquetjs/codecs/dictionary.d.ts.map +1 -1
- package/dist/parquetjs/codecs/dictionary.js +16 -4
- package/dist/parquetjs/codecs/dictionary.js.map +1 -1
- package/dist/parquetjs/codecs/index.d.ts.map +1 -1
- package/dist/parquetjs/codecs/index.js +22 -0
- package/dist/parquetjs/codecs/index.js.map +1 -1
- package/dist/parquetjs/codecs/plain.d.ts +3 -3
- package/dist/parquetjs/codecs/plain.d.ts.map +1 -1
- package/dist/parquetjs/codecs/plain.js +231 -78
- package/dist/parquetjs/codecs/plain.js.map +1 -1
- package/dist/parquetjs/codecs/rle.d.ts +7 -3
- package/dist/parquetjs/codecs/rle.d.ts.map +1 -1
- package/dist/parquetjs/codecs/rle.js +613 -69
- package/dist/parquetjs/codecs/rle.js.map +1 -1
- package/dist/parquetjs/compression.d.ts +16 -8
- package/dist/parquetjs/compression.d.ts.map +1 -1
- package/dist/parquetjs/compression.js +114 -141
- package/dist/parquetjs/compression.js.map +1 -1
- package/dist/parquetjs/encoder/dictionary-planner.d.ts +17 -0
- package/dist/parquetjs/encoder/dictionary-planner.d.ts.map +1 -0
- package/dist/parquetjs/encoder/dictionary-planner.js +67 -0
- package/dist/parquetjs/encoder/dictionary-planner.js.map +1 -0
- package/dist/parquetjs/encoder/page-planner.d.ts +11 -0
- package/dist/parquetjs/encoder/page-planner.d.ts.map +1 -0
- package/dist/parquetjs/encoder/page-planner.js +60 -0
- package/dist/parquetjs/encoder/page-planner.js.map +1 -0
- package/dist/parquetjs/encoder/parquet-encoder.d.ts +54 -5
- package/dist/parquetjs/encoder/parquet-encoder.d.ts.map +1 -1
- package/dist/parquetjs/encoder/parquet-encoder.js +930 -66
- package/dist/parquetjs/encoder/parquet-encoder.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/BoundingBox.d.ts +29 -0
- package/dist/parquetjs/parquet-thrift/BoundingBox.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/BoundingBox.js +85 -0
- package/dist/parquetjs/parquet-thrift/BoundingBox.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/BsonType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/BsonType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/BsonType.js +1 -1
- package/dist/parquetjs/parquet-thrift/BsonType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts +7 -2
- package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnChunk.js +37 -2
- package/dist/parquetjs/parquet-thrift/ColumnChunk.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnCryptoMetaData.d.ts +35 -0
- package/dist/parquetjs/parquet-thrift/ColumnCryptoMetaData.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnCryptoMetaData.js +135 -0
- package/dist/parquetjs/parquet-thrift/ColumnCryptoMetaData.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts +6 -6
- package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnIndex.js +3 -3
- package/dist/parquetjs/parquet-thrift/ColumnIndex.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts +12 -2
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +75 -2
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnOrder.js +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnOrder.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeader.js +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeader.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/DateType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/DateType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DateType.js +1 -1
- package/dist/parquetjs/parquet-thrift/DateType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/DecimalType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/DecimalType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DecimalType.js +1 -1
- package/dist/parquetjs/parquet-thrift/DecimalType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +1 -1
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/EdgeInterpolationAlgorithm.d.ts +8 -0
- package/dist/parquetjs/parquet-thrift/EdgeInterpolationAlgorithm.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/EdgeInterpolationAlgorithm.js +14 -0
- package/dist/parquetjs/parquet-thrift/EdgeInterpolationAlgorithm.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/Encoding.d.ts +2 -1
- package/dist/parquetjs/parquet-thrift/Encoding.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/Encoding.js +1 -0
- package/dist/parquetjs/parquet-thrift/Encoding.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/EncryptionAlgorithm.d.ts +22 -0
- package/dist/parquetjs/parquet-thrift/EncryptionAlgorithm.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/EncryptionAlgorithm.js +111 -0
- package/dist/parquetjs/parquet-thrift/EncryptionAlgorithm.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/EnumType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/EnumType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/EnumType.js +1 -1
- package/dist/parquetjs/parquet-thrift/EnumType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/FileCryptoMetaData.d.ts +16 -0
- package/dist/parquetjs/parquet-thrift/FileCryptoMetaData.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/FileCryptoMetaData.js +57 -0
- package/dist/parquetjs/parquet-thrift/FileCryptoMetaData.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts +7 -2
- package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/FileMetaData.js +37 -2
- package/dist/parquetjs/parquet-thrift/FileMetaData.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/Float16Type.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/Float16Type.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/Float16Type.js +27 -0
- package/dist/parquetjs/parquet-thrift/Float16Type.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeographyType.d.ts +14 -0
- package/dist/parquetjs/parquet-thrift/GeographyType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeographyType.js +51 -0
- package/dist/parquetjs/parquet-thrift/GeographyType.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeometryType.d.ts +11 -0
- package/dist/parquetjs/parquet-thrift/GeometryType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeometryType.js +41 -0
- package/dist/parquetjs/parquet-thrift/GeometryType.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeospatialStatistics.d.ts +18 -0
- package/dist/parquetjs/parquet-thrift/GeospatialStatistics.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/GeospatialStatistics.js +62 -0
- package/dist/parquetjs/parquet-thrift/GeospatialStatistics.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +1 -1
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/IntType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/IntType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/IntType.js +1 -1
- package/dist/parquetjs/parquet-thrift/IntType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/JsonType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/JsonType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/JsonType.js +1 -1
- package/dist/parquetjs/parquet-thrift/JsonType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/KeyValue.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/KeyValue.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/KeyValue.js +1 -1
- package/dist/parquetjs/parquet-thrift/KeyValue.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/ListType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/ListType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ListType.js +1 -1
- package/dist/parquetjs/parquet-thrift/ListType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/LogicalType.d.ts +17 -1
- package/dist/parquetjs/parquet-thrift/LogicalType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/LogicalType.js +97 -1
- package/dist/parquetjs/parquet-thrift/LogicalType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/MapType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/MapType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MapType.js +1 -1
- package/dist/parquetjs/parquet-thrift/MapType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MicroSeconds.js +1 -1
- package/dist/parquetjs/parquet-thrift/MicroSeconds.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MilliSeconds.js +1 -1
- package/dist/parquetjs/parquet-thrift/MilliSeconds.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/NanoSeconds.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/NanoSeconds.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/NanoSeconds.js +27 -0
- package/dist/parquetjs/parquet-thrift/NanoSeconds.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/NullType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/NullType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/NullType.js +1 -1
- package/dist/parquetjs/parquet-thrift/NullType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/OffsetIndex.js +1 -1
- package/dist/parquetjs/parquet-thrift/OffsetIndex.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +1 -1
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageHeader.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/PageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageHeader.js +1 -1
- package/dist/parquetjs/parquet-thrift/PageHeader.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageLocation.d.ts +2 -2
- package/dist/parquetjs/parquet-thrift/PageLocation.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageLocation.js +2 -2
- package/dist/parquetjs/parquet-thrift/PageLocation.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/RowGroup.d.ts +2 -2
- package/dist/parquetjs/parquet-thrift/RowGroup.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/RowGroup.js +2 -2
- package/dist/parquetjs/parquet-thrift/RowGroup.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/SchemaElement.js +1 -1
- package/dist/parquetjs/parquet-thrift/SchemaElement.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/SizeStatistics.d.ts +26 -0
- package/dist/parquetjs/parquet-thrift/SizeStatistics.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/SizeStatistics.js +85 -0
- package/dist/parquetjs/parquet-thrift/SizeStatistics.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/SortingColumn.js +1 -1
- package/dist/parquetjs/parquet-thrift/SortingColumn.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/Statistics.d.ts +14 -10
- package/dist/parquetjs/parquet-thrift/Statistics.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/Statistics.js +38 -2
- package/dist/parquetjs/parquet-thrift/Statistics.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/StringType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/StringType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/StringType.js +1 -1
- package/dist/parquetjs/parquet-thrift/StringType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/TimeType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeType.js +1 -1
- package/dist/parquetjs/parquet-thrift/TimeType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts +5 -1
- package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeUnit.js +25 -1
- package/dist/parquetjs/parquet-thrift/TimeUnit.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimestampType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/TimestampType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimestampType.js +1 -1
- package/dist/parquetjs/parquet-thrift/TimestampType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +1 -1
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/UUIDType.d.ts +1 -1
- package/dist/parquetjs/parquet-thrift/UUIDType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/UUIDType.js +1 -1
- package/dist/parquetjs/parquet-thrift/UUIDType.js.map +1 -1
- package/dist/parquetjs/parquet-thrift/VariantType.d.ts +11 -0
- package/dist/parquetjs/parquet-thrift/VariantType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/VariantType.js +41 -0
- package/dist/parquetjs/parquet-thrift/VariantType.js.map +1 -0
- package/dist/parquetjs/parquet-thrift/index.d.ts +12 -2
- package/dist/parquetjs/parquet-thrift/index.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/index.js +12 -2
- package/dist/parquetjs/parquet-thrift/index.js.map +1 -1
- package/dist/parquetjs/parser/decoders.d.ts +23 -3
- package/dist/parquetjs/parser/decoders.d.ts.map +1 -1
- package/dist/parquetjs/parser/decoders.js +687 -119
- package/dist/parquetjs/parser/decoders.js.map +1 -1
- package/dist/parquetjs/parser/encoded-pages.d.ts +24 -0
- package/dist/parquetjs/parser/encoded-pages.d.ts.map +1 -0
- package/dist/parquetjs/parser/encoded-pages.js +206 -0
- package/dist/parquetjs/parser/encoded-pages.js.map +1 -0
- package/dist/parquetjs/parser/parquet-reader.d.ts +111 -10
- package/dist/parquetjs/parser/parquet-reader.d.ts.map +1 -1
- package/dist/parquetjs/parser/parquet-reader.js +836 -69
- package/dist/parquetjs/parser/parquet-reader.js.map +1 -1
- package/dist/parquetjs/schema/declare.d.ts +83 -10
- package/dist/parquetjs/schema/declare.d.ts.map +1 -1
- package/dist/parquetjs/schema/declare.js.map +1 -1
- package/dist/parquetjs/schema/schema.d.ts +3 -0
- package/dist/parquetjs/schema/schema.d.ts.map +1 -1
- package/dist/parquetjs/schema/schema.js +31 -3
- package/dist/parquetjs/schema/schema.js.map +1 -1
- package/dist/parquetjs/schema/shred.d.ts +2 -0
- package/dist/parquetjs/schema/shred.d.ts.map +1 -1
- package/dist/parquetjs/schema/shred.js +285 -29
- package/dist/parquetjs/schema/shred.js.map +1 -1
- package/dist/parquetjs/schema/types.d.ts.map +1 -1
- package/dist/parquetjs/schema/types.js +290 -71
- package/dist/parquetjs/schema/types.js.map +1 -1
- package/dist/parquetjs/schema/variant.d.ts +3 -0
- package/dist/parquetjs/schema/variant.d.ts.map +1 -0
- package/dist/parquetjs/schema/variant.js +248 -0
- package/dist/parquetjs/schema/variant.js.map +1 -0
- package/dist/parquetjs/utils/binary-utils.d.ts +41 -0
- package/dist/parquetjs/utils/binary-utils.d.ts.map +1 -0
- package/dist/parquetjs/utils/binary-utils.js +106 -0
- package/dist/parquetjs/utils/binary-utils.js.map +1 -0
- package/dist/parquetjs/utils/crc32.d.ts +3 -0
- package/dist/parquetjs/utils/crc32.d.ts.map +1 -0
- package/dist/parquetjs/utils/crc32.js +15 -0
- package/dist/parquetjs/utils/crc32.js.map +1 -0
- package/dist/parquetjs/utils/file-utils.d.ts +1 -1
- package/dist/parquetjs/utils/file-utils.d.ts.map +1 -1
- package/dist/parquetjs/utils/file-utils.js +3 -3
- package/dist/parquetjs/utils/file-utils.js.map +1 -1
- package/dist/parquetjs/utils/read-utils.d.ts +25 -7
- package/dist/parquetjs/utils/read-utils.d.ts.map +1 -1
- package/dist/parquetjs/utils/read-utils.js +66 -39
- package/dist/parquetjs/utils/read-utils.js.map +1 -1
- package/dist/parquetjs/utils/thrift-runtime.d.ts +106 -0
- package/dist/parquetjs/utils/thrift-runtime.d.ts.map +1 -0
- package/dist/parquetjs/utils/thrift-runtime.js +50 -0
- package/dist/parquetjs/utils/thrift-runtime.js.map +1 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol-writer.d.ts +78 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol-writer.d.ts.map +1 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol-writer.js +213 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol-writer.js.map +1 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol.d.ts +80 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol.d.ts.map +1 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol.js +276 -0
- package/dist/parquetjs/utils/uint8-array-compact-protocol.js.map +1 -0
- package/dist/parquetjs/utils/uint8-array-transport.d.ts +25 -0
- package/dist/parquetjs/utils/uint8-array-transport.d.ts.map +1 -0
- package/dist/parquetjs/utils/uint8-array-transport.js +62 -0
- package/dist/parquetjs/utils/uint8-array-transport.js.map +1 -0
- package/dist/polyfills/process.d.ts +12 -0
- package/dist/polyfills/process.d.ts.map +1 -0
- package/dist/polyfills/process.js +17 -0
- package/dist/polyfills/process.js.map +1 -0
- package/dist/unbundled.d.ts +10 -0
- package/dist/unbundled.d.ts.map +1 -0
- package/dist/unbundled.js +11 -0
- package/dist/unbundled.js.map +1 -0
- package/dist/wasm.d.ts +3 -0
- package/dist/wasm.d.ts.map +1 -0
- package/dist/wasm.js +6 -0
- package/dist/wasm.js.map +1 -0
- package/dist/workers/parquet-source-worker.d.ts +2 -0
- package/dist/workers/parquet-source-worker.d.ts.map +1 -0
- package/dist/workers/parquet-source-worker.js +17 -0
- package/dist/workers/parquet-source-worker.js.map +1 -0
- package/dist/workers/parquet-worker-node.d.ts +2 -0
- package/dist/workers/parquet-worker-node.d.ts.map +1 -0
- package/dist/workers/parquet-worker-node.js +5 -0
- package/dist/workers/parquet-worker-node.js.map +1 -0
- package/dist/workers/parquet-worker.d.ts +2 -0
- package/dist/workers/parquet-worker.d.ts.map +1 -0
- package/dist/workers/parquet-worker.js +27 -0
- package/dist/workers/parquet-worker.js.map +1 -0
- package/package.json +84 -40
- package/src/bundled.ts +43 -0
- package/src/delta-format.ts +12 -0
- package/src/delta-source-loader-types.ts +40 -0
- package/src/delta-source.ts +305 -0
- package/src/delta-types.ts +40 -0
- package/src/geoparquet-loader-with-parser.ts +95 -0
- package/src/geoparquet-loader.ts +54 -0
- package/src/iceberg-rest-catalog.ts +122 -0
- package/src/iceberg-table-source.ts +1037 -0
- package/src/iceberg-types.ts +165 -0
- package/src/index.ts +105 -26
- package/src/lib/arrow/convert-columns-to-row-group.ts +3 -0
- package/src/lib/arrow/convert-schema-from-parquet.ts +193 -32
- package/src/lib/arrow/convert-schema-to-parquet.ts +16 -7
- package/src/lib/arrow/create-nested-arrow-vector.ts +705 -0
- package/src/lib/constants.ts +0 -2
- package/src/lib/encoders/encode-arrow-to-parquet.ts +10 -16
- package/src/lib/encoders/encode-table-to-parquet-js.ts +526 -0
- package/src/lib/geo/geoparquet-covering.ts +201 -0
- package/src/lib/geo/geospatial-metadata.ts +547 -0
- package/src/lib/parquet-bloom-filter-planner.ts +86 -0
- package/src/lib/parquet-bloom-filter.ts +345 -0
- package/src/lib/parquet-encryption.ts +344 -0
- package/src/lib/parquet-page-index.ts +727 -0
- package/src/lib/parquet-predicate.ts +410 -0
- package/src/lib/parquet-source-worker-client.ts +41 -0
- package/src/lib/parquet-source-worker-decoder.ts +252 -0
- package/src/lib/parquet-source-worker-file.ts +56 -0
- package/src/lib/parquet-source-worker-types.ts +132 -0
- package/src/lib/parquet-worker-transport.ts +57 -0
- package/src/lib/parsers/convert-parquet-tables.ts +39 -0
- package/src/lib/parsers/get-parquet-schema.ts +6 -2
- package/src/lib/parsers/parse-geoparquet-to-geojson.ts +27 -14
- package/src/lib/parsers/parse-parquet-tables.ts +82 -0
- package/src/lib/parsers/parse-parquet-to-arrow-js.ts +1213 -0
- package/src/lib/parsers/parse-parquet-to-arrow.ts +62 -36
- package/src/lib/parsers/parse-parquet-to-columns.ts +9 -8
- package/src/lib/parsers/parse-parquet-to-json.ts +119 -35
- package/src/lib/slice-parquet-batch.ts +32 -0
- package/src/lib/sources/parquet-range-file.ts +365 -0
- package/src/lib/sources/single-batch-queue.ts +95 -0
- package/src/lib/utils/load-wasm-node.ts +25 -0
- package/src/lib/utils/load-wasm.ts +36 -13
- package/src/lib/utils/make-stream-iterator.ts +126 -14
- package/src/lib/utils/normalize-parquet-options.ts +30 -0
- package/src/parquet-dataset-source.ts +800 -0
- package/src/parquet-encoded-page-types.ts +122 -0
- package/src/parquet-format.ts +2 -0
- package/src/parquet-js-loader-types.ts +53 -0
- package/src/parquet-js-loader.ts +76 -19
- package/src/parquet-js-writer.ts +98 -0
- package/src/parquet-loader-base.ts +34 -0
- package/src/parquet-loader-options.ts +62 -0
- package/src/parquet-loader-types.ts +35 -0
- package/src/parquet-loader.ts +115 -0
- package/src/parquet-source-capabilities.ts +73 -0
- package/src/parquet-source-loader-types.ts +97 -0
- package/src/parquet-source-loader.ts +2254 -0
- package/src/parquet-source-types.ts +627 -0
- package/src/parquet-source-worker-factory.ts +8 -0
- package/src/parquet-source-worker-url.ts +23 -0
- package/src/parquet-worker-url.ts +23 -0
- package/src/parquet-writer.ts +42 -0
- package/src/parquetjs/LICENSE +23 -1
- package/src/parquetjs/codecs/byte-stream-split.ts +221 -0
- package/src/parquetjs/codecs/declare.ts +62 -3
- package/src/parquetjs/codecs/delta.ts +1047 -0
- package/src/parquetjs/codecs/dictionary.ts +22 -4
- package/src/parquetjs/codecs/index.ts +22 -0
- package/src/parquetjs/codecs/plain.ts +317 -89
- package/src/parquetjs/codecs/rle.ts +852 -82
- package/src/parquetjs/compression.ts +137 -156
- package/src/parquetjs/encoder/dictionary-planner.ts +104 -0
- package/src/parquetjs/encoder/page-planner.ts +83 -0
- package/src/parquetjs/encoder/parquet-encoder.ts +1374 -95
- package/src/parquetjs/parquet-thrift/BoundingBox.ts +108 -0
- package/src/parquetjs/parquet-thrift/BsonType.ts +1 -1
- package/src/parquetjs/parquet-thrift/ColumnChunk.ts +37 -2
- package/src/parquetjs/parquet-thrift/ColumnCryptoMetaData.ts +139 -0
- package/src/parquetjs/parquet-thrift/ColumnIndex.ts +13 -13
- package/src/parquetjs/parquet-thrift/ColumnMetaData.ts +75 -2
- package/src/parquetjs/parquet-thrift/ColumnOrder.ts +1 -1
- package/src/parquetjs/parquet-thrift/DataPageHeader.ts +1 -1
- package/src/parquetjs/parquet-thrift/DataPageHeaderV2.ts +1 -1
- package/src/parquetjs/parquet-thrift/DateType.ts +1 -1
- package/src/parquetjs/parquet-thrift/DecimalType.ts +1 -1
- package/src/parquetjs/parquet-thrift/DictionaryPageHeader.ts +1 -1
- package/src/parquetjs/parquet-thrift/EdgeInterpolationAlgorithm.ts +13 -0
- package/src/parquetjs/parquet-thrift/Encoding.ts +2 -1
- package/src/parquetjs/parquet-thrift/EncryptionAlgorithm.ts +127 -0
- package/src/parquetjs/parquet-thrift/EnumType.ts +1 -1
- package/src/parquetjs/parquet-thrift/FileCryptoMetaData.ts +60 -0
- package/src/parquetjs/parquet-thrift/FileMetaData.ts +37 -2
- package/src/parquetjs/parquet-thrift/Float16Type.ts +28 -0
- package/src/parquetjs/parquet-thrift/GeographyType.ts +54 -0
- package/src/parquetjs/parquet-thrift/GeometryType.ts +43 -0
- package/src/parquetjs/parquet-thrift/GeospatialStatistics.ts +68 -0
- package/src/parquetjs/parquet-thrift/IndexPageHeader.ts +1 -1
- package/src/parquetjs/parquet-thrift/IntType.ts +1 -1
- package/src/parquetjs/parquet-thrift/JsonType.ts +1 -1
- package/src/parquetjs/parquet-thrift/KeyValue.ts +1 -1
- package/src/parquetjs/parquet-thrift/ListType.ts +1 -1
- package/src/parquetjs/parquet-thrift/LogicalType.ts +97 -1
- package/src/parquetjs/parquet-thrift/MapType.ts +1 -1
- package/src/parquetjs/parquet-thrift/MicroSeconds.ts +1 -1
- package/src/parquetjs/parquet-thrift/MilliSeconds.ts +1 -1
- package/src/parquetjs/parquet-thrift/NanoSeconds.ts +28 -0
- package/src/parquetjs/parquet-thrift/NullType.ts +1 -1
- package/src/parquetjs/parquet-thrift/OffsetIndex.ts +1 -1
- package/src/parquetjs/parquet-thrift/PageEncodingStats.ts +1 -1
- package/src/parquetjs/parquet-thrift/PageHeader.ts +1 -1
- package/src/parquetjs/parquet-thrift/PageLocation.ts +2 -2
- package/src/parquetjs/parquet-thrift/RowGroup.ts +2 -2
- package/src/parquetjs/parquet-thrift/SchemaElement.ts +1 -1
- package/src/parquetjs/parquet-thrift/SizeStatistics.ts +98 -0
- package/src/parquetjs/parquet-thrift/SortingColumn.ts +1 -1
- package/src/parquetjs/parquet-thrift/Statistics.ts +50 -14
- package/src/parquetjs/parquet-thrift/StringType.ts +1 -1
- package/src/parquetjs/parquet-thrift/TimeType.ts +1 -1
- package/src/parquetjs/parquet-thrift/TimeUnit.ts +25 -1
- package/src/parquetjs/parquet-thrift/TimestampType.ts +1 -1
- package/src/parquetjs/parquet-thrift/TypeDefinedOrder.ts +1 -1
- package/src/parquetjs/parquet-thrift/UUIDType.ts +1 -1
- package/src/parquetjs/parquet-thrift/VariantType.ts +43 -0
- package/src/parquetjs/parquet-thrift/index.ts +12 -4
- package/src/parquetjs/parser/decoders.ts +922 -143
- package/src/parquetjs/parser/encoded-pages.ts +278 -0
- package/src/parquetjs/parser/parquet-reader.ts +1334 -83
- package/src/parquetjs/schema/declare.ts +121 -9
- package/src/parquetjs/schema/schema.ts +33 -3
- package/src/parquetjs/schema/shred.ts +345 -41
- package/src/parquetjs/schema/types.ts +308 -84
- package/src/parquetjs/schema/variant.ts +313 -0
- package/src/parquetjs/utils/binary-utils.ts +132 -0
- package/src/parquetjs/utils/crc32.ts +15 -0
- package/src/parquetjs/utils/file-utils.ts +4 -4
- package/src/parquetjs/utils/read-utils.ts +77 -51
- package/src/parquetjs/utils/thrift-runtime.ts +109 -0
- package/src/parquetjs/utils/uint8-array-compact-protocol-writer.ts +254 -0
- package/src/parquetjs/utils/uint8-array-compact-protocol.ts +322 -0
- package/src/parquetjs/utils/uint8-array-transport.ts +79 -0
- package/src/polyfills/process.ts +17 -0
- package/src/unbundled.ts +47 -0
- package/src/wasm.ts +6 -0
- package/src/workers/parquet-source-worker.ts +21 -0
- package/src/workers/parquet-worker-node.ts +5 -0
- package/src/workers/parquet-worker.ts +31 -0
- package/dist/parquet-arrow-loader.d.ts +0 -43
- package/dist/parquet-arrow-loader.d.ts.map +0 -1
- package/dist/parquet-arrow-loader.js +0 -49
- package/dist/parquet-arrow-loader.js.map +0 -1
- package/dist/parquet-arrow-writer.d.ts +0 -9
- package/dist/parquet-arrow-writer.d.ts.map +0 -1
- package/dist/parquet-arrow-writer.js +0 -23
- package/dist/parquet-arrow-writer.js.map +0 -1
- package/dist/parquet-json-loader.d.ts +0 -148
- package/dist/parquet-json-loader.d.ts.map +0 -1
- package/dist/parquet-json-loader.js +0 -106
- package/dist/parquet-json-loader.js.map +0 -1
- package/dist/parquet-json-writer.d.ts +0 -19
- package/dist/parquet-json-writer.d.ts.map +0 -1
- package/dist/parquet-json-writer.js +0 -20
- package/dist/parquet-json-writer.js.map +0 -1
- package/dist/polyfills/buffer/buffer-polyfill.browser.d.ts +0 -3
- package/dist/polyfills/buffer/buffer-polyfill.browser.d.ts.map +0 -1
- package/dist/polyfills/buffer/buffer-polyfill.browser.js +0 -12
- package/dist/polyfills/buffer/buffer-polyfill.browser.js.map +0 -1
- package/dist/polyfills/buffer/buffer-polyfill.node.d.ts +0 -3
- package/dist/polyfills/buffer/buffer-polyfill.node.d.ts.map +0 -1
- package/dist/polyfills/buffer/buffer-polyfill.node.js +0 -17
- package/dist/polyfills/buffer/buffer-polyfill.node.js.map +0 -1
- package/dist/polyfills/buffer/buffer.d.ts +0 -222
- package/dist/polyfills/buffer/buffer.d.ts.map +0 -1
- package/dist/polyfills/buffer/buffer.js +0 -1868
- package/dist/polyfills/buffer/buffer.js.map +0 -1
- package/dist/polyfills/buffer/index.d.ts +0 -4
- package/dist/polyfills/buffer/index.d.ts.map +0 -1
- package/dist/polyfills/buffer/index.js +0 -9
- package/dist/polyfills/buffer/index.js.map +0 -1
- package/dist/polyfills/buffer/install-buffer-polyfill.d.ts +0 -2
- package/dist/polyfills/buffer/install-buffer-polyfill.d.ts.map +0 -1
- package/dist/polyfills/buffer/install-buffer-polyfill.js +0 -10
- package/dist/polyfills/buffer/install-buffer-polyfill.js.map +0 -1
- package/dist/workers/parquet-json-worker.d.ts +0 -2
- package/dist/workers/parquet-json-worker.d.ts.map +0 -1
- package/dist/workers/parquet-json-worker.js +0 -7
- package/dist/workers/parquet-json-worker.js.map +0 -1
- package/src/parquet-arrow-loader.ts +0 -74
- package/src/parquet-arrow-writer.ts +0 -33
- package/src/parquet-json-loader.ts +0 -160
- package/src/parquet-json-writer.ts +0 -27
- package/src/parquetjs/modules.d.ts +0 -25
- package/src/polyfills/buffer/buffer-polyfill.browser.ts +0 -14
- package/src/polyfills/buffer/buffer-polyfill.node.ts +0 -19
- package/src/polyfills/buffer/buffer.ts +0 -2205
- package/src/polyfills/buffer/index.ts +0 -11
- package/src/polyfills/buffer/install-buffer-polyfill.ts +0 -12
- package/src/workers/parquet-json-worker.ts +0 -8
|
@@ -5,13 +5,31 @@
|
|
|
5
5
|
// Forked from https://github.com/kbajalc/parquets under MIT license
|
|
6
6
|
|
|
7
7
|
import {decodeValues as decodeRleValues} from './rle';
|
|
8
|
+
import {encodeValues as encodeRleValues} from './rle';
|
|
9
|
+
import type {PrimitiveType} from '../schema/declare';
|
|
10
|
+
import type {ParquetCodecOptions} from './declare';
|
|
8
11
|
|
|
9
12
|
export function decodeValues(type, cursor, count, opts) {
|
|
10
|
-
|
|
13
|
+
const bitWidth = cursor.buffer[cursor.offset];
|
|
11
14
|
cursor.offset += 1;
|
|
12
|
-
return decodeRleValues(type, cursor, count, {...opts, disableEnvelope: true});
|
|
15
|
+
return decodeRleValues(type, cursor, count, {...opts, bitWidth, disableEnvelope: true});
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
/** Encodes dictionary indexes as a bit width followed by the RLE/bit-packed hybrid stream. */
|
|
19
|
+
export function encodeValues(
|
|
20
|
+
_type: PrimitiveType,
|
|
21
|
+
values: number[],
|
|
22
|
+
options: ParquetCodecOptions
|
|
23
|
+
): Uint8Array {
|
|
24
|
+
if (options.bitWidth === undefined) {
|
|
25
|
+
throw new Error('bitWidth is required for dictionary encoding');
|
|
26
|
+
}
|
|
27
|
+
const encodedIndices = encodeRleValues('INT32', values, {
|
|
28
|
+
bitWidth: options.bitWidth,
|
|
29
|
+
disableEnvelope: true
|
|
30
|
+
});
|
|
31
|
+
const output = new Uint8Array(encodedIndices.length + 1);
|
|
32
|
+
output[0] = options.bitWidth;
|
|
33
|
+
output.set(encodedIndices, 1);
|
|
34
|
+
return output;
|
|
17
35
|
}
|
|
@@ -9,6 +9,8 @@ import type {ParquetCodecKit} from './declare';
|
|
|
9
9
|
import * as PLAIN from './plain';
|
|
10
10
|
import * as RLE from './rle';
|
|
11
11
|
import * as DICTIONARY from './dictionary';
|
|
12
|
+
import * as DELTA from './delta';
|
|
13
|
+
import * as BYTE_STREAM_SPLIT from './byte-stream-split';
|
|
12
14
|
|
|
13
15
|
export * from './declare';
|
|
14
16
|
|
|
@@ -21,6 +23,10 @@ export const PARQUET_CODECS: Record<ParquetCodec, ParquetCodecKit> = {
|
|
|
21
23
|
encodeValues: RLE.encodeValues,
|
|
22
24
|
decodeValues: RLE.decodeValues
|
|
23
25
|
},
|
|
26
|
+
BIT_PACKED: {
|
|
27
|
+
encodeValues: RLE.encodeBitPackedValues,
|
|
28
|
+
decodeValues: RLE.decodeBitPackedValues
|
|
29
|
+
},
|
|
24
30
|
// Using the PLAIN_DICTIONARY enum value is deprecated in the Parquet 2.0 specification.
|
|
25
31
|
PLAIN_DICTIONARY: {
|
|
26
32
|
// @ts-ignore
|
|
@@ -32,5 +38,21 @@ export const PARQUET_CODECS: Record<ParquetCodec, ParquetCodecKit> = {
|
|
|
32
38
|
// @ts-ignore
|
|
33
39
|
encodeValues: DICTIONARY.encodeValues,
|
|
34
40
|
decodeValues: DICTIONARY.decodeValues
|
|
41
|
+
},
|
|
42
|
+
DELTA_BINARY_PACKED: {
|
|
43
|
+
encodeValues: DELTA.encodeDeltaBinaryPackedValues,
|
|
44
|
+
decodeValues: DELTA.decodeDeltaBinaryPackedValues
|
|
45
|
+
},
|
|
46
|
+
DELTA_LENGTH_BYTE_ARRAY: {
|
|
47
|
+
encodeValues: DELTA.encodeDeltaLengthByteArrayValues,
|
|
48
|
+
decodeValues: DELTA.decodeDeltaLengthByteArrayValues
|
|
49
|
+
},
|
|
50
|
+
DELTA_BYTE_ARRAY: {
|
|
51
|
+
encodeValues: DELTA.encodeDeltaByteArrayValues,
|
|
52
|
+
decodeValues: DELTA.decodeDeltaByteArrayValues
|
|
53
|
+
},
|
|
54
|
+
BYTE_STREAM_SPLIT: {
|
|
55
|
+
encodeValues: BYTE_STREAM_SPLIT.encodeValues,
|
|
56
|
+
decodeValues: BYTE_STREAM_SPLIT.decodeValues
|
|
35
57
|
}
|
|
36
58
|
};
|
|
@@ -6,14 +6,38 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable camelcase */
|
|
8
8
|
import type {PrimitiveType} from '../schema/declare';
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
getParquetValueOutput,
|
|
11
|
+
reserveParquetByteArrayOutput,
|
|
12
|
+
type CursorBuffer,
|
|
13
|
+
type ParquetCodecOptions,
|
|
14
|
+
type ParquetValueBuffer
|
|
15
|
+
} from './declare';
|
|
16
|
+
import {
|
|
17
|
+
concatUint8Arrays,
|
|
18
|
+
copyUint8Array,
|
|
19
|
+
encodeUtf8,
|
|
20
|
+
toUint8Array,
|
|
21
|
+
writeDoubleLE,
|
|
22
|
+
writeFloatLE,
|
|
23
|
+
writeInt32LE,
|
|
24
|
+
writeInt64LE,
|
|
25
|
+
writeUInt32LE
|
|
26
|
+
} from '../utils/binary-utils';
|
|
27
|
+
|
|
28
|
+
const JULIAN_DAY_UNIX_EPOCH = 2440588n;
|
|
29
|
+
const NANOSECONDS_PER_DAY = 86_400_000_000_000n;
|
|
30
|
+
const INT64_MIN = -(1n << 63n);
|
|
31
|
+
const INT64_MAX = (1n << 63n) - 1n;
|
|
32
|
+
const IS_LITTLE_ENDIAN = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
|
|
33
|
+
/** Largest byte value copied inline to avoid a temporary TypedArray view. */
|
|
34
|
+
const MAXIMUM_INLINE_BYTE_COPY_LENGTH = 7;
|
|
11
35
|
|
|
12
36
|
export function encodeValues(
|
|
13
37
|
type: PrimitiveType,
|
|
14
38
|
values: any[],
|
|
15
|
-
opts: ParquetCodecOptions
|
|
16
|
-
):
|
|
39
|
+
opts: ParquetCodecOptions = {}
|
|
40
|
+
): Uint8Array {
|
|
17
41
|
switch (type) {
|
|
18
42
|
case 'BOOLEAN':
|
|
19
43
|
return encodeValues_BOOLEAN(values);
|
|
@@ -22,7 +46,7 @@ export function encodeValues(
|
|
|
22
46
|
case 'INT64':
|
|
23
47
|
return encodeValues_INT64(values);
|
|
24
48
|
case 'INT96':
|
|
25
|
-
return encodeValues_INT96(values);
|
|
49
|
+
return encodeValues_INT96(values, opts.int96AsTimestamp);
|
|
26
50
|
case 'FLOAT':
|
|
27
51
|
return encodeValues_FLOAT(values);
|
|
28
52
|
case 'DOUBLE':
|
|
@@ -41,22 +65,22 @@ export function decodeValues(
|
|
|
41
65
|
cursor: CursorBuffer,
|
|
42
66
|
count: number,
|
|
43
67
|
opts: ParquetCodecOptions
|
|
44
|
-
):
|
|
68
|
+
): ParquetValueBuffer {
|
|
45
69
|
switch (type) {
|
|
46
70
|
case 'BOOLEAN':
|
|
47
|
-
return decodeValues_BOOLEAN(cursor, count);
|
|
71
|
+
return decodeValues_BOOLEAN(cursor, count, opts);
|
|
48
72
|
case 'INT32':
|
|
49
|
-
return decodeValues_INT32(cursor, count);
|
|
73
|
+
return decodeValues_INT32(cursor, count, opts);
|
|
50
74
|
case 'INT64':
|
|
51
|
-
return decodeValues_INT64(cursor, count);
|
|
75
|
+
return decodeValues_INT64(cursor, count, opts);
|
|
52
76
|
case 'INT96':
|
|
53
|
-
return decodeValues_INT96(cursor, count);
|
|
77
|
+
return decodeValues_INT96(cursor, count, opts);
|
|
54
78
|
case 'FLOAT':
|
|
55
|
-
return decodeValues_FLOAT(cursor, count);
|
|
79
|
+
return decodeValues_FLOAT(cursor, count, opts);
|
|
56
80
|
case 'DOUBLE':
|
|
57
|
-
return decodeValues_DOUBLE(cursor, count);
|
|
81
|
+
return decodeValues_DOUBLE(cursor, count, opts);
|
|
58
82
|
case 'BYTE_ARRAY':
|
|
59
|
-
return decodeValues_BYTE_ARRAY(cursor, count);
|
|
83
|
+
return decodeValues_BYTE_ARRAY(cursor, count, opts);
|
|
60
84
|
case 'FIXED_LEN_BYTE_ARRAY':
|
|
61
85
|
return decodeValues_FIXED_LEN_BYTE_ARRAY(cursor, count, opts);
|
|
62
86
|
default:
|
|
@@ -64,9 +88,8 @@ export function decodeValues(
|
|
|
64
88
|
}
|
|
65
89
|
}
|
|
66
90
|
|
|
67
|
-
function encodeValues_BOOLEAN(values: boolean[]):
|
|
68
|
-
const buf =
|
|
69
|
-
buf.fill(0);
|
|
91
|
+
function encodeValues_BOOLEAN(values: boolean[]): Uint8Array {
|
|
92
|
+
const buf = new Uint8Array(Math.ceil(values.length / 8));
|
|
70
93
|
for (let i = 0; i < values.length; i++) {
|
|
71
94
|
if (values[i]) {
|
|
72
95
|
buf[Math.floor(i / 8)] |= 1 << (i % 8);
|
|
@@ -75,168 +98,373 @@ function encodeValues_BOOLEAN(values: boolean[]): Buffer {
|
|
|
75
98
|
return buf;
|
|
76
99
|
}
|
|
77
100
|
|
|
78
|
-
function decodeValues_BOOLEAN(
|
|
79
|
-
|
|
101
|
+
function decodeValues_BOOLEAN(
|
|
102
|
+
cursor: CursorBuffer,
|
|
103
|
+
count: number,
|
|
104
|
+
options: ParquetCodecOptions
|
|
105
|
+
): ParquetValueBuffer {
|
|
106
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
80
107
|
for (let i = 0; i < count; i++) {
|
|
81
108
|
const b = cursor.buffer[cursor.offset + Math.floor(i / 8)];
|
|
82
|
-
|
|
109
|
+
const value = (b & (1 << (i % 8))) > 0;
|
|
110
|
+
output[outputOffset + i] = output instanceof Uint8Array ? Number(value) : value;
|
|
83
111
|
}
|
|
84
112
|
cursor.offset += Math.ceil(count / 8);
|
|
85
|
-
return
|
|
113
|
+
return output;
|
|
86
114
|
}
|
|
87
115
|
|
|
88
|
-
function encodeValues_INT32(values: number[]):
|
|
89
|
-
const buf =
|
|
116
|
+
function encodeValues_INT32(values: number[]): Uint8Array {
|
|
117
|
+
const buf = new Uint8Array(4 * values.length);
|
|
90
118
|
for (let i = 0; i < values.length; i++) {
|
|
91
|
-
|
|
119
|
+
writeInt32LE(buf, values[i], i * 4);
|
|
92
120
|
}
|
|
93
121
|
return buf;
|
|
94
122
|
}
|
|
95
123
|
|
|
96
|
-
function decodeValues_INT32(
|
|
97
|
-
|
|
124
|
+
function decodeValues_INT32(
|
|
125
|
+
cursor: CursorBuffer,
|
|
126
|
+
count: number,
|
|
127
|
+
options: ParquetCodecOptions
|
|
128
|
+
): ParquetValueBuffer {
|
|
129
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
130
|
+
if (output instanceof Int32Array && copyPlainTypedValues(cursor, output, outputOffset, count)) {
|
|
131
|
+
return output;
|
|
132
|
+
}
|
|
133
|
+
const dataView = getCursorDataView(cursor);
|
|
98
134
|
for (let i = 0; i < count; i++) {
|
|
99
|
-
|
|
135
|
+
output[outputOffset + i] = dataView.getInt32(cursor.offset, true);
|
|
100
136
|
cursor.offset += 4;
|
|
101
137
|
}
|
|
102
|
-
return
|
|
138
|
+
return output;
|
|
103
139
|
}
|
|
104
140
|
|
|
105
|
-
function encodeValues_INT64(values: number
|
|
106
|
-
const buf =
|
|
141
|
+
function encodeValues_INT64(values: Array<number | bigint>): Uint8Array {
|
|
142
|
+
const buf = new Uint8Array(8 * values.length);
|
|
107
143
|
for (let i = 0; i < values.length; i++) {
|
|
108
|
-
|
|
144
|
+
writeInt64LE(buf, values[i], i * 8);
|
|
109
145
|
}
|
|
110
146
|
return buf;
|
|
111
147
|
}
|
|
112
148
|
|
|
113
|
-
function decodeValues_INT64(
|
|
114
|
-
|
|
149
|
+
function decodeValues_INT64(
|
|
150
|
+
cursor: CursorBuffer,
|
|
151
|
+
count: number,
|
|
152
|
+
options: ParquetCodecOptions
|
|
153
|
+
): ParquetValueBuffer {
|
|
154
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
155
|
+
if (
|
|
156
|
+
options.int64AsBigInt &&
|
|
157
|
+
output instanceof BigInt64Array &&
|
|
158
|
+
copyPlainTypedValues(cursor, output, outputOffset, count)
|
|
159
|
+
) {
|
|
160
|
+
return output;
|
|
161
|
+
}
|
|
162
|
+
const dataView = getCursorDataView(cursor);
|
|
115
163
|
for (let i = 0; i < count; i++) {
|
|
116
|
-
|
|
164
|
+
const value = dataView.getBigInt64(cursor.offset, true);
|
|
165
|
+
output[outputOffset + i] = options.int64AsBigInt ? value : Number(value);
|
|
117
166
|
cursor.offset += 8;
|
|
118
167
|
}
|
|
119
|
-
return
|
|
168
|
+
return output;
|
|
120
169
|
}
|
|
121
170
|
|
|
122
|
-
function encodeValues_INT96(values: number
|
|
123
|
-
const buf =
|
|
171
|
+
function encodeValues_INT96(values: Array<number | bigint>, asTimestamp = false): Uint8Array {
|
|
172
|
+
const buf = new Uint8Array(12 * values.length);
|
|
124
173
|
for (let i = 0; i < values.length; i++) {
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
174
|
+
if (!asTimestamp) {
|
|
175
|
+
writeInt64LE(buf, values[i], i * 12);
|
|
176
|
+
writeUInt32LE(buf, values[i] >= 0 ? 0 : 0xffffffff, i * 12 + 8);
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
const epochNanoseconds = BigInt(values[i]);
|
|
180
|
+
if (epochNanoseconds < INT64_MIN || epochNanoseconds > INT64_MAX) {
|
|
181
|
+
throw new Error(`INT96 timestamp is outside the signed 64-bit range: ${epochNanoseconds}`);
|
|
131
182
|
}
|
|
183
|
+
const julianDayOffset = floorDivide(epochNanoseconds, NANOSECONDS_PER_DAY);
|
|
184
|
+
const nanosecondsOfDay = epochNanoseconds - julianDayOffset * NANOSECONDS_PER_DAY;
|
|
185
|
+
const julianDay = JULIAN_DAY_UNIX_EPOCH + julianDayOffset;
|
|
186
|
+
if (julianDay < -2147483648n || julianDay > 2147483647n) {
|
|
187
|
+
throw new Error(`INT96 timestamp has an unsupported Julian day: ${julianDay}`);
|
|
188
|
+
}
|
|
189
|
+
writeInt64LE(buf, nanosecondsOfDay, i * 12);
|
|
190
|
+
writeInt32LE(buf, Number(julianDay), i * 12 + 8);
|
|
132
191
|
}
|
|
133
192
|
return buf;
|
|
134
193
|
}
|
|
135
194
|
|
|
136
|
-
function
|
|
137
|
-
const
|
|
195
|
+
function floorDivide(value: bigint, divisor: bigint): bigint {
|
|
196
|
+
const quotient = value / divisor;
|
|
197
|
+
const remainder = value % divisor;
|
|
198
|
+
return remainder < 0n ? quotient - 1n : quotient;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function decodeValues_INT96(
|
|
202
|
+
cursor: CursorBuffer,
|
|
203
|
+
count: number,
|
|
204
|
+
options: ParquetCodecOptions
|
|
205
|
+
): ParquetValueBuffer {
|
|
206
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
207
|
+
const dataView = getCursorDataView(cursor);
|
|
138
208
|
for (let i = 0; i < count; i++) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
209
|
+
if (options.int96AsTimestamp) {
|
|
210
|
+
const nanosecondsOfDay = dataView.getBigUint64(cursor.offset, true);
|
|
211
|
+
if (nanosecondsOfDay >= NANOSECONDS_PER_DAY) {
|
|
212
|
+
throw new Error(`Invalid INT96 nanoseconds of day: ${nanosecondsOfDay}`);
|
|
213
|
+
}
|
|
214
|
+
const julianDay = BigInt(dataView.getInt32(cursor.offset + 8, true));
|
|
215
|
+
const epochNanoseconds =
|
|
216
|
+
(julianDay - JULIAN_DAY_UNIX_EPOCH) * NANOSECONDS_PER_DAY + nanosecondsOfDay;
|
|
217
|
+
if (epochNanoseconds < INT64_MIN || epochNanoseconds > INT64_MAX) {
|
|
218
|
+
throw new Error(`INT96 timestamp is outside the signed 64-bit range: ${epochNanoseconds}`);
|
|
219
|
+
}
|
|
220
|
+
output[outputOffset + i] = epochNanoseconds;
|
|
143
221
|
} else {
|
|
144
|
-
|
|
222
|
+
const low = Number(dataView.getBigInt64(cursor.offset, true));
|
|
223
|
+
const high = dataView.getUint32(cursor.offset + 8, true);
|
|
224
|
+
if (high === 0xffffffff) {
|
|
225
|
+
output[outputOffset + i] = ~-low + 1; // truncate to 64 actual precision
|
|
226
|
+
} else {
|
|
227
|
+
output[outputOffset + i] = low; // truncate to 64 actual precision
|
|
228
|
+
}
|
|
145
229
|
}
|
|
146
230
|
cursor.offset += 12;
|
|
147
231
|
}
|
|
148
|
-
return
|
|
232
|
+
return output;
|
|
149
233
|
}
|
|
150
234
|
|
|
151
|
-
function encodeValues_FLOAT(values: number[]):
|
|
152
|
-
const buf =
|
|
235
|
+
function encodeValues_FLOAT(values: number[]): Uint8Array {
|
|
236
|
+
const buf = new Uint8Array(4 * values.length);
|
|
153
237
|
for (let i = 0; i < values.length; i++) {
|
|
154
|
-
|
|
238
|
+
writeFloatLE(buf, values[i], i * 4);
|
|
155
239
|
}
|
|
156
240
|
return buf;
|
|
157
241
|
}
|
|
158
242
|
|
|
159
|
-
function decodeValues_FLOAT(
|
|
160
|
-
|
|
243
|
+
function decodeValues_FLOAT(
|
|
244
|
+
cursor: CursorBuffer,
|
|
245
|
+
count: number,
|
|
246
|
+
options: ParquetCodecOptions
|
|
247
|
+
): ParquetValueBuffer {
|
|
248
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
249
|
+
if (output instanceof Float32Array && copyPlainTypedValues(cursor, output, outputOffset, count)) {
|
|
250
|
+
return output;
|
|
251
|
+
}
|
|
252
|
+
const dataView = getCursorDataView(cursor);
|
|
161
253
|
for (let i = 0; i < count; i++) {
|
|
162
|
-
|
|
254
|
+
output[outputOffset + i] = dataView.getFloat32(cursor.offset, true);
|
|
163
255
|
cursor.offset += 4;
|
|
164
256
|
}
|
|
165
|
-
return
|
|
257
|
+
return output;
|
|
166
258
|
}
|
|
167
259
|
|
|
168
|
-
function encodeValues_DOUBLE(values: number[]):
|
|
169
|
-
const buf =
|
|
260
|
+
function encodeValues_DOUBLE(values: number[]): Uint8Array {
|
|
261
|
+
const buf = new Uint8Array(8 * values.length);
|
|
170
262
|
for (let i = 0; i < values.length; i++) {
|
|
171
|
-
|
|
263
|
+
writeDoubleLE(buf, values[i], i * 8);
|
|
172
264
|
}
|
|
173
265
|
return buf;
|
|
174
266
|
}
|
|
175
267
|
|
|
176
|
-
function decodeValues_DOUBLE(
|
|
177
|
-
|
|
268
|
+
function decodeValues_DOUBLE(
|
|
269
|
+
cursor: CursorBuffer,
|
|
270
|
+
count: number,
|
|
271
|
+
options: ParquetCodecOptions
|
|
272
|
+
): ParquetValueBuffer {
|
|
273
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
274
|
+
if (output instanceof Float64Array && copyPlainTypedValues(cursor, output, outputOffset, count)) {
|
|
275
|
+
return output;
|
|
276
|
+
}
|
|
277
|
+
const dataView = getCursorDataView(cursor);
|
|
178
278
|
for (let i = 0; i < count; i++) {
|
|
179
|
-
|
|
279
|
+
output[outputOffset + i] = dataView.getFloat64(cursor.offset, true);
|
|
180
280
|
cursor.offset += 8;
|
|
181
281
|
}
|
|
182
|
-
return
|
|
282
|
+
return output;
|
|
183
283
|
}
|
|
184
284
|
|
|
185
|
-
function encodeValues_BYTE_ARRAY(values:
|
|
285
|
+
function encodeValues_BYTE_ARRAY(values: any[]): Uint8Array {
|
|
286
|
+
const byteValues = values.map(toPrimitiveBytes);
|
|
186
287
|
// tslint:disable-next-line:variable-name
|
|
187
288
|
let buf_len = 0;
|
|
188
|
-
for (let i = 0; i <
|
|
189
|
-
|
|
190
|
-
buf_len += 4 + values[i].length;
|
|
289
|
+
for (let i = 0; i < byteValues.length; i++) {
|
|
290
|
+
buf_len += 4 + byteValues[i].length;
|
|
191
291
|
}
|
|
192
|
-
const buf =
|
|
292
|
+
const buf = new Uint8Array(buf_len);
|
|
193
293
|
// tslint:disable-next-line:variable-name
|
|
194
294
|
let buf_pos = 0;
|
|
195
|
-
for (let i = 0; i <
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
buf_pos += 4 +
|
|
295
|
+
for (let i = 0; i < byteValues.length; i++) {
|
|
296
|
+
writeUInt32LE(buf, byteValues[i].length, buf_pos);
|
|
297
|
+
buf.set(byteValues[i], buf_pos + 4);
|
|
298
|
+
buf_pos += 4 + byteValues[i].length;
|
|
199
299
|
}
|
|
200
300
|
return buf;
|
|
201
301
|
}
|
|
202
302
|
|
|
203
|
-
function decodeValues_BYTE_ARRAY(
|
|
204
|
-
|
|
303
|
+
function decodeValues_BYTE_ARRAY(
|
|
304
|
+
cursor: CursorBuffer,
|
|
305
|
+
count: number,
|
|
306
|
+
options: ParquetCodecOptions
|
|
307
|
+
): ParquetValueBuffer {
|
|
308
|
+
if (options.byteArrayOutput) {
|
|
309
|
+
return decodeByteArraysToContiguousOutput(cursor, count, options);
|
|
310
|
+
}
|
|
311
|
+
const {output, outputOffset} = getParquetValueOutput(options, count);
|
|
312
|
+
const dataView = getCursorDataView(cursor);
|
|
205
313
|
for (let i = 0; i < count; i++) {
|
|
206
|
-
const len =
|
|
314
|
+
const len = dataView.getUint32(cursor.offset, true);
|
|
207
315
|
cursor.offset += 4;
|
|
208
|
-
|
|
209
|
-
values.push(cursor.buffer.slice(cursor.offset, cursor.offset + len));
|
|
210
|
-
cursor.offset += len;
|
|
316
|
+
output[outputOffset + i] = readByteArray(cursor, len, options.retainByteArrayViews);
|
|
211
317
|
}
|
|
212
|
-
return
|
|
318
|
+
return output;
|
|
213
319
|
}
|
|
214
320
|
|
|
215
|
-
|
|
321
|
+
/** Decodes length-prefixed PLAIN values directly into one Arrow-compatible byte buffer. */
|
|
322
|
+
function decodeByteArraysToContiguousOutput(
|
|
323
|
+
cursor: CursorBuffer,
|
|
324
|
+
count: number,
|
|
325
|
+
options: ParquetCodecOptions
|
|
326
|
+
): ParquetValueBuffer {
|
|
327
|
+
const byteArrayOutput = options.byteArrayOutput!;
|
|
328
|
+
const outputOffset = options.outputOffset || 0;
|
|
329
|
+
const dataView = getCursorDataView(cursor);
|
|
330
|
+
let byteOffset = byteArrayOutput.byteLength;
|
|
331
|
+
byteArrayOutput.valueOffsets[outputOffset] = byteOffset;
|
|
332
|
+
const remainingByteLength = (cursor.size ?? cursor.buffer.byteLength) - cursor.offset;
|
|
333
|
+
if (remainingByteLength < 0) {
|
|
334
|
+
throw new Error('PLAIN BYTE_ARRAY cursor exceeds the page buffer');
|
|
335
|
+
}
|
|
336
|
+
// PLAIN's remaining encoded bytes are an upper bound for its decoded payload because each value
|
|
337
|
+
// drops a four-byte length prefix. Reserve once per page instead of checking capacity per value.
|
|
338
|
+
reserveParquetByteArrayOutput(byteArrayOutput, remainingByteLength);
|
|
339
|
+
for (let valueIndex = 0; valueIndex < count; valueIndex++) {
|
|
340
|
+
const byteLength = dataView.getUint32(cursor.offset, true);
|
|
341
|
+
cursor.offset += 4;
|
|
342
|
+
const sourceEnd = cursor.offset + byteLength;
|
|
343
|
+
const destinationEnd = byteOffset + byteLength;
|
|
344
|
+
if (sourceEnd > (cursor.size ?? cursor.buffer.byteLength)) {
|
|
345
|
+
throw new Error('PLAIN BYTE_ARRAY value exceeds the page buffer');
|
|
346
|
+
}
|
|
347
|
+
if (byteLength <= MAXIMUM_INLINE_BYTE_COPY_LENGTH) {
|
|
348
|
+
for (let byteIndex = 0; byteIndex < byteLength; byteIndex++) {
|
|
349
|
+
byteArrayOutput.data[byteOffset + byteIndex] = cursor.buffer[cursor.offset + byteIndex];
|
|
350
|
+
}
|
|
351
|
+
} else {
|
|
352
|
+
byteArrayOutput.data.set(cursor.buffer.subarray(cursor.offset, sourceEnd), byteOffset);
|
|
353
|
+
}
|
|
354
|
+
cursor.offset = sourceEnd;
|
|
355
|
+
byteOffset = destinationEnd;
|
|
356
|
+
byteArrayOutput.valueOffsets[outputOffset + valueIndex + 1] = byteOffset;
|
|
357
|
+
}
|
|
358
|
+
byteArrayOutput.byteLength = byteOffset;
|
|
359
|
+
return options.output || [];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function encodeValues_FIXED_LEN_BYTE_ARRAY(values: any[], opts: ParquetCodecOptions): Uint8Array {
|
|
216
363
|
if (!opts.typeLength) {
|
|
217
364
|
throw new Error('missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)');
|
|
218
365
|
}
|
|
366
|
+
const byteValues = values.map(toPrimitiveBytes);
|
|
219
367
|
for (let i = 0; i < values.length; i++) {
|
|
220
|
-
|
|
221
|
-
if (values[i].length !== opts.typeLength) {
|
|
368
|
+
if (byteValues[i].length !== opts.typeLength) {
|
|
222
369
|
throw new Error(`invalid value for FIXED_LEN_BYTE_ARRAY: ${values[i]}`);
|
|
223
370
|
}
|
|
224
371
|
}
|
|
225
|
-
return
|
|
372
|
+
return concatUint8Arrays(byteValues);
|
|
226
373
|
}
|
|
227
374
|
|
|
228
375
|
function decodeValues_FIXED_LEN_BYTE_ARRAY(
|
|
229
376
|
cursor: CursorBuffer,
|
|
230
377
|
count: number,
|
|
231
378
|
opts: ParquetCodecOptions
|
|
232
|
-
):
|
|
233
|
-
const values: Buffer[] = [];
|
|
379
|
+
): ParquetValueBuffer {
|
|
234
380
|
if (!opts.typeLength) {
|
|
235
381
|
throw new Error('missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)');
|
|
236
382
|
}
|
|
383
|
+
if (opts.byteArrayOutput) {
|
|
384
|
+
return decodeFixedLengthByteArraysToContiguousOutput(cursor, count, opts.typeLength, opts);
|
|
385
|
+
}
|
|
386
|
+
const {output, outputOffset} = getParquetValueOutput(opts, count);
|
|
237
387
|
for (let i = 0; i < count; i++) {
|
|
238
|
-
|
|
239
|
-
cursor.offset += opts.typeLength;
|
|
388
|
+
output[outputOffset + i] = readByteArray(cursor, opts.typeLength, opts.retainByteArrayViews);
|
|
240
389
|
}
|
|
241
|
-
return
|
|
390
|
+
return output;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/** Exposes one fixed-width PLAIN payload directly as Arrow-compatible bytes and offsets. */
|
|
394
|
+
function decodeFixedLengthByteArraysToContiguousOutput(
|
|
395
|
+
cursor: CursorBuffer,
|
|
396
|
+
count: number,
|
|
397
|
+
typeLength: number,
|
|
398
|
+
options: ParquetCodecOptions
|
|
399
|
+
): ParquetValueBuffer {
|
|
400
|
+
const byteArrayOutput = options.byteArrayOutput!;
|
|
401
|
+
const outputOffset = options.outputOffset || 0;
|
|
402
|
+
const payloadByteLength = count * typeLength;
|
|
403
|
+
const inputEnd = cursor.offset + payloadByteLength;
|
|
404
|
+
if (inputEnd > (cursor.size ?? cursor.buffer.byteLength)) {
|
|
405
|
+
throw new Error('PLAIN FIXED_LEN_BYTE_ARRAY values exceed the page buffer');
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
let byteOffset = byteArrayOutput.byteLength;
|
|
409
|
+
byteArrayOutput.valueOffsets[outputOffset] = byteOffset;
|
|
410
|
+
if (byteOffset === 0) {
|
|
411
|
+
// The common single-page case can retain the original Parquet bytes without allocating either
|
|
412
|
+
// one view per value or a second payload buffer. A later page falls back to append-and-copy.
|
|
413
|
+
byteArrayOutput.data = cursor.buffer.subarray(cursor.offset, inputEnd);
|
|
414
|
+
} else {
|
|
415
|
+
reserveParquetByteArrayOutput(byteArrayOutput, payloadByteLength);
|
|
416
|
+
byteArrayOutput.data.set(cursor.buffer.subarray(cursor.offset, inputEnd), byteOffset);
|
|
417
|
+
}
|
|
418
|
+
cursor.offset = inputEnd;
|
|
419
|
+
for (let valueIndex = 0; valueIndex < count; valueIndex++) {
|
|
420
|
+
byteOffset += typeLength;
|
|
421
|
+
byteArrayOutput.valueOffsets[outputOffset + valueIndex + 1] = byteOffset;
|
|
422
|
+
}
|
|
423
|
+
byteArrayOutput.byteLength = byteOffset;
|
|
424
|
+
return options.output || [];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/** Reads one byte-array value, optionally retaining a view into the decoded page buffer. */
|
|
428
|
+
function readByteArray(
|
|
429
|
+
cursor: CursorBuffer,
|
|
430
|
+
byteLength: number,
|
|
431
|
+
retainByteArrayView: boolean | undefined
|
|
432
|
+
): Uint8Array {
|
|
433
|
+
const value = cursor.buffer.subarray(cursor.offset, cursor.offset + byteLength);
|
|
434
|
+
cursor.offset += byteLength;
|
|
435
|
+
return retainByteArrayView ? value : copyUint8Array(value);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Creates one reusable DataView for all primitive reads from a codec cursor. */
|
|
439
|
+
function getCursorDataView(cursor: CursorBuffer): DataView {
|
|
440
|
+
return new DataView(cursor.buffer.buffer, cursor.buffer.byteOffset, cursor.buffer.byteLength);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** Copies little-endian PLAIN values directly into an identical typed destination. */
|
|
444
|
+
function copyPlainTypedValues(
|
|
445
|
+
cursor: CursorBuffer,
|
|
446
|
+
output: Int32Array | BigInt64Array | Float32Array | Float64Array,
|
|
447
|
+
outputOffset: number,
|
|
448
|
+
count: number
|
|
449
|
+
): boolean {
|
|
450
|
+
if (!IS_LITTLE_ENDIAN) {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
const byteLength = count * output.BYTES_PER_ELEMENT;
|
|
454
|
+
const inputEnd = cursor.offset + byteLength;
|
|
455
|
+
if (inputEnd > (cursor.size ?? cursor.buffer.length) || outputOffset + count > output.length) {
|
|
456
|
+
throw new Error('Unexpected end of Parquet PLAIN values');
|
|
457
|
+
}
|
|
458
|
+
const outputBytes = new Uint8Array(
|
|
459
|
+
output.buffer,
|
|
460
|
+
output.byteOffset + outputOffset * output.BYTES_PER_ELEMENT,
|
|
461
|
+
byteLength
|
|
462
|
+
);
|
|
463
|
+
outputBytes.set(cursor.buffer.subarray(cursor.offset, inputEnd));
|
|
464
|
+
cursor.offset = inputEnd;
|
|
465
|
+
return true;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function toPrimitiveBytes(value: any): Uint8Array {
|
|
469
|
+
return typeof value === 'string' ? encodeUtf8(value) : toUint8Array(value);
|
|
242
470
|
}
|