@loaders.gl/parquet 4.3.2 → 4.4.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +76 -286
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +6 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/lib/constants.js +1 -1
- package/dist/lib/encoders/encode-arrow-to-parquet.d.ts +7 -0
- package/dist/lib/encoders/encode-arrow-to-parquet.d.ts.map +1 -0
- package/dist/lib/encoders/{encode-parquet-wasm.js → encode-arrow-to-parquet.js} +1 -1
- package/dist/lib/parsers/get-parquet-schema.d.ts.map +1 -1
- package/dist/lib/parsers/get-parquet-schema.js +3 -3
- package/dist/lib/parsers/parse-geoparquet-to-geojson.d.ts +6 -0
- package/dist/lib/parsers/parse-geoparquet-to-geojson.d.ts.map +1 -0
- package/dist/lib/parsers/parse-geoparquet-to-geojson.js +15 -0
- package/dist/lib/parsers/{parse-parquet-wasm.d.ts → parse-parquet-to-arrow.d.ts} +3 -3
- package/dist/lib/parsers/parse-parquet-to-arrow.d.ts.map +1 -0
- package/dist/lib/parsers/{parse-parquet-wasm.js → parse-parquet-to-arrow.js} +8 -8
- package/dist/lib/parsers/parse-parquet-to-columns.d.ts +4 -4
- package/dist/lib/parsers/parse-parquet-to-columns.d.ts.map +1 -1
- package/dist/lib/parsers/parse-parquet-to-columns.js +1 -1
- package/dist/lib/parsers/{parse-parquet.d.ts → parse-parquet-to-json.d.ts} +4 -4
- package/dist/lib/parsers/parse-parquet-to-json.d.ts.map +1 -0
- package/dist/lib/parsers/{parse-parquet.js → parse-parquet-to-json.js} +2 -16
- package/dist/{parquet-wasm-loader.d.ts → parquet-arrow-loader.d.ts} +4 -6
- package/dist/parquet-arrow-loader.d.ts.map +1 -0
- package/dist/{parquet-wasm-loader.js → parquet-arrow-loader.js} +10 -11
- package/dist/parquet-arrow-writer.d.ts +9 -0
- package/dist/parquet-arrow-writer.d.ts.map +1 -0
- package/dist/{parquet-wasm-writer.js → parquet-arrow-writer.js} +6 -8
- package/dist/parquet-format.d.ts +9 -0
- package/dist/parquet-format.d.ts.map +1 -0
- package/dist/parquet-format.js +11 -0
- package/dist/{parquet-loader.d.ts → parquet-json-loader.d.ts} +57 -87
- package/dist/parquet-json-loader.d.ts.map +1 -0
- package/dist/{parquet-loader.js → parquet-json-loader.js} +42 -47
- package/dist/parquet-json-writer.d.ts +19 -0
- package/dist/parquet-json-writer.d.ts.map +1 -0
- package/dist/{parquet-writer.js → parquet-json-writer.js} +4 -6
- package/dist/parquetjs/codecs/declare.d.ts.map +1 -1
- package/dist/parquetjs/codecs/declare.js +5 -0
- package/dist/parquetjs/codecs/dictionary.d.ts.map +1 -1
- package/dist/parquetjs/codecs/dictionary.js +5 -0
- package/dist/parquetjs/codecs/index.d.ts.map +1 -1
- package/dist/parquetjs/codecs/index.js +5 -0
- package/dist/parquetjs/codecs/plain.d.ts.map +1 -1
- package/dist/parquetjs/codecs/plain.js +5 -0
- package/dist/parquetjs/codecs/rle.d.ts.map +1 -1
- package/dist/parquetjs/codecs/rle.js +5 -1
- package/dist/parquetjs/compression.d.ts.map +1 -1
- package/dist/parquetjs/compression.js +5 -2
- package/dist/parquetjs/encoder/parquet-encoder.d.ts.map +1 -1
- package/dist/parquetjs/encoder/parquet-encoder.js +5 -0
- package/dist/parquetjs/parquet-thrift/BoundaryOrder.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/BoundaryOrder.js +5 -0
- package/dist/parquetjs/parquet-thrift/BsonType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/BsonType.js +5 -0
- package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnChunk.js +5 -0
- package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnIndex.js +5 -0
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +5 -0
- package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ColumnOrder.js +5 -0
- package/dist/parquetjs/parquet-thrift/CompressionCodec.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/CompressionCodec.js +5 -0
- package/dist/parquetjs/parquet-thrift/ConvertedType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ConvertedType.js +5 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeader.js +5 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +5 -0
- package/dist/parquetjs/parquet-thrift/DateType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DateType.js +5 -0
- package/dist/parquetjs/parquet-thrift/DecimalType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DecimalType.js +5 -0
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +5 -0
- package/dist/parquetjs/parquet-thrift/Encoding.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/Encoding.js +5 -0
- package/dist/parquetjs/parquet-thrift/EnumType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/EnumType.js +5 -0
- package/dist/parquetjs/parquet-thrift/FieldRepetitionType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js +5 -0
- package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/FileMetaData.js +5 -0
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +5 -0
- package/dist/parquetjs/parquet-thrift/IntType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/IntType.js +5 -0
- package/dist/parquetjs/parquet-thrift/JsonType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/JsonType.js +5 -0
- package/dist/parquetjs/parquet-thrift/KeyValue.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/KeyValue.js +5 -0
- package/dist/parquetjs/parquet-thrift/ListType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/ListType.js +5 -0
- package/dist/parquetjs/parquet-thrift/LogicalType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/LogicalType.js +5 -0
- package/dist/parquetjs/parquet-thrift/MapType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MapType.js +5 -0
- package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MicroSeconds.js +5 -0
- package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/MilliSeconds.js +5 -0
- package/dist/parquetjs/parquet-thrift/NullType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/NullType.js +5 -0
- package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/OffsetIndex.js +5 -0
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +5 -0
- package/dist/parquetjs/parquet-thrift/PageHeader.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageHeader.js +5 -0
- package/dist/parquetjs/parquet-thrift/PageLocation.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageLocation.js +5 -0
- package/dist/parquetjs/parquet-thrift/PageType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/PageType.js +5 -0
- package/dist/parquetjs/parquet-thrift/RowGroup.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/RowGroup.js +5 -0
- package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/SchemaElement.js +5 -0
- package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/SortingColumn.js +5 -0
- package/dist/parquetjs/parquet-thrift/Statistics.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/Statistics.js +5 -0
- package/dist/parquetjs/parquet-thrift/StringType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/StringType.js +5 -0
- package/dist/parquetjs/parquet-thrift/TimeType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeType.js +5 -0
- package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimeUnit.js +5 -0
- package/dist/parquetjs/parquet-thrift/TimestampType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TimestampType.js +5 -0
- package/dist/parquetjs/parquet-thrift/Type.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/Type.js +5 -0
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +5 -0
- package/dist/parquetjs/parquet-thrift/UUIDType.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/UUIDType.js +5 -0
- package/dist/parquetjs/parquet-thrift/index.d.ts.map +1 -1
- package/dist/parquetjs/parquet-thrift/index.js +5 -0
- package/dist/parquetjs/parser/decoders.d.ts.map +1 -1
- package/dist/parquetjs/parser/decoders.js +5 -0
- package/dist/parquetjs/parser/parquet-reader.d.ts.map +1 -1
- package/dist/parquetjs/parser/parquet-reader.js +5 -0
- package/dist/parquetjs/schema/declare.d.ts.map +1 -1
- package/dist/parquetjs/schema/declare.js +5 -0
- package/dist/parquetjs/schema/schema.d.ts.map +1 -1
- package/dist/parquetjs/schema/schema.js +5 -1
- package/dist/parquetjs/schema/shred.d.ts.map +1 -1
- package/dist/parquetjs/schema/shred.js +5 -1
- package/dist/parquetjs/schema/types.d.ts.map +1 -1
- package/dist/parquetjs/schema/types.js +5 -1
- package/dist/parquetjs/utils/file-utils.d.ts.map +1 -1
- package/dist/parquetjs/utils/file-utils.js +5 -0
- package/dist/parquetjs/utils/read-utils.d.ts.map +1 -1
- package/dist/parquetjs/utils/read-utils.js +5 -0
- package/dist/polyfills/buffer/buffer.d.ts.map +1 -1
- package/dist/polyfills/buffer/buffer.js +0 -1
- package/dist/polyfills/buffer/index.d.ts.map +1 -1
- package/dist/polyfills/buffer/install-buffer-polyfill.d.ts.map +1 -1
- package/dist/polyfills/buffer/install-buffer-polyfill.js +3 -0
- package/dist/workers/parquet-json-worker.d.ts +2 -0
- package/dist/workers/parquet-json-worker.d.ts.map +1 -0
- package/dist/workers/{parquet-worker.js → parquet-json-worker.js} +2 -2
- package/package.json +13 -13
- package/src/index.ts +16 -9
- package/src/lib/encoders/{encode-parquet-wasm.ts → encode-arrow-to-parquet.ts} +4 -4
- package/src/lib/parsers/get-parquet-schema.ts +3 -3
- package/src/lib/parsers/parse-geoparquet-to-geojson.ts +36 -0
- package/src/lib/parsers/{parse-parquet-wasm.ts → parse-parquet-to-arrow.ts} +9 -9
- package/src/lib/parsers/parse-parquet-to-columns.ts +4 -4
- package/src/lib/parsers/{parse-parquet.ts → parse-parquet-to-json.ts} +5 -25
- package/src/{parquet-wasm-loader.ts → parquet-arrow-loader.ts} +18 -20
- package/src/parquet-arrow-writer.ts +33 -0
- package/src/parquet-format.ts +14 -0
- package/src/{parquet-loader.ts → parquet-json-loader.ts} +42 -48
- package/src/{parquet-writer.ts → parquet-json-writer.ts} +6 -8
- package/src/parquetjs/codecs/declare.ts +6 -1
- package/src/parquetjs/codecs/dictionary.ts +6 -0
- package/src/parquetjs/codecs/index.ts +6 -1
- package/src/parquetjs/codecs/plain.ts +6 -1
- package/src/parquetjs/codecs/rle.ts +5 -1
- package/src/parquetjs/compression.ts +5 -2
- package/src/parquetjs/encoder/parquet-encoder.ts +6 -1
- package/src/parquetjs/modules.d.ts +5 -1
- package/src/parquetjs/parquet-thrift/BoundaryOrder.ts +6 -0
- package/src/parquetjs/parquet-thrift/BsonType.ts +6 -0
- package/src/parquetjs/parquet-thrift/ColumnChunk.ts +6 -0
- package/src/parquetjs/parquet-thrift/ColumnIndex.ts +6 -0
- package/src/parquetjs/parquet-thrift/ColumnMetaData.ts +6 -0
- package/src/parquetjs/parquet-thrift/ColumnOrder.ts +6 -0
- package/src/parquetjs/parquet-thrift/CompressionCodec.ts +6 -0
- package/src/parquetjs/parquet-thrift/ConvertedType.ts +6 -0
- package/src/parquetjs/parquet-thrift/DataPageHeader.ts +6 -0
- package/src/parquetjs/parquet-thrift/DataPageHeaderV2.ts +6 -0
- package/src/parquetjs/parquet-thrift/DateType.ts +6 -0
- package/src/parquetjs/parquet-thrift/DecimalType.ts +6 -0
- package/src/parquetjs/parquet-thrift/DictionaryPageHeader.ts +6 -0
- package/src/parquetjs/parquet-thrift/Encoding.ts +6 -0
- package/src/parquetjs/parquet-thrift/EnumType.ts +6 -0
- package/src/parquetjs/parquet-thrift/FieldRepetitionType.ts +6 -0
- package/src/parquetjs/parquet-thrift/FileMetaData.ts +6 -0
- package/src/parquetjs/parquet-thrift/IndexPageHeader.ts +6 -0
- package/src/parquetjs/parquet-thrift/IntType.ts +6 -0
- package/src/parquetjs/parquet-thrift/JsonType.ts +6 -0
- package/src/parquetjs/parquet-thrift/KeyValue.ts +6 -0
- package/src/parquetjs/parquet-thrift/ListType.ts +6 -0
- package/src/parquetjs/parquet-thrift/LogicalType.ts +6 -0
- package/src/parquetjs/parquet-thrift/MapType.ts +6 -0
- package/src/parquetjs/parquet-thrift/MicroSeconds.ts +6 -0
- package/src/parquetjs/parquet-thrift/MilliSeconds.ts +6 -0
- package/src/parquetjs/parquet-thrift/NullType.ts +6 -0
- package/src/parquetjs/parquet-thrift/OffsetIndex.ts +6 -0
- package/src/parquetjs/parquet-thrift/PageEncodingStats.ts +6 -0
- package/src/parquetjs/parquet-thrift/PageHeader.ts +6 -0
- package/src/parquetjs/parquet-thrift/PageLocation.ts +6 -0
- package/src/parquetjs/parquet-thrift/PageType.ts +6 -0
- package/src/parquetjs/parquet-thrift/RowGroup.ts +6 -0
- package/src/parquetjs/parquet-thrift/SchemaElement.ts +6 -0
- package/src/parquetjs/parquet-thrift/SortingColumn.ts +6 -0
- package/src/parquetjs/parquet-thrift/Statistics.ts +6 -0
- package/src/parquetjs/parquet-thrift/StringType.ts +6 -0
- package/src/parquetjs/parquet-thrift/TimeType.ts +6 -0
- package/src/parquetjs/parquet-thrift/TimeUnit.ts +6 -0
- package/src/parquetjs/parquet-thrift/TimestampType.ts +6 -0
- package/src/parquetjs/parquet-thrift/Type.ts +6 -0
- package/src/parquetjs/parquet-thrift/TypeDefinedOrder.ts +6 -0
- package/src/parquetjs/parquet-thrift/UUIDType.ts +6 -0
- package/src/parquetjs/parquet-thrift/index.ts +6 -0
- package/src/parquetjs/parser/decoders.ts +6 -1
- package/src/parquetjs/parser/parquet-reader.ts +6 -1
- package/src/parquetjs/schema/declare.ts +6 -1
- package/src/parquetjs/schema/schema.ts +5 -1
- package/src/parquetjs/schema/shred.ts +5 -1
- package/src/parquetjs/schema/types.ts +6 -1
- package/src/parquetjs/utils/file-utils.ts +6 -1
- package/src/parquetjs/utils/read-utils.ts +6 -0
- package/src/polyfills/buffer/buffer.ts +0 -1
- package/src/polyfills/buffer/index.ts +1 -0
- package/src/polyfills/buffer/install-buffer-polyfill.ts +4 -0
- package/src/workers/{parquet-worker.ts → parquet-json-worker.ts} +2 -2
- package/dist/lib/encoders/encode-parquet-wasm.d.ts +0 -7
- package/dist/lib/encoders/encode-parquet-wasm.d.ts.map +0 -1
- package/dist/lib/parsers/parse-geoparquet.d.ts +0 -6
- package/dist/lib/parsers/parse-geoparquet.d.ts.map +0 -1
- package/dist/lib/parsers/parse-geoparquet.js +0 -58
- package/dist/lib/parsers/parse-parquet-wasm.d.ts.map +0 -1
- package/dist/lib/parsers/parse-parquet.d.ts.map +0 -1
- package/dist/parquet-loader.d.ts.map +0 -1
- package/dist/parquet-wasm-loader.d.ts.map +0 -1
- package/dist/parquet-wasm-writer.d.ts +0 -9
- package/dist/parquet-wasm-writer.d.ts.map +0 -1
- package/dist/parquet-writer.d.ts +0 -17
- package/dist/parquet-writer.d.ts.map +0 -1
- package/dist/workers/parquet-worker.d.ts +0 -2
- package/dist/workers/parquet-worker.d.ts.map +0 -1
- package/src/lib/parsers/parse-geoparquet.ts +0 -88
- package/src/parquet-wasm-writer.ts +0 -35
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export { Buffer } from "./polyfills/buffer/install-buffer-polyfill.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
2
|
+
export { ParquetFormat } from "./parquet-format.js";
|
|
3
|
+
export { ParquetJSONWorkerLoader, ParquetJSONLoader, GeoParquetWorkerLoader, GeoParquetLoader, ParquetJSONWorkerLoader as ParquetWorkerLoader, ParquetJSONLoader as ParquetLoader } from "./parquet-json-loader.js";
|
|
4
|
+
export { ParquetJSONWriter as _ParquetJSONWriter, ParquetJSONWriter as ParquetWriter } from "./parquet-json-writer.js";
|
|
5
|
+
export type { ParquetArrowLoaderOptions } from "./parquet-arrow-loader.js";
|
|
6
|
+
export { ParquetArrowLoader, ParquetArrowWorkerLoader } from "./parquet-arrow-loader.js";
|
|
7
|
+
export { ParquetArrowWriter } from "./parquet-arrow-writer.js";
|
|
7
8
|
export { preloadCompressions } from "./parquetjs/compression.js";
|
|
8
9
|
export { ParquetSchema } from "./parquetjs/schema/schema.js";
|
|
9
10
|
export { ParquetReader } from "./parquetjs/parser/parquet-reader.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,sDAAmD;AAIlE,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,sDAAmD;AAIlE,OAAO,EAAC,aAAa,EAAC,4BAAyB;AAE/C,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAEhB,uBAAuB,IAAI,mBAAmB,EAC9C,iBAAiB,IAAI,aAAa,EACnC,iCAA8B;AAE/B,OAAO,EACL,iBAAiB,IAAI,kBAAkB,EAEvC,iBAAiB,IAAI,aAAa,EACnC,iCAA8B;AAI/B,YAAY,EAAC,yBAAyB,EAAC,kCAA+B;AACtE,OAAO,EAAC,kBAAkB,EAAE,wBAAwB,EAAC,kCAA+B;AACpF,OAAO,EAAC,kBAAkB,EAAC,kCAA+B;AAI1D,OAAO,EAAC,mBAAmB,EAAC,mCAAgC;AAE5D,OAAO,EAAC,aAAa,EAAC,qCAAkC;AACxD,OAAO,EAAC,aAAa,EAAC,6CAA0C;AAChE,OAAO,EAAC,cAAc,EAAC,+CAA4C;AAEnE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,IAAI,2BAA2B,EACpD,mDAAgD;AAGjD,OAAO,EAAC,cAAc,EAAE,qBAAqB,EAAC,oCAAiC"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
export { Buffer } from "./polyfills/buffer/install-buffer-polyfill.js";
|
|
5
5
|
// import {ArrowTable, ArrowTableBatch} from '@loaders.gl/arrow';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export { ParquetFormat } from "./parquet-format.js";
|
|
7
|
+
export { ParquetJSONWorkerLoader, ParquetJSONLoader, GeoParquetWorkerLoader, GeoParquetLoader,
|
|
8
|
+
// deprecated
|
|
9
|
+
ParquetJSONWorkerLoader as ParquetWorkerLoader, ParquetJSONLoader as ParquetLoader } from "./parquet-json-loader.js";
|
|
10
|
+
export { ParquetJSONWriter as _ParquetJSONWriter,
|
|
11
|
+
// deprecated
|
|
12
|
+
ParquetJSONWriter as ParquetWriter } from "./parquet-json-writer.js";
|
|
13
|
+
export { ParquetArrowLoader, ParquetArrowWorkerLoader } from "./parquet-arrow-loader.js";
|
|
14
|
+
export { ParquetArrowWriter } from "./parquet-arrow-writer.js";
|
|
10
15
|
// EXPERIMENTAL - expose the internal parquetjs API
|
|
11
16
|
export { preloadCompressions } from "./parquetjs/compression.js";
|
|
12
17
|
export { ParquetSchema } from "./parquetjs/schema/schema.js";
|
package/dist/lib/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
5
5
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
6
|
-
export const VERSION = typeof "4.
|
|
6
|
+
export const VERSION = typeof "4.4.0-alpha.1" !== 'undefined' ? "4.4.0-alpha.1" : 'latest';
|
|
7
7
|
export const PARQUET_WASM_URL = 'https://unpkg.com/parquet-wasm@0.6.1/esm/parquet_wasm_bg.wasm';
|
|
8
8
|
/**
|
|
9
9
|
* Parquet File Magic String
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ArrowTable } from '@loaders.gl/schema';
|
|
2
|
+
import type { ParquetArrowWriterOptions } from "../../parquet-arrow-writer.js";
|
|
3
|
+
/**
|
|
4
|
+
* Encode Arrow arrow.Table to Parquet buffer
|
|
5
|
+
*/
|
|
6
|
+
export declare function encodeArrowToParquet(table: ArrowTable, options: ParquetArrowWriterOptions): Promise<ArrayBuffer>;
|
|
7
|
+
//# sourceMappingURL=encode-arrow-to-parquet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encode-arrow-to-parquet.d.ts","sourceRoot":"","sources":["../../../src/lib/encoders/encode-arrow-to-parquet.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAKnD,OAAO,KAAK,EAAC,yBAAyB,EAAC,sCAAmC;AAE1E;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,WAAW,CAAC,CAsBtB"}
|
|
@@ -6,7 +6,7 @@ import { loadWasm } from "../utils/load-wasm.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Encode Arrow arrow.Table to Parquet buffer
|
|
8
8
|
*/
|
|
9
|
-
export async function
|
|
9
|
+
export async function encodeArrowToParquet(table, options) {
|
|
10
10
|
const wasmUrl = options.parquet?.wasmUrl;
|
|
11
11
|
const wasm = await loadWasm(wasmUrl);
|
|
12
12
|
// Serialize the table to the IPC format.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-parquet-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/get-parquet-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"get-parquet-schema.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/get-parquet-schema.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAC,aAAa,EAAC,iDAA8C;AAGpE,wBAAsB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAOvF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { unpackGeoMetadata, unpackJSONStringMetadata } from '@loaders.gl/geoarrow';
|
|
4
5
|
import { convertParquetSchema } from "../arrow/convert-schema-from-parquet.js";
|
|
5
|
-
import { unpackGeoMetadata, unpackJSONStringMetadata } from '@loaders.gl/gis';
|
|
6
6
|
export async function getSchemaFromParquetReader(reader) {
|
|
7
7
|
const parquetSchema = await reader.getSchema();
|
|
8
8
|
const parquetMetadata = await reader.getFileMetadata();
|
|
9
9
|
const schema = convertParquetSchema(parquetSchema, parquetMetadata);
|
|
10
|
-
unpackGeoMetadata(schema);
|
|
11
|
-
unpackJSONStringMetadata(schema, 'pandas');
|
|
10
|
+
unpackGeoMetadata(schema.metadata);
|
|
11
|
+
unpackJSONStringMetadata(schema.metadata, 'pandas');
|
|
12
12
|
return schema;
|
|
13
13
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReadableFile } from '@loaders.gl/loader-utils';
|
|
2
|
+
import type { GeoJSONTable, GeoJSONTableBatch, ObjectRowTable, ObjectRowTableBatch } from '@loaders.gl/schema';
|
|
3
|
+
import type { ParquetJSONLoaderOptions } from "../../parquet-json-loader.js";
|
|
4
|
+
export declare function parseGeoParquetFile(file: ReadableFile, options?: ParquetJSONLoaderOptions): Promise<ObjectRowTable | GeoJSONTable>;
|
|
5
|
+
export declare function parseGeoParquetFileInBatches(file: ReadableFile, options?: ParquetJSONLoaderOptions): AsyncIterable<ObjectRowTableBatch | GeoJSONTableBatch>;
|
|
6
|
+
//# sourceMappingURL=parse-geoparquet-to-geojson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-geoparquet-to-geojson.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-geoparquet-to-geojson.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAC,wBAAwB,EAAC,qCAAkC;AAIxE,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,cAAc,GAAG,YAAY,CAAC,CAIxC;AAED,wBAAuB,4BAA4B,CACjD,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAAC,mBAAmB,GAAG,iBAAiB,CAAC,CAMxD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { parseParquetFile, parseParquetFileInBatches } from "./parse-parquet-to-json.js";
|
|
5
|
+
export async function parseGeoParquetFile(file, options) {
|
|
6
|
+
const table = await parseParquetFile(file, { ...options, shape: 'object-row-table' });
|
|
7
|
+
// return convertGeoArrowToTable(table, 'geojson-table');
|
|
8
|
+
return table;
|
|
9
|
+
}
|
|
10
|
+
export async function* parseGeoParquetFileInBatches(file, options) {
|
|
11
|
+
const tableBatches = parseParquetFileInBatches(file, { ...options, shape: 'object-row-table' });
|
|
12
|
+
for await (const batch of tableBatches) {
|
|
13
|
+
yield batch; // convertGeoArrowToTable(batch, 'geojson-table');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReadableFile } from '@loaders.gl/loader-utils';
|
|
2
2
|
import type { ArrowTable, ArrowTableBatch } from '@loaders.gl/schema';
|
|
3
3
|
import type * as parquetWasm from 'parquet-wasm';
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function parseParquetFileToArrow(file: ReadableFile, options?: parquetWasm.ReaderOptions & {
|
|
5
5
|
wasmUrl: string;
|
|
6
6
|
}): Promise<ArrowTable>;
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function parseParquetFileToArrowInBatches(file: ReadableFile, options: parquetWasm.ReaderOptions & {
|
|
8
8
|
wasmUrl: string;
|
|
9
9
|
}): AsyncIterable<ArrowTableBatch>;
|
|
10
|
-
//# sourceMappingURL=parse-parquet-
|
|
10
|
+
//# sourceMappingURL=parse-parquet-to-arrow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-parquet-to-arrow.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-parquet-to-arrow.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAS,MAAM,oBAAoB,CAAC;AAG5E,OAAO,KAAK,KAAK,WAAW,MAAM,cAAc,CAAC;AAMjD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,WAAW,CAAC,aAAa,GAAG;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GACtD,OAAO,CAAC,UAAU,CAAC,CAsBrB;AAED,wBAAuB,gCAAgC,CACrD,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,WAAW,CAAC,aAAa,GAAG;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GACrD,aAAa,CAAC,eAAe,CAAC,CA0BhC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { convertArrowToSchema } from '@loaders.gl/schema-utils';
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import { loadWasm } from "../utils/load-wasm.js";
|
|
7
7
|
import { makeStreamIterator } from "../utils/make-stream-iterator.js";
|
|
8
|
-
export async function
|
|
8
|
+
export async function parseParquetFileToArrow(file, options) {
|
|
9
9
|
const wasmUrl = options?.wasmUrl;
|
|
10
10
|
const wasm = await loadWasm(wasmUrl);
|
|
11
11
|
let parquetFile;
|
|
@@ -21,11 +21,11 @@ export async function parseParquetFileWasm(file, options) {
|
|
|
21
21
|
const arrowTable = arrow.tableFromIPC(ipcStream);
|
|
22
22
|
return {
|
|
23
23
|
shape: 'arrow-table',
|
|
24
|
-
schema:
|
|
24
|
+
schema: convertArrowToSchema(arrowTable.schema),
|
|
25
25
|
data: arrowTable
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
export async function*
|
|
28
|
+
export async function* parseParquetFileToArrowInBatches(file, options) {
|
|
29
29
|
const wasmUrl = options?.wasmUrl;
|
|
30
30
|
const wasm = await loadWasm(wasmUrl);
|
|
31
31
|
let parquetFile;
|
|
@@ -38,14 +38,14 @@ export async function* parseParquetFileInBatchesWasm(file, options) {
|
|
|
38
38
|
}
|
|
39
39
|
const stream = await parquetFile.stream(options);
|
|
40
40
|
let schema;
|
|
41
|
-
for await (const
|
|
42
|
-
schema ||=
|
|
41
|
+
for await (const recordBatch of makeStreamIterator(stream)) {
|
|
42
|
+
schema ||= convertArrowToSchema(recordBatch.schema);
|
|
43
43
|
yield {
|
|
44
44
|
batchType: 'data',
|
|
45
45
|
shape: 'arrow-table',
|
|
46
46
|
schema,
|
|
47
|
-
data:
|
|
48
|
-
length:
|
|
47
|
+
data: new arrow.Table(recordBatch),
|
|
48
|
+
length: recordBatch.numRows
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ColumnarTable, ColumnarTableBatch } from '@loaders.gl/schema';
|
|
2
2
|
import type { ReadableFile } from '@loaders.gl/loader-utils';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ParquetJSONLoaderOptions } from "../../parquet-json-loader.js";
|
|
4
4
|
/**
|
|
5
|
-
* @deprecated
|
|
5
|
+
* @deprecated - Use parseParquetToArrow
|
|
6
6
|
*/
|
|
7
|
-
export declare function parseParquetFileInColumns(file: ReadableFile, options?:
|
|
7
|
+
export declare function parseParquetFileInColumns(file: ReadableFile, options?: ParquetJSONLoaderOptions): Promise<ColumnarTable>;
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated
|
|
10
10
|
*/
|
|
11
|
-
export declare function parseParquetFileInColumnarBatches(file: ReadableFile, options?:
|
|
11
|
+
export declare function parseParquetFileInColumnarBatches(file: ReadableFile, options?: ParquetJSONLoaderOptions): AsyncIterable<ColumnarTableBatch>;
|
|
12
12
|
//# sourceMappingURL=parse-parquet-to-columns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-parquet-to-columns.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-parquet-to-columns.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAS,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"parse-parquet-to-columns.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-parquet-to-columns.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAS,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,wBAAwB,EAAC,qCAAkC;AASxE;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,aAAa,CAAC,CAYxB;AAED;;GAEG;AACH,wBAAuB,iCAAiC,CACtD,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAAC,kBAAkB,CAAC,CAgBnC"}
|
|
@@ -7,7 +7,7 @@ import { getSchemaFromParquetReader } from "./get-parquet-schema.js";
|
|
|
7
7
|
import { installBufferPolyfill } from "../../polyfills/buffer/index.js";
|
|
8
8
|
import { preloadCompressions } from "../../parquetjs/compression.js";
|
|
9
9
|
/**
|
|
10
|
-
* @deprecated
|
|
10
|
+
* @deprecated - Use parseParquetToArrow
|
|
11
11
|
*/
|
|
12
12
|
export async function parseParquetFileInColumns(file, options) {
|
|
13
13
|
installBufferPolyfill();
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import type { ReadableFile } from '@loaders.gl/loader-utils';
|
|
2
2
|
import type { ObjectRowTable, ObjectRowTableBatch } from '@loaders.gl/schema';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ParquetJSONLoaderOptions } from "../../parquet-json-loader.js";
|
|
4
4
|
/**
|
|
5
5
|
* * Parse a parquet file using parquetjs
|
|
6
6
|
* @param file
|
|
7
7
|
* @param options
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
export declare function parseParquetFile(file: ReadableFile, options?:
|
|
10
|
+
export declare function parseParquetFile(file: ReadableFile, options?: ParquetJSONLoaderOptions): Promise<ObjectRowTable>;
|
|
11
11
|
/**
|
|
12
12
|
* Parse a parquet file in batches using parquetjs
|
|
13
13
|
* @param file
|
|
14
14
|
* @param options
|
|
15
15
|
*/
|
|
16
|
-
export declare function parseParquetFileInBatches(file: ReadableFile, options?:
|
|
17
|
-
//# sourceMappingURL=parse-parquet.d.ts.map
|
|
16
|
+
export declare function parseParquetFileInBatches(file: ReadableFile, options?: ParquetJSONLoaderOptions): AsyncIterable<ObjectRowTableBatch>;
|
|
17
|
+
//# sourceMappingURL=parse-parquet-to-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-parquet-to-json.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-parquet-to-json.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAC,cAAc,EAAE,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AAE5E,OAAO,KAAK,EAAC,wBAAwB,EAAC,qCAAkC;AAOxE;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,cAAc,CAAC,CAmCzB;AAED;;;;GAIG;AACH,wBAAuB,yBAAyB,CAC9C,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,aAAa,CAAC,mBAAmB,CAAC,CAwBpC"}
|
|
@@ -41,8 +41,7 @@ export async function parseParquetFile(file, options) {
|
|
|
41
41
|
schema,
|
|
42
42
|
data: rows
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
return convertTable(objectRowTable, shape);
|
|
44
|
+
return objectRowTable;
|
|
46
45
|
}
|
|
47
46
|
/**
|
|
48
47
|
* Parse a parquet file in batches using parquetjs
|
|
@@ -63,24 +62,11 @@ export async function* parseParquetFileInBatches(file, options) {
|
|
|
63
62
|
schema,
|
|
64
63
|
data: rows
|
|
65
64
|
};
|
|
66
|
-
const shape = options?.parquet?.shape;
|
|
67
|
-
const table = convertTable(objectRowTable, shape);
|
|
68
65
|
yield {
|
|
69
66
|
batchType: 'data',
|
|
70
67
|
schema,
|
|
71
|
-
...
|
|
68
|
+
...objectRowTable,
|
|
72
69
|
length: rows.length
|
|
73
70
|
};
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
|
-
function convertTable(objectRowTable, shape) {
|
|
77
|
-
switch (shape) {
|
|
78
|
-
case 'object-row-table':
|
|
79
|
-
return objectRowTable;
|
|
80
|
-
// Hack until geoparquet fixes up forwarded shape
|
|
81
|
-
case 'geojson-table':
|
|
82
|
-
return objectRowTable;
|
|
83
|
-
default:
|
|
84
|
-
throw new Error(shape);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ArrowTable, ArrowTableBatch } from '@loaders.gl/schema';
|
|
2
2
|
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
3
3
|
/** Parquet WASM loader options */
|
|
4
|
-
export type
|
|
4
|
+
export type ParquetArrowLoaderOptions = LoaderOptions & {
|
|
5
5
|
parquet?: {
|
|
6
|
-
shape?: 'arrow-table';
|
|
7
6
|
limit?: number;
|
|
8
7
|
offset?: number;
|
|
9
8
|
batchSize?: number;
|
|
@@ -14,7 +13,7 @@ export type ParquetWasmLoaderOptions = LoaderOptions & {
|
|
|
14
13
|
};
|
|
15
14
|
};
|
|
16
15
|
/** Parquet WASM table loader */
|
|
17
|
-
export declare const
|
|
16
|
+
export declare const ParquetArrowWorkerLoader: {
|
|
18
17
|
readonly dataType: ArrowTable;
|
|
19
18
|
readonly batchType: ArrowTableBatch;
|
|
20
19
|
readonly name: "Apache Parquet";
|
|
@@ -29,7 +28,6 @@ export declare const ParquetWasmWorkerLoader: {
|
|
|
29
28
|
readonly tests: ["PAR1", "PARE"];
|
|
30
29
|
readonly options: {
|
|
31
30
|
readonly parquet: {
|
|
32
|
-
readonly shape: "arrow-table";
|
|
33
31
|
readonly limit: undefined;
|
|
34
32
|
readonly offset: 0;
|
|
35
33
|
readonly batchSize: undefined;
|
|
@@ -41,5 +39,5 @@ export declare const ParquetWasmWorkerLoader: {
|
|
|
41
39
|
};
|
|
42
40
|
};
|
|
43
41
|
/** Parquet WASM table loader */
|
|
44
|
-
export declare const
|
|
45
|
-
//# sourceMappingURL=parquet-
|
|
42
|
+
export declare const ParquetArrowLoader: any;
|
|
43
|
+
//# sourceMappingURL=parquet-arrow-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet-arrow-loader.d.ts","sourceRoot":"","sources":["../src/parquet-arrow-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAA2B,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAStF,kCAAkC;AAClC,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG;IACtD,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,gCAAgC;AAChC,eAAO,MAAM,wBAAwB;uBACN,UAAU;wBACT,eAAe;;;;;;;;;;;;;;;;;;;;;;CAuBoC,CAAC;AAEpF,gCAAgC;AAChC,eAAO,MAAM,kBAAkB,KAiB8D,CAAC"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { BlobFile } from '@loaders.gl/loader-utils';
|
|
5
|
-
import {
|
|
5
|
+
import { parseParquetFileToArrow, parseParquetFileToArrowInBatches } from "./lib/parsers/parse-parquet-to-arrow.js";
|
|
6
6
|
import { VERSION, PARQUET_WASM_URL } from "./lib/constants.js";
|
|
7
7
|
/** Parquet WASM table loader */
|
|
8
|
-
export const
|
|
8
|
+
export const ParquetArrowWorkerLoader = {
|
|
9
9
|
dataType: null,
|
|
10
10
|
batchType: null,
|
|
11
11
|
name: 'Apache Parquet',
|
|
@@ -20,7 +20,6 @@ export const ParquetWasmWorkerLoader = {
|
|
|
20
20
|
tests: ['PAR1', 'PARE'],
|
|
21
21
|
options: {
|
|
22
22
|
parquet: {
|
|
23
|
-
shape: 'arrow-table',
|
|
24
23
|
limit: undefined, // Provide a limit to the number of rows to be read.
|
|
25
24
|
offset: 0, // Provide an offset to skip over the given number of rows.
|
|
26
25
|
batchSize: undefined, // The number of rows in each batch. If not provided, the upstream parquet default is 1024.
|
|
@@ -32,18 +31,18 @@ export const ParquetWasmWorkerLoader = {
|
|
|
32
31
|
}
|
|
33
32
|
};
|
|
34
33
|
/** Parquet WASM table loader */
|
|
35
|
-
export const
|
|
36
|
-
...
|
|
34
|
+
export const ParquetArrowLoader = {
|
|
35
|
+
...ParquetArrowWorkerLoader,
|
|
37
36
|
parse(arrayBuffer, options) {
|
|
38
|
-
const wasmOptions = { ...
|
|
39
|
-
return
|
|
37
|
+
const wasmOptions = { ...ParquetArrowLoader.options.parquet, ...options?.parquet };
|
|
38
|
+
return parseParquetFileToArrow(new BlobFile(arrayBuffer), wasmOptions);
|
|
40
39
|
},
|
|
41
40
|
parseFile(file, options) {
|
|
42
|
-
const wasmOptions = { ...
|
|
43
|
-
return
|
|
41
|
+
const wasmOptions = { ...ParquetArrowLoader.options.parquet, ...options?.parquet };
|
|
42
|
+
return parseParquetFileToArrow(file, wasmOptions);
|
|
44
43
|
},
|
|
45
44
|
parseFileInBatches(file, options) {
|
|
46
|
-
const wasmOptions = { ...
|
|
47
|
-
return
|
|
45
|
+
const wasmOptions = { ...ParquetArrowLoader.options.parquet, ...options?.parquet };
|
|
46
|
+
return parseParquetFileToArrowInBatches(file, wasmOptions);
|
|
48
47
|
}
|
|
49
48
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WriterOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
export type ParquetArrowWriterOptions = WriterOptions & {
|
|
3
|
+
parquet?: {
|
|
4
|
+
wasmUrl?: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
/** Parquet WASM writer */
|
|
8
|
+
export declare const ParquetArrowWriter: any;
|
|
9
|
+
//# sourceMappingURL=parquet-arrow-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet-arrow-writer.d.ts","sourceRoot":"","sources":["../src/parquet-arrow-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAO/E,MAAM,MAAM,yBAAyB,GAAG,aAAa,GAAG;IACtD,OAAO,CAAC,EAAE;QACR,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,kBAAkB,KAcqD,CAAC"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { encodeArrowToParquet } from "./lib/encoders/encode-arrow-to-parquet.js";
|
|
5
|
+
import { ParquetFormat } from "./parquet-format.js";
|
|
5
6
|
import { VERSION, PARQUET_WASM_URL } from "./lib/constants.js";
|
|
6
7
|
/** Parquet WASM writer */
|
|
7
|
-
export const
|
|
8
|
-
|
|
8
|
+
export const ParquetArrowWriter = {
|
|
9
|
+
...ParquetFormat,
|
|
9
10
|
id: 'parquet-wasm',
|
|
10
11
|
module: 'parquet',
|
|
11
12
|
version: VERSION,
|
|
12
|
-
extensions: ['parquet'],
|
|
13
|
-
mimeTypes: ['application/octet-stream'],
|
|
14
|
-
binary: true,
|
|
15
13
|
options: {
|
|
16
14
|
parquet: {
|
|
17
15
|
wasmUrl: PARQUET_WASM_URL
|
|
18
16
|
}
|
|
19
17
|
},
|
|
20
18
|
encode(arrowTable, options) {
|
|
21
|
-
options = { parquet: { ...
|
|
22
|
-
return
|
|
19
|
+
options = { parquet: { ...ParquetArrowWriter.options.parquet, ...options?.parquet }, ...options };
|
|
20
|
+
return encodeArrowToParquet(arrowTable, options);
|
|
23
21
|
}
|
|
24
22
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const ParquetFormat: {
|
|
2
|
+
readonly name: "Apache Parquet";
|
|
3
|
+
readonly category: "table";
|
|
4
|
+
readonly extensions: ["parquet"];
|
|
5
|
+
readonly mimeTypes: ["application/octet-stream"];
|
|
6
|
+
readonly binary: true;
|
|
7
|
+
readonly tests: ["PAR1", "PARE"];
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=parquet-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet-format.d.ts","sourceRoot":"","sources":["../src/parquet-format.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa;;;;;;;CAOU,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
export const ParquetFormat = {
|
|
5
|
+
name: 'Apache Parquet',
|
|
6
|
+
category: 'table',
|
|
7
|
+
extensions: ['parquet'],
|
|
8
|
+
mimeTypes: ['application/octet-stream'],
|
|
9
|
+
binary: true,
|
|
10
|
+
tests: ['PAR1', 'PARE']
|
|
11
|
+
};
|