@loaders.gl/parquet 3.1.0-alpha.4 → 3.1.0-beta.3
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/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +5 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +18 -0
- package/dist/dist.min.js +27 -13
- package/dist/dist.min.js.map +7 -1
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/constants.js +5 -5
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/index.js +16 -45
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/lib/convert-schema.js +13 -13
- package/dist/es5/lib/convert-schema.js.map +1 -1
- package/dist/es5/lib/parse-parquet.js +19 -154
- package/dist/es5/lib/parse-parquet.js.map +1 -1
- package/dist/es5/lib/read-array-buffer.js +6 -43
- package/dist/es5/lib/read-array-buffer.js.map +1 -1
- package/dist/es5/parquet-loader.js +4 -4
- package/dist/es5/parquet-loader.js.map +1 -1
- package/dist/es5/parquet-writer.js +4 -4
- package/dist/es5/parquet-writer.js.map +1 -1
- package/dist/es5/parquetjs/codecs/dictionary.js +2 -10
- package/dist/es5/parquetjs/codecs/dictionary.js.map +1 -1
- package/dist/es5/parquetjs/codecs/index.js +4 -6
- package/dist/es5/parquetjs/codecs/index.js.map +1 -1
- package/dist/es5/parquetjs/codecs/plain.js +41 -43
- package/dist/es5/parquetjs/codecs/plain.js.map +1 -1
- package/dist/es5/parquetjs/codecs/rle.js +25 -35
- package/dist/es5/parquetjs/codecs/rle.js.map +1 -1
- package/dist/es5/parquetjs/compression.js +28 -122
- package/dist/es5/parquetjs/compression.js.map +1 -1
- package/dist/es5/parquetjs/encoder/writer.js +301 -737
- package/dist/es5/parquetjs/encoder/writer.js.map +1 -1
- package/dist/es5/parquetjs/file.js +15 -15
- package/dist/es5/parquetjs/file.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/BoundaryOrder.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/BsonType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/BsonType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnChunk.js +141 -152
- package/dist/es5/parquetjs/parquet-thrift/ColumnChunk.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnIndex.js +147 -160
- package/dist/es5/parquetjs/parquet-thrift/ColumnIndex.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnMetaData.js +248 -259
- package/dist/es5/parquetjs/parquet-thrift/ColumnMetaData.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnOrder.js +67 -79
- package/dist/es5/parquetjs/parquet-thrift/ColumnOrder.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/CompressionCodec.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ConvertedType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeader.js +113 -124
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeaderV2.js +158 -169
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeaderV2.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DateType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/DateType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DecimalType.js +68 -79
- package/dist/es5/parquetjs/parquet-thrift/DecimalType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DictionaryPageHeader.js +83 -94
- package/dist/es5/parquetjs/parquet-thrift/DictionaryPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Encoding.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/EnumType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/EnumType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/FieldRepetitionType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/FileMetaData.js +170 -182
- package/dist/es5/parquetjs/parquet-thrift/FileMetaData.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/IndexPageHeader.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/IndexPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/IntType.js +68 -79
- package/dist/es5/parquetjs/parquet-thrift/IntType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/JsonType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/JsonType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/KeyValue.js +68 -79
- package/dist/es5/parquetjs/parquet-thrift/KeyValue.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ListType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/ListType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/LogicalType.js +319 -343
- package/dist/es5/parquetjs/parquet-thrift/LogicalType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MapType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/MapType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MicroSeconds.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/MicroSeconds.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MilliSeconds.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/MilliSeconds.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/NullType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/NullType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/OffsetIndex.js +64 -75
- package/dist/es5/parquetjs/parquet-thrift/OffsetIndex.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageEncodingStats.js +83 -94
- package/dist/es5/parquetjs/parquet-thrift/PageEncodingStats.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageHeader.js +158 -169
- package/dist/es5/parquetjs/parquet-thrift/PageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageLocation.js +83 -94
- package/dist/es5/parquetjs/parquet-thrift/PageLocation.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/RowGroup.js +113 -124
- package/dist/es5/parquetjs/parquet-thrift/RowGroup.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/SchemaElement.js +188 -199
- package/dist/es5/parquetjs/parquet-thrift/SchemaElement.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/SortingColumn.js +83 -94
- package/dist/es5/parquetjs/parquet-thrift/SortingColumn.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Statistics.js +124 -135
- package/dist/es5/parquetjs/parquet-thrift/Statistics.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/StringType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/StringType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimeType.js +68 -79
- package/dist/es5/parquetjs/parquet-thrift/TimeType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimeUnit.js +88 -101
- package/dist/es5/parquetjs/parquet-thrift/TimeUnit.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimestampType.js +68 -79
- package/dist/es5/parquetjs/parquet-thrift/TimestampType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Type.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TypeDefinedOrder.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/TypeDefinedOrder.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/UUIDType.js +31 -45
- package/dist/es5/parquetjs/parquet-thrift/UUIDType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/index.js +43 -43
- package/dist/es5/parquetjs/parser/decoders.js +218 -397
- package/dist/es5/parquetjs/parser/decoders.js.map +1 -1
- package/dist/es5/parquetjs/parser/parquet-cursor.js +62 -180
- package/dist/es5/parquetjs/parser/parquet-cursor.js.map +1 -1
- package/dist/es5/parquetjs/parser/parquet-envelope-reader.js +124 -408
- package/dist/es5/parquetjs/parser/parquet-envelope-reader.js.map +1 -1
- package/dist/es5/parquetjs/parser/parquet-reader.js +91 -369
- package/dist/es5/parquetjs/parser/parquet-reader.js.map +1 -1
- package/dist/es5/parquetjs/schema/declare.js +9 -11
- package/dist/es5/parquetjs/schema/declare.js.map +1 -1
- package/dist/es5/parquetjs/schema/schema.js +73 -87
- package/dist/es5/parquetjs/schema/schema.js.map +1 -1
- package/dist/es5/parquetjs/schema/shred.js +56 -96
- package/dist/es5/parquetjs/schema/shred.js.map +1 -1
- package/dist/es5/parquetjs/schema/types.js +39 -40
- package/dist/es5/parquetjs/schema/types.js.map +1 -1
- package/dist/es5/parquetjs/utils/buffer-utils.js +1 -1
- package/dist/es5/parquetjs/utils/buffer-utils.js.map +1 -1
- package/dist/es5/parquetjs/utils/file-utils.js +8 -65
- package/dist/es5/parquetjs/utils/file-utils.js.map +1 -1
- package/dist/es5/parquetjs/utils/read-utils.js +22 -50
- package/dist/es5/parquetjs/utils/read-utils.js.map +1 -1
- package/dist/esm/index.js +2 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parquet-loader.js +1 -1
- package/dist/esm/parquet-loader.js.map +1 -1
- package/dist/esm/parquet-writer.js +1 -1
- package/dist/esm/parquet-writer.js.map +1 -1
- package/dist/esm/parquetjs/codecs/plain.js +3 -3
- package/dist/esm/parquetjs/codecs/plain.js.map +1 -1
- package/dist/esm/parquetjs/codecs/rle.js +1 -1
- package/dist/esm/parquetjs/codecs/rle.js.map +1 -1
- package/dist/esm/parquetjs/compression.js +4 -13
- package/dist/esm/parquetjs/compression.js.map +1 -1
- package/dist/esm/parquetjs/encoder/writer.js +1 -1
- package/dist/esm/parquetjs/encoder/writer.js.map +1 -1
- package/dist/esm/parquetjs/parser/decoders.js +4 -4
- package/dist/esm/parquetjs/parser/decoders.js.map +1 -1
- package/dist/esm/parquetjs/parser/parquet-envelope-reader.js +4 -13
- package/dist/esm/parquetjs/parser/parquet-envelope-reader.js.map +1 -1
- package/dist/esm/parquetjs/parser/parquet-reader.js +0 -13
- package/dist/esm/parquetjs/parser/parquet-reader.js.map +1 -1
- package/dist/esm/parquetjs/schema/schema.js +3 -3
- package/dist/esm/parquetjs/schema/schema.js.map +1 -1
- package/dist/esm/parquetjs/schema/shred.js +2 -2
- package/dist/esm/parquetjs/schema/shred.js.map +1 -1
- package/dist/esm/parquetjs/schema/types.js +20 -20
- package/dist/esm/parquetjs/schema/types.js.map +1 -1
- package/dist/esm/parquetjs/utils/file-utils.js +0 -45
- package/dist/esm/parquetjs/utils/file-utils.js.map +1 -1
- package/dist/index.d.ts +28 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/lib/convert-schema.d.ts +8 -0
- package/dist/lib/convert-schema.d.ts.map +1 -0
- package/dist/lib/convert-schema.js +70 -0
- package/dist/lib/parse-parquet.d.ts +4 -0
- package/dist/lib/parse-parquet.d.ts.map +1 -0
- package/dist/lib/parse-parquet.js +28 -0
- package/dist/lib/read-array-buffer.d.ts +19 -0
- package/dist/lib/read-array-buffer.d.ts.map +1 -0
- package/dist/lib/read-array-buffer.js +29 -0
- package/dist/parquet-loader.d.ts +23 -0
- package/dist/parquet-loader.d.ts.map +1 -0
- package/dist/parquet-loader.js +27 -0
- package/dist/parquet-worker.js +27 -13
- package/dist/parquet-worker.js.map +7 -1
- package/dist/parquet-writer.d.ts +4 -0
- package/dist/parquet-writer.d.ts.map +1 -0
- package/dist/parquet-writer.js +21 -0
- package/dist/parquetjs/codecs/declare.d.ts +17 -0
- package/dist/parquetjs/codecs/declare.d.ts.map +1 -0
- package/dist/parquetjs/codecs/declare.js +2 -0
- package/dist/parquetjs/codecs/dictionary.d.ts +3 -0
- package/dist/parquetjs/codecs/dictionary.d.ts.map +1 -0
- package/dist/parquetjs/codecs/dictionary.js +14 -0
- package/dist/parquetjs/codecs/index.d.ts +5 -0
- package/dist/parquetjs/codecs/index.d.ts.map +1 -0
- package/dist/parquetjs/codecs/index.js +51 -0
- package/dist/parquetjs/codecs/plain.d.ts +6 -0
- package/dist/parquetjs/codecs/plain.d.ts.map +1 -0
- package/dist/parquetjs/codecs/plain.js +211 -0
- package/dist/parquetjs/codecs/rle.d.ts +6 -0
- package/dist/parquetjs/codecs/rle.d.ts.map +1 -0
- package/dist/parquetjs/codecs/rle.js +145 -0
- package/dist/parquetjs/compression.d.ts +23 -0
- package/dist/parquetjs/compression.d.ts.map +1 -0
- package/dist/parquetjs/compression.js +168 -0
- package/dist/parquetjs/encoder/writer.d.ts +123 -0
- package/dist/parquetjs/encoder/writer.d.ts.map +1 -0
- package/dist/parquetjs/encoder/writer.js +478 -0
- package/dist/parquetjs/file.d.ts +10 -0
- package/dist/parquetjs/file.d.ts.map +1 -0
- package/dist/parquetjs/file.js +99 -0
- package/dist/parquetjs/parquet-thrift/BoundaryOrder.d.ts +6 -0
- package/dist/parquetjs/parquet-thrift/BoundaryOrder.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/BoundaryOrder.js +15 -0
- package/dist/parquetjs/parquet-thrift/BsonType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/BsonType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/BsonType.js +58 -0
- package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts +25 -0
- package/dist/parquetjs/parquet-thrift/ColumnChunk.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnChunk.js +207 -0
- package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts +22 -0
- package/dist/parquetjs/parquet-thrift/ColumnIndex.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnIndex.js +213 -0
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts +42 -0
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnMetaData.js +398 -0
- package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts +13 -0
- package/dist/parquetjs/parquet-thrift/ColumnOrder.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ColumnOrder.js +104 -0
- package/dist/parquetjs/parquet-thrift/CompressionCodec.d.ts +11 -0
- package/dist/parquetjs/parquet-thrift/CompressionCodec.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/CompressionCodec.js +20 -0
- package/dist/parquetjs/parquet-thrift/ConvertedType.d.ts +25 -0
- package/dist/parquetjs/parquet-thrift/ConvertedType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ConvertedType.js +34 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts +21 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeader.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeader.js +166 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts +27 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/DataPageHeaderV2.js +226 -0
- package/dist/parquetjs/parquet-thrift/DateType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/DateType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/DateType.js +58 -0
- package/dist/parquetjs/parquet-thrift/DecimalType.d.ts +13 -0
- package/dist/parquetjs/parquet-thrift/DecimalType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/DecimalType.js +105 -0
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts +16 -0
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/DictionaryPageHeader.js +122 -0
- package/dist/parquetjs/parquet-thrift/Encoding.d.ts +11 -0
- package/dist/parquetjs/parquet-thrift/Encoding.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/Encoding.js +20 -0
- package/dist/parquetjs/parquet-thrift/EnumType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/EnumType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/EnumType.js +58 -0
- package/dist/parquetjs/parquet-thrift/FieldRepetitionType.d.ts +6 -0
- package/dist/parquetjs/parquet-thrift/FieldRepetitionType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/FieldRepetitionType.js +15 -0
- package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts +28 -0
- package/dist/parquetjs/parquet-thrift/FileMetaData.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/FileMetaData.js +256 -0
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/IndexPageHeader.js +58 -0
- package/dist/parquetjs/parquet-thrift/IntType.d.ts +13 -0
- package/dist/parquetjs/parquet-thrift/IntType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/IntType.js +105 -0
- package/dist/parquetjs/parquet-thrift/JsonType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/JsonType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/JsonType.js +58 -0
- package/dist/parquetjs/parquet-thrift/KeyValue.d.ts +13 -0
- package/dist/parquetjs/parquet-thrift/KeyValue.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/KeyValue.js +102 -0
- package/dist/parquetjs/parquet-thrift/ListType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/ListType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/ListType.js +58 -0
- package/dist/parquetjs/parquet-thrift/LogicalType.d.ts +61 -0
- package/dist/parquetjs/parquet-thrift/LogicalType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/LogicalType.js +380 -0
- package/dist/parquetjs/parquet-thrift/MapType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/MapType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/MapType.js +58 -0
- package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/MicroSeconds.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/MicroSeconds.js +58 -0
- package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/MilliSeconds.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/MilliSeconds.js +58 -0
- package/dist/parquetjs/parquet-thrift/NullType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/NullType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/NullType.js +58 -0
- package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts +12 -0
- package/dist/parquetjs/parquet-thrift/OffsetIndex.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/OffsetIndex.js +97 -0
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts +17 -0
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/PageEncodingStats.js +127 -0
- package/dist/parquetjs/parquet-thrift/PageHeader.d.ts +30 -0
- package/dist/parquetjs/parquet-thrift/PageHeader.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/PageHeader.js +216 -0
- package/dist/parquetjs/parquet-thrift/PageLocation.d.ts +16 -0
- package/dist/parquetjs/parquet-thrift/PageLocation.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/PageLocation.js +141 -0
- package/dist/parquetjs/parquet-thrift/PageType.d.ts +7 -0
- package/dist/parquetjs/parquet-thrift/PageType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/PageType.js +16 -0
- package/dist/parquetjs/parquet-thrift/RowGroup.d.ts +20 -0
- package/dist/parquetjs/parquet-thrift/RowGroup.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/RowGroup.js +182 -0
- package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts +33 -0
- package/dist/parquetjs/parquet-thrift/SchemaElement.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/SchemaElement.js +239 -0
- package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts +15 -0
- package/dist/parquetjs/parquet-thrift/SortingColumn.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/SortingColumn.js +127 -0
- package/dist/parquetjs/parquet-thrift/Statistics.d.ts +23 -0
- package/dist/parquetjs/parquet-thrift/Statistics.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/Statistics.js +176 -0
- package/dist/parquetjs/parquet-thrift/StringType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/StringType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/StringType.js +58 -0
- package/dist/parquetjs/parquet-thrift/TimeType.d.ts +14 -0
- package/dist/parquetjs/parquet-thrift/TimeType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/TimeType.js +106 -0
- package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts +17 -0
- package/dist/parquetjs/parquet-thrift/TimeUnit.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/TimeUnit.js +127 -0
- package/dist/parquetjs/parquet-thrift/TimestampType.d.ts +14 -0
- package/dist/parquetjs/parquet-thrift/TimestampType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/TimestampType.js +106 -0
- package/dist/parquetjs/parquet-thrift/Type.d.ts +11 -0
- package/dist/parquetjs/parquet-thrift/Type.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/Type.js +20 -0
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/TypeDefinedOrder.js +58 -0
- package/dist/parquetjs/parquet-thrift/UUIDType.d.ts +9 -0
- package/dist/parquetjs/parquet-thrift/UUIDType.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/UUIDType.js +58 -0
- package/dist/parquetjs/parquet-thrift/index.d.ts +44 -0
- package/dist/parquetjs/parquet-thrift/index.d.ts.map +1 -0
- package/dist/parquetjs/parquet-thrift/index.js +61 -0
- package/dist/parquetjs/parser/decoders.d.ts +34 -0
- package/dist/parquetjs/parser/decoders.d.ts.map +1 -0
- package/dist/parquetjs/parser/decoders.js +318 -0
- package/dist/parquetjs/parser/parquet-cursor.d.ts +36 -0
- package/dist/parquetjs/parser/parquet-cursor.d.ts.map +1 -0
- package/dist/parquetjs/parser/parquet-cursor.js +74 -0
- package/dist/parquetjs/parser/parquet-envelope-reader.d.ts +40 -0
- package/dist/parquetjs/parser/parquet-envelope-reader.d.ts.map +1 -0
- package/dist/parquetjs/parser/parquet-envelope-reader.js +136 -0
- package/dist/parquetjs/parser/parquet-reader.d.ts +68 -0
- package/dist/parquetjs/parser/parquet-reader.d.ts.map +1 -0
- package/dist/parquetjs/parser/parquet-reader.js +134 -0
- package/dist/parquetjs/schema/declare.d.ts +80 -0
- package/dist/parquetjs/schema/declare.d.ts.map +1 -0
- package/dist/parquetjs/schema/declare.js +10 -0
- package/dist/parquetjs/schema/schema.d.ts +26 -0
- package/dist/parquetjs/schema/schema.d.ts.map +1 -0
- package/dist/parquetjs/schema/schema.js +162 -0
- package/dist/parquetjs/schema/shred.d.ts +48 -0
- package/dist/parquetjs/schema/shred.d.ts.map +1 -0
- package/dist/parquetjs/schema/shred.js +225 -0
- package/dist/parquetjs/schema/types.d.ts +20 -0
- package/dist/parquetjs/schema/types.d.ts.map +1 -0
- package/dist/parquetjs/schema/types.js +418 -0
- package/dist/parquetjs/utils/buffer-utils.d.ts +10 -0
- package/dist/parquetjs/utils/buffer-utils.d.ts.map +1 -0
- package/dist/parquetjs/utils/buffer-utils.js +22 -0
- package/dist/parquetjs/utils/file-utils.d.ts +16 -0
- package/dist/parquetjs/utils/file-utils.d.ts.map +1 -0
- package/dist/parquetjs/utils/file-utils.js +46 -0
- package/dist/parquetjs/utils/read-utils.d.ts +25 -0
- package/dist/parquetjs/utils/read-utils.d.ts.map +1 -0
- package/dist/parquetjs/utils/read-utils.js +109 -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 +5 -0
- package/package.json +8 -8
- package/src/index.ts +3 -3
- package/src/parquetjs/compression.ts +10 -10
- package/src/parquetjs/parser/decoders.ts +1 -1
- package/src/parquetjs/parser/parquet-envelope-reader.ts +0 -11
- package/src/parquetjs/parser/parquet-reader.ts +0 -16
- package/src/parquetjs/utils/file-utils.ts +0 -49
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParquetCursor = void 0;
|
|
4
|
+
const shred_1 = require("../schema/shred");
|
|
5
|
+
/**
|
|
6
|
+
* A parquet cursor is used to retrieve rows from a parquet file in order
|
|
7
|
+
*/
|
|
8
|
+
class ParquetCursor {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new parquet reader from the file metadata and an envelope reader.
|
|
11
|
+
* It is usually not recommended to call this constructor directly except for
|
|
12
|
+
* advanced and internal use cases. Consider using getCursor() on the
|
|
13
|
+
* ParquetReader instead
|
|
14
|
+
*/
|
|
15
|
+
constructor(metadata, envelopeReader, schema, columnList) {
|
|
16
|
+
this.rowGroup = [];
|
|
17
|
+
this.metadata = metadata;
|
|
18
|
+
this.envelopeReader = envelopeReader;
|
|
19
|
+
this.schema = schema;
|
|
20
|
+
this.columnList = columnList;
|
|
21
|
+
this.rowGroupIndex = 0;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve the next row from the cursor. Returns a row or NULL if the end
|
|
25
|
+
* of the file was reached
|
|
26
|
+
*/
|
|
27
|
+
async next() {
|
|
28
|
+
if (this.rowGroup.length === 0) {
|
|
29
|
+
if (this.rowGroupIndex >= this.metadata.row_groups.length) {
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
const rowBuffer = await this.envelopeReader.readRowGroup(this.schema, this.metadata.row_groups[this.rowGroupIndex], this.columnList);
|
|
34
|
+
this.rowGroup = (0, shred_1.materializeRecords)(this.schema, rowBuffer);
|
|
35
|
+
this.rowGroupIndex++;
|
|
36
|
+
}
|
|
37
|
+
return this.rowGroup.shift();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Rewind the cursor the the beginning of the file
|
|
41
|
+
*/
|
|
42
|
+
rewind() {
|
|
43
|
+
this.rowGroup = [];
|
|
44
|
+
this.rowGroupIndex = 0;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Implement AsyncIterable
|
|
48
|
+
*/
|
|
49
|
+
// tslint:disable-next-line:function-name
|
|
50
|
+
[Symbol.asyncIterator]() {
|
|
51
|
+
let done = false;
|
|
52
|
+
return {
|
|
53
|
+
next: async () => {
|
|
54
|
+
if (done) {
|
|
55
|
+
return { done, value: null };
|
|
56
|
+
}
|
|
57
|
+
const value = await this.next();
|
|
58
|
+
if (value === null) {
|
|
59
|
+
return { done: true, value };
|
|
60
|
+
}
|
|
61
|
+
return { done: false, value };
|
|
62
|
+
},
|
|
63
|
+
return: async () => {
|
|
64
|
+
done = true;
|
|
65
|
+
return { done, value: null };
|
|
66
|
+
},
|
|
67
|
+
throw: async () => {
|
|
68
|
+
done = true;
|
|
69
|
+
return { done: true, value: null };
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.ParquetCursor = ParquetCursor;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ParquetSchema } from '../schema/schema';
|
|
3
|
+
import { ColumnChunk, FileMetaData, RowGroup } from '../parquet-thrift';
|
|
4
|
+
import { ParquetBuffer, ParquetData, ParquetOptions } from '../schema/declare';
|
|
5
|
+
/**
|
|
6
|
+
* The parquet envelope reader allows direct, unbuffered access to the individual
|
|
7
|
+
* sections of the parquet file, namely the header, footer and the row groups.
|
|
8
|
+
* This class is intended for advanced/internal users; if you just want to retrieve
|
|
9
|
+
* rows from a parquet file use the ParquetReader instead
|
|
10
|
+
*/
|
|
11
|
+
export declare class ParquetEnvelopeReader {
|
|
12
|
+
read: (position: number, length: number) => Promise<Buffer>;
|
|
13
|
+
/**
|
|
14
|
+
* Close this parquet reader. You MUST call this method once you're finished
|
|
15
|
+
* reading rows
|
|
16
|
+
*/
|
|
17
|
+
close: () => Promise<void>;
|
|
18
|
+
fileSize: number;
|
|
19
|
+
defaultDictionarySize: number;
|
|
20
|
+
static openBuffer(buffer: Buffer): Promise<ParquetEnvelopeReader>;
|
|
21
|
+
constructor(read: (position: number, length: number) => Promise<Buffer>, close: () => Promise<void>, fileSize: number, options?: any);
|
|
22
|
+
readHeader(): Promise<void>;
|
|
23
|
+
readRowGroup(schema: ParquetSchema, rowGroup: RowGroup, columnList: string[][]): Promise<ParquetBuffer>;
|
|
24
|
+
/**
|
|
25
|
+
* Do reading of parquet file's column chunk
|
|
26
|
+
* @param schema
|
|
27
|
+
* @param colChunk
|
|
28
|
+
*/
|
|
29
|
+
readColumnChunk(schema: ParquetSchema, colChunk: ColumnChunk): Promise<ParquetData>;
|
|
30
|
+
/**
|
|
31
|
+
* Getting dictionary for allows to flatten values by indices.
|
|
32
|
+
* @param dictionaryPageOffset
|
|
33
|
+
* @param options
|
|
34
|
+
* @param pagesOffset
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
getDictionary(dictionaryPageOffset: number, options: ParquetOptions, pagesOffset: number): Promise<string[]>;
|
|
38
|
+
readFooter(): Promise<FileMetaData>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=parquet-envelope-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet-envelope-reader.d.ts","sourceRoot":"","sources":["../../../src/parquetjs/parser/parquet-envelope-reader.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAC,WAAW,EAAoB,YAAY,EAAE,QAAQ,EAAO,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EACL,aAAa,EAEb,WAAW,EAEX,cAAc,EACf,MAAM,mBAAmB,CAAC;AAM3B;;;;;GAKG;AACH,qBAAa,qBAAqB;IACzB,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnE;;;OAGG;IACI,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;WAExB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;gBAQrE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,EAC3D,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,GAAG;IAQT,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B,YAAY,CAChB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,MAAM,EAAE,EAAE,GACrB,OAAO,CAAC,aAAa,CAAC;IAgBzB;;;;OAIG;IACG,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAoDzF;;;;;;OAMG;IACG,aAAa,CACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,cAAc,EACvB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBd,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;CAqB1C"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParquetEnvelopeReader = void 0;
|
|
4
|
+
const constants_1 = require("../../constants");
|
|
5
|
+
const parquet_thrift_1 = require("../parquet-thrift");
|
|
6
|
+
const read_utils_1 = require("../utils/read-utils");
|
|
7
|
+
const decoders_1 = require("./decoders");
|
|
8
|
+
const DEFAULT_DICTIONARY_SIZE = 1e6;
|
|
9
|
+
/**
|
|
10
|
+
* The parquet envelope reader allows direct, unbuffered access to the individual
|
|
11
|
+
* sections of the parquet file, namely the header, footer and the row groups.
|
|
12
|
+
* This class is intended for advanced/internal users; if you just want to retrieve
|
|
13
|
+
* rows from a parquet file use the ParquetReader instead
|
|
14
|
+
*/
|
|
15
|
+
class ParquetEnvelopeReader {
|
|
16
|
+
constructor(read, close, fileSize, options) {
|
|
17
|
+
this.read = read;
|
|
18
|
+
this.close = close;
|
|
19
|
+
this.fileSize = fileSize;
|
|
20
|
+
this.defaultDictionarySize = options?.defaultDictionarySize || DEFAULT_DICTIONARY_SIZE;
|
|
21
|
+
}
|
|
22
|
+
static async openBuffer(buffer) {
|
|
23
|
+
const readFn = (position, length) => Promise.resolve(buffer.slice(position, position + length));
|
|
24
|
+
const closeFn = () => Promise.resolve();
|
|
25
|
+
return new ParquetEnvelopeReader(readFn, closeFn, buffer.length);
|
|
26
|
+
}
|
|
27
|
+
async readHeader() {
|
|
28
|
+
const buffer = await this.read(0, constants_1.PARQUET_MAGIC.length);
|
|
29
|
+
const magic = buffer.toString();
|
|
30
|
+
switch (magic) {
|
|
31
|
+
case constants_1.PARQUET_MAGIC:
|
|
32
|
+
break;
|
|
33
|
+
case constants_1.PARQUET_MAGIC_ENCRYPTED:
|
|
34
|
+
throw new Error('Encrypted parquet file not supported');
|
|
35
|
+
default:
|
|
36
|
+
throw new Error(`Invalid parquet file (magic=${magic})`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async readRowGroup(schema, rowGroup, columnList) {
|
|
40
|
+
const buffer = {
|
|
41
|
+
rowCount: Number(rowGroup.num_rows),
|
|
42
|
+
columnData: {}
|
|
43
|
+
};
|
|
44
|
+
for (const colChunk of rowGroup.columns) {
|
|
45
|
+
const colMetadata = colChunk.meta_data;
|
|
46
|
+
const colKey = colMetadata?.path_in_schema;
|
|
47
|
+
if (columnList.length > 0 && (0, read_utils_1.fieldIndexOf)(columnList, colKey) < 0) {
|
|
48
|
+
continue; // eslint-disable-line no-continue
|
|
49
|
+
}
|
|
50
|
+
buffer.columnData[colKey.join()] = await this.readColumnChunk(schema, colChunk);
|
|
51
|
+
}
|
|
52
|
+
return buffer;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Do reading of parquet file's column chunk
|
|
56
|
+
* @param schema
|
|
57
|
+
* @param colChunk
|
|
58
|
+
*/
|
|
59
|
+
async readColumnChunk(schema, colChunk) {
|
|
60
|
+
if (colChunk.file_path !== undefined && colChunk.file_path !== null) {
|
|
61
|
+
throw new Error('external references are not supported');
|
|
62
|
+
}
|
|
63
|
+
const field = schema.findField(colChunk.meta_data?.path_in_schema);
|
|
64
|
+
const type = (0, read_utils_1.getThriftEnum)(parquet_thrift_1.Type, colChunk.meta_data?.type);
|
|
65
|
+
if (type !== field.primitiveType) {
|
|
66
|
+
throw new Error(`chunk type not matching schema: ${type}`);
|
|
67
|
+
}
|
|
68
|
+
const compression = (0, read_utils_1.getThriftEnum)(parquet_thrift_1.CompressionCodec, colChunk.meta_data?.codec);
|
|
69
|
+
const pagesOffset = Number(colChunk.meta_data?.data_page_offset);
|
|
70
|
+
let pagesSize = Number(colChunk.meta_data?.total_compressed_size);
|
|
71
|
+
if (!colChunk.file_path) {
|
|
72
|
+
pagesSize = Math.min(this.fileSize - pagesOffset, Number(colChunk.meta_data?.total_compressed_size));
|
|
73
|
+
}
|
|
74
|
+
const options = {
|
|
75
|
+
type,
|
|
76
|
+
rLevelMax: field.rLevelMax,
|
|
77
|
+
dLevelMax: field.dLevelMax,
|
|
78
|
+
compression,
|
|
79
|
+
column: field,
|
|
80
|
+
numValues: colChunk.meta_data?.num_values,
|
|
81
|
+
dictionary: []
|
|
82
|
+
};
|
|
83
|
+
let dictionary;
|
|
84
|
+
const dictionaryPageOffset = colChunk?.meta_data?.dictionary_page_offset;
|
|
85
|
+
if (dictionaryPageOffset) {
|
|
86
|
+
const dictionaryOffset = Number(dictionaryPageOffset);
|
|
87
|
+
// Getting dictionary from column chunk to iterate all over indexes to get dataPage values.
|
|
88
|
+
dictionary = await this.getDictionary(dictionaryOffset, options, pagesOffset);
|
|
89
|
+
}
|
|
90
|
+
dictionary = options.dictionary?.length ? options.dictionary : dictionary;
|
|
91
|
+
const pagesBuf = await this.read(pagesOffset, pagesSize);
|
|
92
|
+
return await (0, decoders_1.decodeDataPages)(pagesBuf, { ...options, dictionary });
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Getting dictionary for allows to flatten values by indices.
|
|
96
|
+
* @param dictionaryPageOffset
|
|
97
|
+
* @param options
|
|
98
|
+
* @param pagesOffset
|
|
99
|
+
* @returns
|
|
100
|
+
*/
|
|
101
|
+
async getDictionary(dictionaryPageOffset, options, pagesOffset) {
|
|
102
|
+
if (dictionaryPageOffset === 0) {
|
|
103
|
+
// dictionarySize = Math.min(this.fileSize - pagesOffset, this.defaultDictionarySize);
|
|
104
|
+
// pagesBuf = await this.read(pagesOffset, dictionarySize);
|
|
105
|
+
// In this case we are working with parquet-mr files format. Problem is described below:
|
|
106
|
+
// https://stackoverflow.com/questions/55225108/why-is-dictionary-page-offset-0-for-plain-dictionary-encoding
|
|
107
|
+
// We need to get dictionary page from column chunk if it exists.
|
|
108
|
+
// Now if we use code commented above we don't get DICTIONARY_PAGE we get DATA_PAGE instead.
|
|
109
|
+
return [];
|
|
110
|
+
}
|
|
111
|
+
const dictionarySize = Math.min(this.fileSize - dictionaryPageOffset, this.defaultDictionarySize);
|
|
112
|
+
const pagesBuf = await this.read(dictionaryPageOffset, dictionarySize);
|
|
113
|
+
const cursor = { buffer: pagesBuf, offset: 0, size: pagesBuf.length };
|
|
114
|
+
const decodedPage = await (0, decoders_1.decodePage)(cursor, options);
|
|
115
|
+
return decodedPage.dictionary;
|
|
116
|
+
}
|
|
117
|
+
async readFooter() {
|
|
118
|
+
const trailerLen = constants_1.PARQUET_MAGIC.length + 4;
|
|
119
|
+
const trailerBuf = await this.read(this.fileSize - trailerLen, trailerLen);
|
|
120
|
+
const magic = trailerBuf.slice(4).toString();
|
|
121
|
+
if (magic !== constants_1.PARQUET_MAGIC) {
|
|
122
|
+
throw new Error(`Not a valid parquet file (magic="${magic})`);
|
|
123
|
+
}
|
|
124
|
+
const metadataSize = trailerBuf.readUInt32LE(0);
|
|
125
|
+
const metadataOffset = this.fileSize - metadataSize - trailerLen;
|
|
126
|
+
if (metadataOffset < constants_1.PARQUET_MAGIC.length) {
|
|
127
|
+
throw new Error(`Invalid metadata size ${metadataOffset}`);
|
|
128
|
+
}
|
|
129
|
+
const metadataBuf = await this.read(metadataOffset, metadataSize);
|
|
130
|
+
// let metadata = new parquet_thrift.FileMetaData();
|
|
131
|
+
// parquet_util.decodeThrift(metadata, metadataBuf);
|
|
132
|
+
const { metadata } = (0, read_utils_1.decodeFileMetadata)(metadataBuf);
|
|
133
|
+
return metadata;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.ParquetEnvelopeReader = ParquetEnvelopeReader;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ParquetEnvelopeReader } from './parquet-envelope-reader';
|
|
3
|
+
import { FileMetaData } from '../parquet-thrift';
|
|
4
|
+
import { ParquetSchema } from '../schema/schema';
|
|
5
|
+
import { ParquetCursor } from './parquet-cursor';
|
|
6
|
+
/**
|
|
7
|
+
* A parquet reader allows retrieving the rows from a parquet file in order.
|
|
8
|
+
* The basic usage is to create a reader and then retrieve a cursor/iterator
|
|
9
|
+
* which allows you to consume row after row until all rows have been read. It is
|
|
10
|
+
* important that you call close() after you are finished reading the file to
|
|
11
|
+
* avoid leaking file descriptors.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ParquetReader<T> implements AsyncIterable<T> {
|
|
14
|
+
/**
|
|
15
|
+
* return a new parquet reader initialized with a read function
|
|
16
|
+
*/
|
|
17
|
+
static openBlob<T>(blob: Blob): Promise<ParquetReader<T>>;
|
|
18
|
+
/**
|
|
19
|
+
* return a new parquet reader initialized with a read function
|
|
20
|
+
*/
|
|
21
|
+
static openArrayBuffer<T>(arrayBuffer: ArrayBuffer): Promise<ParquetReader<T>>;
|
|
22
|
+
static openBuffer<T>(buffer: Buffer): Promise<ParquetReader<T>>;
|
|
23
|
+
metadata: FileMetaData;
|
|
24
|
+
envelopeReader: ParquetEnvelopeReader;
|
|
25
|
+
schema: ParquetSchema;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new parquet reader from the file metadata and an envelope reader.
|
|
28
|
+
* It is not recommended to call this constructor directly except for advanced
|
|
29
|
+
* and internal use cases. Consider using one of the open{File,Buffer} methods
|
|
30
|
+
* instead
|
|
31
|
+
*/
|
|
32
|
+
constructor(metadata: FileMetaData, envelopeReader: ParquetEnvelopeReader);
|
|
33
|
+
/**
|
|
34
|
+
* Close this parquet reader. You MUST call this method once you're finished
|
|
35
|
+
* reading rows
|
|
36
|
+
*/
|
|
37
|
+
close(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Return a cursor to the file. You may open more than one cursor and use
|
|
40
|
+
* them concurrently. All cursors become invalid once close() is called on
|
|
41
|
+
* the reader object.
|
|
42
|
+
*
|
|
43
|
+
* The required_columns parameter controls which columns are actually read
|
|
44
|
+
* from disk. An empty array or no value implies all columns. A list of column
|
|
45
|
+
* names means that only those columns should be loaded from disk.
|
|
46
|
+
*/
|
|
47
|
+
getCursor(): ParquetCursor<T>;
|
|
48
|
+
getCursor<K extends keyof T>(columnList: (K | K[])[]): ParquetCursor<Pick<T, K>>;
|
|
49
|
+
getCursor(columnList: (string | string[])[]): ParquetCursor<Partial<T>>;
|
|
50
|
+
/**
|
|
51
|
+
* Return the number of rows in this file. Note that the number of rows is
|
|
52
|
+
* not neccessarily equal to the number of rows in each column.
|
|
53
|
+
*/
|
|
54
|
+
getRowCount(): number;
|
|
55
|
+
/**
|
|
56
|
+
* Returns the ParquetSchema for this file
|
|
57
|
+
*/
|
|
58
|
+
getSchema(): ParquetSchema;
|
|
59
|
+
/**
|
|
60
|
+
* Returns the user (key/value) metadata for this file
|
|
61
|
+
*/
|
|
62
|
+
getMetadata(): Record<string, string>;
|
|
63
|
+
/**
|
|
64
|
+
* Implement AsyncIterable
|
|
65
|
+
*/
|
|
66
|
+
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=parquet-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parquet-reader.d.ts","sourceRoot":"","sources":["../../../src/parquetjs/parser/parquet-reader.ts"],"names":[],"mappings":";AACA,OAAO,EAAC,qBAAqB,EAAC,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAI/C;;;;;;GAMG;AACH,qBAAa,aAAa,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACvD;;OAEG;WACU,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAkB/D;;OAEG;WACU,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;WAevE,UAAU,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAY9D,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,qBAAqB,CAAC;IACtC,MAAM,EAAE,aAAa,CAAC;IAE7B;;;;;OAKG;gBACS,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB;IAYzE;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B;;;;;;;;OAQG;IACH,SAAS,IAAI,aAAa,CAAC,CAAC,CAAC;IAE7B,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,SAAS,CAAC,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAkBvE;;;OAGG;IACH,WAAW,IAAI,MAAM;IAIrB;;OAEG;IACH,SAAS,IAAI,aAAa;IAI1B;;OAEG;IACH,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQrC;;OAEG;IAEH,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAG3C"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParquetReader = void 0;
|
|
4
|
+
// Forked from https://github.com/kbajalc/parquets under MIT license (Copyright (c) 2017 ironSource Ltd.)
|
|
5
|
+
const parquet_envelope_reader_1 = require("./parquet-envelope-reader");
|
|
6
|
+
const schema_1 = require("../schema/schema");
|
|
7
|
+
const parquet_cursor_1 = require("./parquet-cursor");
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const decoders_1 = require("./decoders");
|
|
10
|
+
/**
|
|
11
|
+
* A parquet reader allows retrieving the rows from a parquet file in order.
|
|
12
|
+
* The basic usage is to create a reader and then retrieve a cursor/iterator
|
|
13
|
+
* which allows you to consume row after row until all rows have been read. It is
|
|
14
|
+
* important that you call close() after you are finished reading the file to
|
|
15
|
+
* avoid leaking file descriptors.
|
|
16
|
+
*/
|
|
17
|
+
class ParquetReader {
|
|
18
|
+
/**
|
|
19
|
+
* Create a new parquet reader from the file metadata and an envelope reader.
|
|
20
|
+
* It is not recommended to call this constructor directly except for advanced
|
|
21
|
+
* and internal use cases. Consider using one of the open{File,Buffer} methods
|
|
22
|
+
* instead
|
|
23
|
+
*/
|
|
24
|
+
constructor(metadata, envelopeReader) {
|
|
25
|
+
if (metadata.version !== constants_1.PARQUET_VERSION) {
|
|
26
|
+
throw new Error('invalid parquet version');
|
|
27
|
+
}
|
|
28
|
+
this.metadata = metadata;
|
|
29
|
+
this.envelopeReader = envelopeReader;
|
|
30
|
+
const root = this.metadata.schema[0];
|
|
31
|
+
const { schema } = (0, decoders_1.decodeSchema)(this.metadata.schema, 1, root.num_children);
|
|
32
|
+
this.schema = new schema_1.ParquetSchema(schema);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* return a new parquet reader initialized with a read function
|
|
36
|
+
*/
|
|
37
|
+
static async openBlob(blob) {
|
|
38
|
+
const readFn = async (start, length) => {
|
|
39
|
+
const arrayBuffer = await blob.slice(start, start + length).arrayBuffer();
|
|
40
|
+
return Buffer.from(arrayBuffer);
|
|
41
|
+
};
|
|
42
|
+
const closeFn = async () => { };
|
|
43
|
+
const size = blob.size;
|
|
44
|
+
const envelopeReader = new parquet_envelope_reader_1.ParquetEnvelopeReader(readFn, closeFn, size);
|
|
45
|
+
try {
|
|
46
|
+
await envelopeReader.readHeader();
|
|
47
|
+
const metadata = await envelopeReader.readFooter();
|
|
48
|
+
return new ParquetReader(metadata, envelopeReader);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
await envelopeReader.close();
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* return a new parquet reader initialized with a read function
|
|
57
|
+
*/
|
|
58
|
+
static async openArrayBuffer(arrayBuffer) {
|
|
59
|
+
const readFn = async (start, length) => Buffer.from(arrayBuffer, start, length);
|
|
60
|
+
const closeFn = async () => { };
|
|
61
|
+
const size = arrayBuffer.byteLength;
|
|
62
|
+
const envelopeReader = new parquet_envelope_reader_1.ParquetEnvelopeReader(readFn, closeFn, size);
|
|
63
|
+
try {
|
|
64
|
+
await envelopeReader.readHeader();
|
|
65
|
+
const metadata = await envelopeReader.readFooter();
|
|
66
|
+
return new ParquetReader(metadata, envelopeReader);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
await envelopeReader.close();
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static async openBuffer(buffer) {
|
|
74
|
+
const envelopeReader = await parquet_envelope_reader_1.ParquetEnvelopeReader.openBuffer(buffer);
|
|
75
|
+
try {
|
|
76
|
+
await envelopeReader.readHeader();
|
|
77
|
+
const metadata = await envelopeReader.readFooter();
|
|
78
|
+
return new ParquetReader(metadata, envelopeReader);
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
await envelopeReader.close();
|
|
82
|
+
throw err;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Close this parquet reader. You MUST call this method once you're finished
|
|
87
|
+
* reading rows
|
|
88
|
+
*/
|
|
89
|
+
async close() {
|
|
90
|
+
await this.envelopeReader.close();
|
|
91
|
+
// this.envelopeReader = null;
|
|
92
|
+
// this.metadata = null;
|
|
93
|
+
}
|
|
94
|
+
getCursor(columnList) {
|
|
95
|
+
if (!columnList) {
|
|
96
|
+
// tslint:disable-next-line:no-parameter-reassignment
|
|
97
|
+
columnList = [];
|
|
98
|
+
}
|
|
99
|
+
// tslint:disable-next-line:no-parameter-reassignment
|
|
100
|
+
columnList = columnList.map((x) => (Array.isArray(x) ? x : [x]));
|
|
101
|
+
return new parquet_cursor_1.ParquetCursor(this.metadata, this.envelopeReader, this.schema, columnList);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Return the number of rows in this file. Note that the number of rows is
|
|
105
|
+
* not neccessarily equal to the number of rows in each column.
|
|
106
|
+
*/
|
|
107
|
+
getRowCount() {
|
|
108
|
+
return Number(this.metadata.num_rows);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns the ParquetSchema for this file
|
|
112
|
+
*/
|
|
113
|
+
getSchema() {
|
|
114
|
+
return this.schema;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Returns the user (key/value) metadata for this file
|
|
118
|
+
*/
|
|
119
|
+
getMetadata() {
|
|
120
|
+
const md = {};
|
|
121
|
+
for (const kv of this.metadata.key_value_metadata) {
|
|
122
|
+
md[kv.key] = kv.value;
|
|
123
|
+
}
|
|
124
|
+
return md;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Implement AsyncIterable
|
|
128
|
+
*/
|
|
129
|
+
// tslint:disable-next-line:function-name
|
|
130
|
+
[Symbol.asyncIterator]() {
|
|
131
|
+
return this.getCursor()[Symbol.asyncIterator]();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.ParquetReader = ParquetReader;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import Int64 from 'node-int64';
|
|
2
|
+
import type { PageHeader } from '../parquet-thrift';
|
|
3
|
+
export declare type ParquetCodec = 'PLAIN' | 'RLE' | 'PLAIN_DICTIONARY';
|
|
4
|
+
export declare type ParquetCompression = 'UNCOMPRESSED' | 'GZIP' | 'SNAPPY' | 'LZO' | 'BROTLI' | 'LZ4' | 'LZ4_RAW' | 'ZSTD';
|
|
5
|
+
export declare type RepetitionType = 'REQUIRED' | 'OPTIONAL' | 'REPEATED';
|
|
6
|
+
export declare type ParquetType = PrimitiveType | OriginalType;
|
|
7
|
+
/**
|
|
8
|
+
* Physical type
|
|
9
|
+
*/
|
|
10
|
+
export declare type PrimitiveType = 'BOOLEAN' | 'INT32' | 'INT64' | 'INT96' | 'FLOAT' | 'DOUBLE' | 'BYTE_ARRAY' | 'FIXED_LEN_BYTE_ARRAY';
|
|
11
|
+
/**
|
|
12
|
+
* Logical type
|
|
13
|
+
*/
|
|
14
|
+
export declare type OriginalType = 'UTF8' | 'DECIMAL_INT32' | 'DECIMAL_INT64' | 'DECIMAL_BYTE_ARRAY' | 'DECIMAL_FIXED_LEN_BYTE_ARRAY' | 'DATE' | 'TIME_MILLIS' | 'TIME_MICROS' | 'TIMESTAMP_MILLIS' | 'TIMESTAMP_MICROS' | 'UINT_8' | 'UINT_16' | 'UINT_32' | 'UINT_64' | 'INT_8' | 'INT_16' | 'INT_32' | 'INT_64' | 'JSON' | 'BSON' | 'INTERVAL';
|
|
15
|
+
export declare type ParquetDictionary = string[];
|
|
16
|
+
export interface SchemaDefinition {
|
|
17
|
+
[string: string]: FieldDefinition;
|
|
18
|
+
}
|
|
19
|
+
export interface FieldDefinition {
|
|
20
|
+
type?: ParquetType;
|
|
21
|
+
typeLength?: number;
|
|
22
|
+
presision?: number;
|
|
23
|
+
scale?: number;
|
|
24
|
+
encoding?: ParquetCodec;
|
|
25
|
+
compression?: ParquetCompression;
|
|
26
|
+
optional?: boolean;
|
|
27
|
+
repeated?: boolean;
|
|
28
|
+
fields?: SchemaDefinition;
|
|
29
|
+
}
|
|
30
|
+
export interface ParquetField {
|
|
31
|
+
name: string;
|
|
32
|
+
path: string[];
|
|
33
|
+
key: string;
|
|
34
|
+
primitiveType?: PrimitiveType;
|
|
35
|
+
originalType?: OriginalType;
|
|
36
|
+
repetitionType: RepetitionType;
|
|
37
|
+
typeLength?: number;
|
|
38
|
+
presision?: number;
|
|
39
|
+
scale?: number;
|
|
40
|
+
encoding?: ParquetCodec;
|
|
41
|
+
compression?: ParquetCompression;
|
|
42
|
+
rLevelMax: number;
|
|
43
|
+
dLevelMax: number;
|
|
44
|
+
isNested?: boolean;
|
|
45
|
+
fieldCount?: number;
|
|
46
|
+
fields?: Record<string, ParquetField>;
|
|
47
|
+
}
|
|
48
|
+
export interface ParquetOptions {
|
|
49
|
+
type: ParquetType;
|
|
50
|
+
rLevelMax: number;
|
|
51
|
+
dLevelMax: number;
|
|
52
|
+
compression: ParquetCompression;
|
|
53
|
+
column: ParquetField;
|
|
54
|
+
numValues?: Int64;
|
|
55
|
+
dictionary?: ParquetDictionary;
|
|
56
|
+
}
|
|
57
|
+
export interface ParquetData {
|
|
58
|
+
dlevels: number[];
|
|
59
|
+
rlevels: number[];
|
|
60
|
+
values: any[];
|
|
61
|
+
count: number;
|
|
62
|
+
pageHeaders: PageHeader[];
|
|
63
|
+
}
|
|
64
|
+
export interface ParquetPageData {
|
|
65
|
+
dlevels: number[];
|
|
66
|
+
rlevels: number[];
|
|
67
|
+
values: any[];
|
|
68
|
+
count: number;
|
|
69
|
+
dictionary?: ParquetDictionary;
|
|
70
|
+
pageHeader: PageHeader;
|
|
71
|
+
}
|
|
72
|
+
export interface ParquetRecord {
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
export declare class ParquetBuffer {
|
|
76
|
+
rowCount: number;
|
|
77
|
+
columnData: Record<string, ParquetData>;
|
|
78
|
+
constructor(rowCount?: number, columnData?: Record<string, ParquetData>);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=declare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declare.d.ts","sourceRoot":"","sources":["../../../src/parquetjs/schema/declare.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParquetBuffer = void 0;
|
|
4
|
+
class ParquetBuffer {
|
|
5
|
+
constructor(rowCount = 0, columnData = {}) {
|
|
6
|
+
this.rowCount = rowCount;
|
|
7
|
+
this.columnData = columnData;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.ParquetBuffer = ParquetBuffer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FieldDefinition, ParquetBuffer, ParquetCompression, ParquetField, ParquetRecord, SchemaDefinition } from './declare';
|
|
2
|
+
/**
|
|
3
|
+
* A parquet file schema
|
|
4
|
+
*/
|
|
5
|
+
export declare class ParquetSchema {
|
|
6
|
+
schema: Record<string, FieldDefinition>;
|
|
7
|
+
fields: Record<string, ParquetField>;
|
|
8
|
+
fieldList: ParquetField[];
|
|
9
|
+
/**
|
|
10
|
+
* Create a new schema from a JSON schema definition
|
|
11
|
+
*/
|
|
12
|
+
constructor(schema: SchemaDefinition);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a field definition
|
|
15
|
+
*/
|
|
16
|
+
findField(path: string | string[]): ParquetField;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieve a field definition and all the field's ancestors
|
|
19
|
+
*/
|
|
20
|
+
findFieldBranch(path: string | string[]): ParquetField[];
|
|
21
|
+
shredRecord(record: ParquetRecord, buffer: ParquetBuffer): void;
|
|
22
|
+
materializeRecords(buffer: ParquetBuffer): ParquetRecord[];
|
|
23
|
+
compress(type: ParquetCompression): this;
|
|
24
|
+
buffer(): ParquetBuffer;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/parquetjs/schema/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,aAAa,EAEb,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAInB;;GAEG;AACH,qBAAa,aAAa;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACrC,SAAS,EAAE,YAAY,EAAE,CAAC;IAEjC;;OAEG;gBACS,MAAM,EAAE,gBAAgB;IAMpC;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY;IAiBhD;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,YAAY,EAAE;IAgBxD,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAI/D,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,EAAE;IAI1D,QAAQ,CAAC,IAAI,EAAE,kBAAkB,GAAG,IAAI;IAMxC,MAAM,IAAI,aAAa;CAGxB"}
|