@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
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {decodeUtf8, toUint8Array} from '../utils/binary-utils';
|
|
6
|
+
|
|
7
|
+
const MAXIMUM_VARIANT_NESTING = 1024;
|
|
8
|
+
|
|
9
|
+
/** Decodes the binary metadata/value pair used by the Parquet VARIANT type. */
|
|
10
|
+
export function decodeVariant(
|
|
11
|
+
metadataInput: ArrayBuffer | ArrayBufferView,
|
|
12
|
+
valueInput: ArrayBuffer | ArrayBufferView
|
|
13
|
+
): unknown {
|
|
14
|
+
const metadata = toUint8Array(metadataInput);
|
|
15
|
+
const value = toUint8Array(valueInput);
|
|
16
|
+
const dictionary = decodeVariantMetadata(metadata);
|
|
17
|
+
const decoded = decodeVariantValue(value, 0, value.length, dictionary, 0);
|
|
18
|
+
if (decoded.nextOffset !== value.length) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`parquet: trailing bytes in VARIANT value (${value.length - decoded.nextOffset})`
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return decoded.value;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface VariantMetadata {
|
|
27
|
+
/** Dictionary strings used by object field IDs. */
|
|
28
|
+
dictionary: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface DecodedVariantValue {
|
|
32
|
+
/** Decoded JavaScript value. */
|
|
33
|
+
value: unknown;
|
|
34
|
+
/** Offset immediately following the encoded value. */
|
|
35
|
+
nextOffset: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Parses the versioned dictionary at the start of every Variant value. */
|
|
39
|
+
function decodeVariantMetadata(bytes: Uint8Array): VariantMetadata {
|
|
40
|
+
if (bytes.length < 2) {
|
|
41
|
+
throw new Error('parquet: VARIANT metadata is truncated');
|
|
42
|
+
}
|
|
43
|
+
const header = bytes[0];
|
|
44
|
+
const version = header & 0xf;
|
|
45
|
+
if (version !== 1) {
|
|
46
|
+
throw new Error(`parquet: unsupported VARIANT metadata version ${version}`);
|
|
47
|
+
}
|
|
48
|
+
const offsetSize = ((header >> 6) & 0x3) + 1;
|
|
49
|
+
const dictionarySize = readUnsigned(bytes, 1, offsetSize);
|
|
50
|
+
const offsetsStart = 1 + offsetSize;
|
|
51
|
+
const offsetsEnd = offsetsStart + (dictionarySize + 1) * offsetSize;
|
|
52
|
+
if (offsetsEnd > bytes.length) {
|
|
53
|
+
throw new Error('parquet: VARIANT metadata offsets are truncated');
|
|
54
|
+
}
|
|
55
|
+
const dictionaryBytes = bytes.subarray(offsetsEnd);
|
|
56
|
+
const dictionary: string[] = [];
|
|
57
|
+
let previousOffset = 0;
|
|
58
|
+
for (let index = 0; index < dictionarySize + 1; index++) {
|
|
59
|
+
const offset = readUnsigned(bytes, offsetsStart + index * offsetSize, offsetSize);
|
|
60
|
+
if (offset < previousOffset || offset > dictionaryBytes.length) {
|
|
61
|
+
throw new Error('parquet: invalid VARIANT metadata dictionary offset');
|
|
62
|
+
}
|
|
63
|
+
if (index < dictionarySize) {
|
|
64
|
+
dictionary.push(
|
|
65
|
+
decodeUtf8(
|
|
66
|
+
dictionaryBytes.subarray(
|
|
67
|
+
offset,
|
|
68
|
+
readUnsigned(bytes, offsetsStart + (index + 1) * offsetSize, offsetSize)
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
previousOffset = offset;
|
|
74
|
+
}
|
|
75
|
+
if (previousOffset !== dictionaryBytes.length) {
|
|
76
|
+
throw new Error('parquet: VARIANT metadata does not consume its dictionary bytes');
|
|
77
|
+
}
|
|
78
|
+
return {dictionary};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Decodes one self-contained Variant value within the enclosing byte range. */
|
|
82
|
+
function decodeVariantValue(
|
|
83
|
+
bytes: Uint8Array,
|
|
84
|
+
offset: number,
|
|
85
|
+
endOffset: number,
|
|
86
|
+
metadata: VariantMetadata,
|
|
87
|
+
depth: number
|
|
88
|
+
): DecodedVariantValue {
|
|
89
|
+
if (depth > MAXIMUM_VARIANT_NESTING || offset >= endOffset) {
|
|
90
|
+
throw new Error('parquet: invalid or excessively nested VARIANT value');
|
|
91
|
+
}
|
|
92
|
+
const valueMetadata = bytes[offset++];
|
|
93
|
+
const basicType = valueMetadata & 0x3;
|
|
94
|
+
const valueHeader = valueMetadata >> 2;
|
|
95
|
+
switch (basicType) {
|
|
96
|
+
case 0:
|
|
97
|
+
return decodePrimitiveValue(bytes, offset, endOffset, valueHeader);
|
|
98
|
+
case 1: {
|
|
99
|
+
const stringEnd = checkedEnd(offset + valueHeader, endOffset);
|
|
100
|
+
return {value: decodeUtf8(bytes.subarray(offset, stringEnd)), nextOffset: stringEnd};
|
|
101
|
+
}
|
|
102
|
+
case 2:
|
|
103
|
+
return decodeObjectValue(bytes, offset, endOffset, valueHeader, metadata, depth + 1);
|
|
104
|
+
case 3:
|
|
105
|
+
return decodeArrayValue(bytes, offset, endOffset, valueHeader, metadata, depth + 1);
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`parquet: invalid VARIANT basic type ${basicType}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** Decodes a Variant primitive identified by its six-bit primitive header. */
|
|
112
|
+
function decodePrimitiveValue(
|
|
113
|
+
bytes: Uint8Array,
|
|
114
|
+
offset: number,
|
|
115
|
+
endOffset: number,
|
|
116
|
+
primitiveType: number
|
|
117
|
+
): DecodedVariantValue {
|
|
118
|
+
switch (primitiveType) {
|
|
119
|
+
case 0:
|
|
120
|
+
return {value: null, nextOffset: offset};
|
|
121
|
+
case 1:
|
|
122
|
+
return {value: true, nextOffset: offset};
|
|
123
|
+
case 2:
|
|
124
|
+
return {value: false, nextOffset: offset};
|
|
125
|
+
case 3:
|
|
126
|
+
return {value: readSigned(bytes, offset, 1), nextOffset: checkedEnd(offset + 1, endOffset)};
|
|
127
|
+
case 4:
|
|
128
|
+
return {value: readSigned(bytes, offset, 2), nextOffset: checkedEnd(offset + 2, endOffset)};
|
|
129
|
+
case 5:
|
|
130
|
+
return {value: readSigned(bytes, offset, 4), nextOffset: checkedEnd(offset + 4, endOffset)};
|
|
131
|
+
case 6:
|
|
132
|
+
return {value: readBigInt(bytes, offset, 8), nextOffset: checkedEnd(offset + 8, endOffset)};
|
|
133
|
+
case 7:
|
|
134
|
+
return {value: readFloat64(bytes, offset), nextOffset: checkedEnd(offset + 8, endOffset)};
|
|
135
|
+
case 8:
|
|
136
|
+
case 9:
|
|
137
|
+
case 10: {
|
|
138
|
+
const scale = readSigned(bytes, offset, 1);
|
|
139
|
+
const width = primitiveType === 8 ? 4 : primitiveType === 9 ? 8 : 16;
|
|
140
|
+
const unscaled = readBigInt(bytes, offset + 1, width);
|
|
141
|
+
return {
|
|
142
|
+
value: formatVariantDecimal(unscaled, scale),
|
|
143
|
+
nextOffset: checkedEnd(offset + 1 + width, endOffset)
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
case 11:
|
|
147
|
+
return {value: readSigned(bytes, offset, 4), nextOffset: checkedEnd(offset + 4, endOffset)};
|
|
148
|
+
case 12:
|
|
149
|
+
case 13:
|
|
150
|
+
case 17:
|
|
151
|
+
case 18:
|
|
152
|
+
case 19:
|
|
153
|
+
return {value: readBigInt(bytes, offset, 8), nextOffset: checkedEnd(offset + 8, endOffset)};
|
|
154
|
+
case 14:
|
|
155
|
+
return {value: readFloat32(bytes, offset), nextOffset: checkedEnd(offset + 4, endOffset)};
|
|
156
|
+
case 15: {
|
|
157
|
+
const length = readUnsigned(bytes, offset, 4);
|
|
158
|
+
const start = checkedEnd(offset + 4, endOffset);
|
|
159
|
+
const binaryEnd = checkedEnd(start + length, endOffset);
|
|
160
|
+
return {value: bytes.slice(start, binaryEnd), nextOffset: binaryEnd};
|
|
161
|
+
}
|
|
162
|
+
case 16: {
|
|
163
|
+
const length = readUnsigned(bytes, offset, 4);
|
|
164
|
+
const start = checkedEnd(offset + 4, endOffset);
|
|
165
|
+
const stringEnd = checkedEnd(start + length, endOffset);
|
|
166
|
+
return {value: decodeUtf8(bytes.subarray(start, stringEnd)), nextOffset: stringEnd};
|
|
167
|
+
}
|
|
168
|
+
case 20: {
|
|
169
|
+
const uuidEnd = checkedEnd(offset + 16, endOffset);
|
|
170
|
+
return {value: bytes.slice(offset, uuidEnd), nextOffset: uuidEnd};
|
|
171
|
+
}
|
|
172
|
+
default:
|
|
173
|
+
throw new Error(`parquet: unsupported VARIANT primitive type ${primitiveType}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/** Decodes an object using metadata dictionary field IDs and relative value offsets. */
|
|
178
|
+
function decodeObjectValue(
|
|
179
|
+
bytes: Uint8Array,
|
|
180
|
+
offset: number,
|
|
181
|
+
endOffset: number,
|
|
182
|
+
valueHeader: number,
|
|
183
|
+
metadata: VariantMetadata,
|
|
184
|
+
depth: number
|
|
185
|
+
): DecodedVariantValue {
|
|
186
|
+
const isLarge = (valueHeader & 0x10) !== 0;
|
|
187
|
+
const fieldIdSize = ((valueHeader >> 2) & 0x3) + 1;
|
|
188
|
+
const fieldOffsetSize = (valueHeader & 0x3) + 1;
|
|
189
|
+
const countSize = isLarge ? 4 : 1;
|
|
190
|
+
const count = readUnsigned(bytes, offset, countSize);
|
|
191
|
+
offset = checkedEnd(offset + countSize, endOffset);
|
|
192
|
+
const fieldIds: number[] = [];
|
|
193
|
+
for (let index = 0; index < count; index++) {
|
|
194
|
+
fieldIds.push(readUnsigned(bytes, offset, fieldIdSize));
|
|
195
|
+
offset = checkedEnd(offset + fieldIdSize, endOffset);
|
|
196
|
+
}
|
|
197
|
+
const offsets: number[] = [];
|
|
198
|
+
for (let index = 0; index <= count; index++) {
|
|
199
|
+
offsets.push(readUnsigned(bytes, offset, fieldOffsetSize));
|
|
200
|
+
offset = checkedEnd(offset + fieldOffsetSize, endOffset);
|
|
201
|
+
}
|
|
202
|
+
const valuesStart = offset;
|
|
203
|
+
const valuesEnd = checkedEnd(valuesStart + offsets[offsets.length - 1], endOffset);
|
|
204
|
+
const object: Record<string, unknown> = Object.create(null) as Record<string, unknown>;
|
|
205
|
+
for (let index = 0; index < count; index++) {
|
|
206
|
+
const fieldId = fieldIds[index];
|
|
207
|
+
const fieldName = metadata.dictionary[fieldId];
|
|
208
|
+
if (fieldName === undefined) {
|
|
209
|
+
throw new Error(`parquet: invalid VARIANT object field id ${fieldId}`);
|
|
210
|
+
}
|
|
211
|
+
if (Object.prototype.hasOwnProperty.call(object, fieldName)) {
|
|
212
|
+
throw new Error(`parquet: duplicate VARIANT object field ${fieldName}`);
|
|
213
|
+
}
|
|
214
|
+
const valueOffset = checkedEnd(valuesStart + offsets[index], valuesEnd);
|
|
215
|
+
const decoded = decodeVariantValue(bytes, valueOffset, valuesEnd, metadata, depth);
|
|
216
|
+
object[fieldName] = decoded.value;
|
|
217
|
+
}
|
|
218
|
+
return {value: object, nextOffset: valuesEnd};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** Decodes an array using relative offsets into its contiguous value region. */
|
|
222
|
+
function decodeArrayValue(
|
|
223
|
+
bytes: Uint8Array,
|
|
224
|
+
offset: number,
|
|
225
|
+
endOffset: number,
|
|
226
|
+
valueHeader: number,
|
|
227
|
+
metadata: VariantMetadata,
|
|
228
|
+
depth: number
|
|
229
|
+
): DecodedVariantValue {
|
|
230
|
+
const isLarge = (valueHeader & 0x4) !== 0;
|
|
231
|
+
const fieldOffsetSize = (valueHeader & 0x3) + 1;
|
|
232
|
+
const countSize = isLarge ? 4 : 1;
|
|
233
|
+
const count = readUnsigned(bytes, offset, countSize);
|
|
234
|
+
offset = checkedEnd(offset + countSize, endOffset);
|
|
235
|
+
const offsets: number[] = [];
|
|
236
|
+
for (let index = 0; index <= count; index++) {
|
|
237
|
+
offsets.push(readUnsigned(bytes, offset, fieldOffsetSize));
|
|
238
|
+
offset = checkedEnd(offset + fieldOffsetSize, endOffset);
|
|
239
|
+
}
|
|
240
|
+
const valuesStart = offset;
|
|
241
|
+
const valuesEnd = checkedEnd(valuesStart + offsets[offsets.length - 1], endOffset);
|
|
242
|
+
const array = new Array<unknown>(count);
|
|
243
|
+
for (let index = 0; index < count; index++) {
|
|
244
|
+
const valueOffset = checkedEnd(valuesStart + offsets[index], valuesEnd);
|
|
245
|
+
array[index] = decodeVariantValue(bytes, valueOffset, valuesEnd, metadata, depth).value;
|
|
246
|
+
}
|
|
247
|
+
return {value: array, nextOffset: valuesEnd};
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** Reads an unsigned little-endian integer of up to four bytes. */
|
|
251
|
+
function readUnsigned(bytes: Uint8Array, offset: number, byteLength: number): number {
|
|
252
|
+
let value = 0;
|
|
253
|
+
for (let index = 0; index < byteLength; index++) {
|
|
254
|
+
value += bytes[offset + index] * 2 ** (index * 8);
|
|
255
|
+
}
|
|
256
|
+
if (!Number.isSafeInteger(value)) {
|
|
257
|
+
throw new Error('parquet: VARIANT integer exceeds JavaScript safe range');
|
|
258
|
+
}
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** Reads a signed little-endian integer of up to four bytes. */
|
|
263
|
+
function readSigned(bytes: Uint8Array, offset: number, byteLength: number): number {
|
|
264
|
+
const unsigned = readUnsigned(bytes, offset, byteLength);
|
|
265
|
+
const signBit = 2 ** (byteLength * 8 - 1);
|
|
266
|
+
return unsigned >= signBit ? unsigned - 2 ** (byteLength * 8) : unsigned;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** Reads a signed little-endian integer while preserving 64- and 128-bit precision. */
|
|
270
|
+
function readBigInt(bytes: Uint8Array, offset: number, byteLength: number): bigint {
|
|
271
|
+
let value = 0n;
|
|
272
|
+
for (let index = 0; index < byteLength; index++) {
|
|
273
|
+
value |= BigInt(bytes[offset + index]) << BigInt(index * 8);
|
|
274
|
+
}
|
|
275
|
+
const signBit = 1n << BigInt(byteLength * 8 - 1);
|
|
276
|
+
return value >= signBit ? value - (1n << BigInt(byteLength * 8)) : value;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** Reads a little-endian IEEE-754 single-precision value. */
|
|
280
|
+
function readFloat32(bytes: Uint8Array, offset: number): number {
|
|
281
|
+
return new DataView(bytes.buffer, bytes.byteOffset + offset, 4).getFloat32(0, true);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Reads a little-endian IEEE-754 double-precision value. */
|
|
285
|
+
function readFloat64(bytes: Uint8Array, offset: number): number {
|
|
286
|
+
return new DataView(bytes.buffer, bytes.byteOffset + offset, 8).getFloat64(0, true);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Formats a Variant decimal without losing precision when JavaScript numbers are unsafe. */
|
|
290
|
+
function formatVariantDecimal(unscaled: bigint, scale: number): number | string {
|
|
291
|
+
if (scale < 0) {
|
|
292
|
+
return `${unscaled.toString()}${'0'.repeat(-scale)}`;
|
|
293
|
+
}
|
|
294
|
+
if (
|
|
295
|
+
scale === 0 &&
|
|
296
|
+
unscaled >= BigInt(Number.MIN_SAFE_INTEGER) &&
|
|
297
|
+
unscaled <= BigInt(Number.MAX_SAFE_INTEGER)
|
|
298
|
+
) {
|
|
299
|
+
return Number(unscaled);
|
|
300
|
+
}
|
|
301
|
+
const sign = unscaled < 0n ? '-' : '';
|
|
302
|
+
const digits = (unscaled < 0n ? -unscaled : unscaled).toString().padStart(scale + 1, '0');
|
|
303
|
+
const split = digits.length - scale;
|
|
304
|
+
return `${sign}${digits.slice(0, split)}.${digits.slice(split)}`;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/** Validates an offset against the enclosing value boundary. */
|
|
308
|
+
function checkedEnd(offset: number, endOffset: number): number {
|
|
309
|
+
if (!Number.isSafeInteger(offset) || offset < 0 || offset > endOffset) {
|
|
310
|
+
throw new Error('parquet: truncated VARIANT value');
|
|
311
|
+
}
|
|
312
|
+
return offset;
|
|
313
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
const TEXT_DECODER = new TextDecoder();
|
|
6
|
+
const TEXT_ENCODER = new TextEncoder();
|
|
7
|
+
|
|
8
|
+
/** Returns bytes as an exact Uint8Array view. */
|
|
9
|
+
export function toUint8Array(binary: ArrayBuffer | ArrayBufferView): Uint8Array {
|
|
10
|
+
if (binary instanceof Uint8Array) {
|
|
11
|
+
return binary;
|
|
12
|
+
}
|
|
13
|
+
if (ArrayBuffer.isView(binary)) {
|
|
14
|
+
return new Uint8Array(binary.buffer, binary.byteOffset, binary.byteLength);
|
|
15
|
+
}
|
|
16
|
+
return new Uint8Array(binary);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Returns bytes as a copied ArrayBuffer with no extra prefix/suffix bytes. */
|
|
20
|
+
export function toArrayBuffer(binary: ArrayBuffer | ArrayBufferView): ArrayBuffer {
|
|
21
|
+
const bytes = toUint8Array(binary);
|
|
22
|
+
return bytes.slice().buffer;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Returns a copied Uint8Array. */
|
|
26
|
+
export function copyUint8Array(binary: Uint8Array): Uint8Array {
|
|
27
|
+
return binary.slice();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Decode UTF-8 bytes. */
|
|
31
|
+
export function decodeUtf8(binary: Uint8Array): string {
|
|
32
|
+
return TEXT_DECODER.decode(binary);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Encode text as UTF-8 bytes. */
|
|
36
|
+
export function encodeUtf8(text: string): Uint8Array {
|
|
37
|
+
return TEXT_ENCODER.encode(text);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Decode an ASCII/UTF-8 range from bytes. */
|
|
41
|
+
export function decodeString(
|
|
42
|
+
binary: Uint8Array,
|
|
43
|
+
start: number = 0,
|
|
44
|
+
end: number = binary.length
|
|
45
|
+
): string {
|
|
46
|
+
return decodeUtf8(binary.subarray(start, end));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getDataView(binary: Uint8Array): DataView {
|
|
50
|
+
return new DataView(binary.buffer, binary.byteOffset, binary.byteLength);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** Read signed little-endian 32-bit integer. */
|
|
54
|
+
export function readInt32LE(binary: Uint8Array, offset: number): number {
|
|
55
|
+
return getDataView(binary).getInt32(offset, true);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Read unsigned little-endian 32-bit integer. */
|
|
59
|
+
export function readUInt32LE(binary: Uint8Array, offset: number): number {
|
|
60
|
+
return getDataView(binary).getUint32(offset, true);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Read signed little-endian 64-bit integer without losing precision. */
|
|
64
|
+
export function readInt64LE(binary: Uint8Array, offset: number): bigint {
|
|
65
|
+
return getDataView(binary).getBigInt64(offset, true);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Read unsigned little-endian 64-bit integer without losing precision. */
|
|
69
|
+
export function readUInt64LE(binary: Uint8Array, offset: number): bigint {
|
|
70
|
+
return getDataView(binary).getBigUint64(offset, true);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Read little-endian 32-bit float. */
|
|
74
|
+
export function readFloatLE(binary: Uint8Array, offset: number): number {
|
|
75
|
+
return getDataView(binary).getFloat32(offset, true);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Read little-endian 64-bit float. */
|
|
79
|
+
export function readDoubleLE(binary: Uint8Array, offset: number): number {
|
|
80
|
+
return getDataView(binary).getFloat64(offset, true);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Concatenate bytes into one exact Uint8Array. */
|
|
84
|
+
export function concatUint8Arrays(chunks: Uint8Array[]): Uint8Array {
|
|
85
|
+
let byteLength = 0;
|
|
86
|
+
for (const chunk of chunks) {
|
|
87
|
+
byteLength += chunk.length;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const result = new Uint8Array(byteLength);
|
|
91
|
+
let offset = 0;
|
|
92
|
+
for (const chunk of chunks) {
|
|
93
|
+
result.set(chunk, offset);
|
|
94
|
+
offset += chunk.length;
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** Write signed little-endian 16-bit integer. */
|
|
100
|
+
export function writeInt16LE(binary: Uint8Array, value: number, offset: number): void {
|
|
101
|
+
getDataView(binary).setInt16(offset, value, true);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Write unsigned little-endian 16-bit integer. */
|
|
105
|
+
export function writeUInt16LE(binary: Uint8Array, value: number, offset: number): void {
|
|
106
|
+
getDataView(binary).setUint16(offset, value, true);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Write signed little-endian 32-bit integer. */
|
|
110
|
+
export function writeInt32LE(binary: Uint8Array, value: number, offset: number): void {
|
|
111
|
+
getDataView(binary).setInt32(offset, value, true);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** Write unsigned little-endian 32-bit integer. */
|
|
115
|
+
export function writeUInt32LE(binary: Uint8Array, value: number, offset: number): void {
|
|
116
|
+
getDataView(binary).setUint32(offset, value, true);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Write signed little-endian 64-bit integer. */
|
|
120
|
+
export function writeInt64LE(binary: Uint8Array, value: number | bigint, offset: number): void {
|
|
121
|
+
getDataView(binary).setBigInt64(offset, BigInt(value), true);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Write little-endian 32-bit float. */
|
|
125
|
+
export function writeFloatLE(binary: Uint8Array, value: number, offset: number): void {
|
|
126
|
+
getDataView(binary).setFloat32(offset, value, true);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Write little-endian 64-bit float. */
|
|
130
|
+
export function writeDoubleLE(binary: Uint8Array, value: number, offset: number): void {
|
|
131
|
+
getDataView(binary).setFloat64(offset, value, true);
|
|
132
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
/** Computes the IEEE CRC-32 checksum used by Parquet page headers. */
|
|
6
|
+
export function crc32(bytes: Uint8Array): number {
|
|
7
|
+
let checksum = 0xffffffff;
|
|
8
|
+
for (const byte of bytes) {
|
|
9
|
+
checksum ^= byte;
|
|
10
|
+
for (let bit = 0; bit < 8; bit++) {
|
|
11
|
+
checksum = (checksum >>> 1) ^ (0xedb88320 & -(checksum & 1));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return (checksum ^ 0xffffffff) >>> 0;
|
|
15
|
+
}
|
|
@@ -19,9 +19,9 @@ export interface WriteStreamOptions {
|
|
|
19
19
|
start?: number;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
export function oswrite(os: stream.Writable, buf:
|
|
22
|
+
export function oswrite(os: stream.Writable, buf: Uint8Array): Promise<void> {
|
|
23
23
|
return new Promise((resolve, reject) => {
|
|
24
|
-
os.write(buf,
|
|
24
|
+
os.write(buf, err => {
|
|
25
25
|
if (err) {
|
|
26
26
|
reject(err);
|
|
27
27
|
} else {
|
|
@@ -46,7 +46,7 @@ export function osclose(os: stream.Writable): Promise<void> {
|
|
|
46
46
|
export function osopen(path: string, opts?: WriteStreamOptions): Promise<fs.WriteStream> {
|
|
47
47
|
return new Promise((resolve, reject) => {
|
|
48
48
|
const outputStream = fs.createWriteStream(path, opts as any);
|
|
49
|
-
outputStream.once('open',
|
|
50
|
-
outputStream.once('error',
|
|
49
|
+
outputStream.once('open', _fd => resolve(outputStream));
|
|
50
|
+
outputStream.once('error', err => reject(err));
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -5,82 +5,103 @@
|
|
|
5
5
|
// Forked from https://github.com/kbajalc/parquets under MIT license
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
TFramedTransport,
|
|
8
|
+
ColumnMetaData,
|
|
9
|
+
FileCryptoMetaData,
|
|
11
10
|
FileMetaData,
|
|
12
11
|
PageHeader
|
|
13
12
|
} from '../parquet-thrift/index';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
13
|
+
import {Uint8ArrayCompactProtocol} from './uint8-array-compact-protocol';
|
|
14
|
+
import {Uint8ArrayCompactProtocolWriter} from './uint8-array-compact-protocol-writer';
|
|
15
|
+
import {Uint8ArrayTransport} from './uint8-array-transport';
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
* Helper function that serializes a thrift object into a buffer
|
|
21
19
|
*/
|
|
22
|
-
export function serializeThrift(obj: any):
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
output.push(buf as unknown as Buffer);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const protocol = new TCompactProtocol(transport);
|
|
30
|
-
obj.write(protocol);
|
|
31
|
-
transport.flush();
|
|
32
|
-
|
|
33
|
-
return Buffer.concat(output as Uint8Array[]);
|
|
20
|
+
export function serializeThrift(obj: any): Uint8Array {
|
|
21
|
+
const protocol = new Uint8ArrayCompactProtocolWriter();
|
|
22
|
+
obj.write(protocol as any);
|
|
23
|
+
return protocol.getBytes();
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
export function decodeThrift(obj: any, buf:
|
|
26
|
+
export function decodeThrift(obj: any, buf: Uint8Array, offset?: number) {
|
|
37
27
|
if (!offset) {
|
|
38
28
|
// tslint:disable-next-line:no-parameter-reassignment
|
|
39
29
|
offset = 0;
|
|
40
30
|
}
|
|
41
31
|
|
|
42
|
-
const transport = new
|
|
32
|
+
const transport = new Uint8ArrayTransport(buf);
|
|
43
33
|
transport.readPos = offset;
|
|
44
|
-
const protocol = new
|
|
34
|
+
const protocol = new Uint8ArrayCompactProtocol(transport);
|
|
45
35
|
obj.read(protocol);
|
|
46
36
|
return transport.readPos - offset;
|
|
47
37
|
}
|
|
48
38
|
|
|
49
39
|
/**
|
|
50
|
-
*
|
|
40
|
+
* Returns the generated TypeScript enum member for a Thrift value.
|
|
41
|
+
* @param thriftEnum generated numeric enum object
|
|
42
|
+
* @param value serialized enum value
|
|
43
|
+
* @returns enum member name
|
|
51
44
|
*/
|
|
52
|
-
export function getThriftEnum(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
export function getThriftEnum(thriftEnum: object, value: number | string): string {
|
|
46
|
+
const enumValues = thriftEnum as Record<string | number, number | string>;
|
|
47
|
+
if (typeof value === 'number') {
|
|
48
|
+
const enumName = enumValues[value];
|
|
49
|
+
if (typeof enumName === 'string') {
|
|
50
|
+
return enumName;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
for (const enumName in enumValues) {
|
|
55
|
+
if (enumValues[enumName] === value) {
|
|
56
|
+
return enumName;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
throw new Error('Invalid ENUM value');
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
export function decodeFileMetadata(buf:
|
|
62
|
+
export function decodeFileMetadata(buf: Uint8Array, offset?: number) {
|
|
62
63
|
if (!offset) {
|
|
63
64
|
// tslint:disable-next-line:no-parameter-reassignment
|
|
64
65
|
offset = 0;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
|
-
const transport = new
|
|
68
|
+
const transport = new Uint8ArrayTransport(buf);
|
|
69
|
+
transport.readPos = offset;
|
|
70
|
+
const protocol = new Uint8ArrayCompactProtocol(transport);
|
|
71
|
+
const metadata = FileMetaData.read(protocol as any);
|
|
72
|
+
return {length: transport.readPos - offset, metadata};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Decodes the FileCryptoMetaData prefix used by encrypted-footer files. */
|
|
76
|
+
export function decodeFileCryptoMetadata(buf: Uint8Array, offset?: number) {
|
|
77
|
+
if (!offset) offset = 0;
|
|
78
|
+
const transport = new Uint8ArrayTransport(buf);
|
|
79
|
+
transport.readPos = offset;
|
|
80
|
+
const protocol = new Uint8ArrayCompactProtocol(transport);
|
|
81
|
+
const metadata = FileCryptoMetaData.read(protocol as any);
|
|
82
|
+
return {length: transport.readPos - offset, metadata};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Decodes a serialized ColumnMetaData encryption module. */
|
|
86
|
+
export function decodeColumnMetadata(buf: Uint8Array, offset?: number) {
|
|
87
|
+
if (!offset) offset = 0;
|
|
88
|
+
const transport = new Uint8ArrayTransport(buf);
|
|
68
89
|
transport.readPos = offset;
|
|
69
|
-
const protocol = new
|
|
70
|
-
const metadata =
|
|
90
|
+
const protocol = new Uint8ArrayCompactProtocol(transport);
|
|
91
|
+
const metadata = ColumnMetaData.read(protocol as any);
|
|
71
92
|
return {length: transport.readPos - offset, metadata};
|
|
72
93
|
}
|
|
73
94
|
|
|
74
|
-
export function decodePageHeader(buf:
|
|
95
|
+
export function decodePageHeader(buf: Uint8Array, offset?: number) {
|
|
75
96
|
if (!offset) {
|
|
76
97
|
// tslint:disable-next-line:no-parameter-reassignment
|
|
77
98
|
offset = 0;
|
|
78
99
|
}
|
|
79
100
|
|
|
80
|
-
const transport = new
|
|
101
|
+
const transport = new Uint8ArrayTransport(buf);
|
|
81
102
|
transport.readPos = offset;
|
|
82
|
-
const protocol = new
|
|
83
|
-
const pageHeader = PageHeader.read(protocol);
|
|
103
|
+
const protocol = new Uint8ArrayCompactProtocol(transport);
|
|
104
|
+
const pageHeader = PageHeader.read(protocol as any);
|
|
84
105
|
return {length: transport.readPos - offset, pageHeader};
|
|
85
106
|
}
|
|
86
107
|
|
|
@@ -95,26 +116,31 @@ export function getBitWidth(val: number): number {
|
|
|
95
116
|
return Math.ceil(Math.log2(val + 1));
|
|
96
117
|
}
|
|
97
118
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Finds the selected field path that contains a Parquet leaf path.
|
|
121
|
+
* A selected parent includes all descendant leaves. MQTT-style `+` and `#` path wildcards are
|
|
122
|
+
* retained for internal callers (`+` matches one segment and `#` matches all remaining segments).
|
|
123
|
+
*/
|
|
101
124
|
export function fieldIndexOf(arr: string[][], elem: string[]): number {
|
|
102
|
-
for (let
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
continue; // eslint-disable-line no-continue
|
|
125
|
+
for (let fieldIndex = 0; fieldIndex < arr.length; fieldIndex++) {
|
|
126
|
+
const selectedPath = arr[fieldIndex];
|
|
127
|
+
let matches = true;
|
|
128
|
+
for (let pathIndex = 0; pathIndex < selectedPath.length; pathIndex++) {
|
|
129
|
+
const selectedSegment = selectedPath[pathIndex];
|
|
130
|
+
if (selectedSegment === '#') {
|
|
131
|
+
return fieldIndex;
|
|
110
132
|
}
|
|
111
|
-
if (
|
|
112
|
-
|
|
133
|
+
if (
|
|
134
|
+
pathIndex >= elem.length ||
|
|
135
|
+
(selectedSegment !== '+' && selectedSegment !== elem[pathIndex])
|
|
136
|
+
) {
|
|
137
|
+
matches = false;
|
|
138
|
+
break;
|
|
113
139
|
}
|
|
114
|
-
m = false;
|
|
115
|
-
break;
|
|
116
140
|
}
|
|
117
|
-
if (
|
|
141
|
+
if (matches) {
|
|
142
|
+
return fieldIndex;
|
|
143
|
+
}
|
|
118
144
|
}
|
|
119
145
|
return -1;
|
|
120
146
|
}
|