@loaders.gl/core 5.0.0-beta.7 → 5.0.0-rc.1
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/GEOARROW-README.md +6 -0
- package/SCAN-README.md +2 -2
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-features.cjs +4 -1
- package/dist/arrow-geometry/binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/binary-features.d.ts.map +1 -1
- package/dist/arrow-geometry/binary-features.js +1 -1
- package/dist/arrow-geometry/binary-features.js.map +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +295 -18
- package/dist/arrow-geometry/geojson-table.cjs.map +4 -4
- package/dist/arrow-geometry/geojson-table.d.ts +10 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +23 -13
- package/dist/arrow-geometry/geojson-table.js.map +1 -1
- package/dist/arrow-geometry/geometry-codecs.cjs +6 -6
- package/dist/arrow-geometry/geometry-codecs.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-codecs.js +1 -1
- package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.cjs +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.js +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.js.map +1 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.cjs +1 -5
- package/dist/arrow-geometry/wkb-arrow-utils.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts +7 -7
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.js +4 -8
- package/dist/arrow-geometry/wkb-arrow-utils.js.map +1 -1
- package/dist/arrow-geometry/wkb-builder.cjs +3 -3
- package/dist/arrow-geometry/wkb-builder.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-builder.d.ts +1 -1
- package/dist/arrow-geometry/wkb-builder.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-builder.js +1 -1
- package/dist/arrow-geometry/wkb-builder.js.map +1 -1
- package/dist/arrow-geometry/wkb-statistics.cjs +2 -2
- package/dist/arrow-geometry/wkb-statistics.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-statistics.js +1 -1
- package/dist/arrow-geometry/wkb-statistics.js.map +1 -1
- package/dist/arrow-worker-transport.cjs +59 -35
- package/dist/arrow-worker-transport.cjs.map +1 -1
- package/dist/arrow-worker-transport.d.ts +9 -7
- package/dist/arrow-worker-transport.d.ts.map +1 -1
- package/dist/arrow-worker-transport.js +59 -42
- package/dist/arrow-worker-transport.js.map +1 -1
- package/dist/cluster-source.cjs +274 -509
- package/dist/cluster-source.cjs.map +3 -3
- package/dist/dist.dev.js +478 -450
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +121 -485
- package/dist/federated-table-scan-source.cjs.map +3 -3
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.cjs.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
- package/dist/geoarrow/geoarrow-bounds.cjs.map +3 -3
- package/dist/geoarrow/geoarrow-bounds.js +3 -3
- package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
- package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
- package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-capabilities.js +1 -1
- package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +13 -15
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +8 -11
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +10 -11
- package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-stream.js +9 -12
- package/dist/geoarrow/geoarrow-stream.js.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
- package/dist/geoarrow/index.cjs +0 -3
- package/dist/geoarrow/index.cjs.map +2 -2
- package/dist/geoarrow/index.d.ts +0 -2
- package/dist/geoarrow/index.d.ts.map +1 -1
- package/dist/geoarrow/index.js +0 -1
- package/dist/geoarrow/index.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +8 -9
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.d.ts.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +5 -9
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs.map +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts.map +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.cjs +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts.map +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
- package/dist/index.cjs +486 -410
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +20 -9
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +55 -45
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode.d.ts +1 -1
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +11 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +3 -2
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +3 -3
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +15 -19
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +7 -3
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +15 -67
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/loader-options.d.ts +6 -0
- package/dist/lib/api/loader-options.d.ts.map +1 -1
- package/dist/lib/api/loader-options.js +48 -0
- package/dist/lib/api/loader-options.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +5 -3
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +8 -6
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +5 -3
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +60 -9
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +5 -3
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +3 -4
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +5 -3
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +22 -14
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts +4 -2
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +47 -53
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/api/select-source.js +1 -1
- package/dist/lib/api/select-source.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -37
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -63
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
- package/dist/lib/loader-utils/native-arrow.js +66 -0
- package/dist/lib/loader-utils/native-arrow.js.map +1 -0
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +9 -10
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +31 -114
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +257 -88
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +9 -4
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +5 -3
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +32 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +5 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js +13 -5
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +48 -3
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +12 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +22 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +17 -11
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +53 -32
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +3 -13
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +2 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts +6 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.js +32 -14
- package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +26 -15
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +114 -87
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +7 -5
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +9 -1
- package/dist/loader-utils/source-types.js.map +1 -1
- package/dist/loader-utils/tile-grid.cjs +21 -9
- package/dist/loader-utils/tile-grid.cjs.map +1 -1
- package/dist/null-loader.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/polyfills/index.cjs +3 -2
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +2 -2
- package/dist/polyfills/index.js.map +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +36 -12
- package/dist/scan/arrow-execution/expressions.cjs.map +3 -3
- package/dist/scan/arrow-execution/expressions.d.ts +7 -4
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +32 -6
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +3 -18
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +2 -2
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +3 -9
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs +41 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs.map +7 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts +5 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts.map +1 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js +23 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs +6 -2
- package/dist/scan/arrow-query.cjs.map +2 -2
- package/dist/scan/arrow-query.d.ts +3 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/arrow-query.js +3 -1
- package/dist/scan/arrow-query.js.map +1 -1
- package/dist/scan/federated-table-scan-source.cjs +38 -39
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +5 -9
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +35 -36
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +36 -12
- package/dist/scan/index.cjs.map +3 -3
- package/dist/scan/index.d.ts +11 -6
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +8 -5
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +2 -2
- package/dist/scan/parse-sql-predicate.cjs.map +2 -2
- package/dist/scan/parse-sql-predicate.js +1 -1
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.cjs +60 -26
- package/dist/scan/query-arrow-table-in-batches.cjs.map +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.js +52 -24
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -1
- package/dist/{geoarrow/get-geoarrow-native-geometry.cjs → scan/query-arrow-table-math.cjs} +18 -8
- package/dist/scan/query-arrow-table-math.cjs.map +7 -0
- package/dist/scan/query-arrow-table-math.d.ts +5 -0
- package/dist/scan/query-arrow-table-math.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-math.js +14 -0
- package/dist/scan/query-arrow-table-math.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +32 -62
- package/dist/scan/query-arrow-table.cjs.map +2 -2
- package/dist/scan/query-arrow-table.d.ts +13 -8
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +35 -67
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-grouped-sql.cjs +66 -0
- package/dist/scan/query-grouped-sql.cjs.map +7 -0
- package/dist/scan/query-grouped-sql.d.ts +5 -0
- package/dist/scan/query-grouped-sql.d.ts.map +1 -0
- package/dist/scan/query-grouped-sql.js +58 -0
- package/dist/scan/query-grouped-sql.js.map +1 -0
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +190 -0
- package/dist/scan/query-progressive.cjs.map +7 -0
- package/dist/scan/query-progressive.d.ts +41 -0
- package/dist/scan/query-progressive.d.ts.map +1 -0
- package/dist/scan/query-progressive.js +173 -0
- package/dist/scan/query-progressive.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +195 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +47 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +201 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +141 -92
- package/dist/scan/query.cjs.map +3 -3
- package/dist/scan/query.d.ts +37 -10
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +137 -96
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/float16.js +1 -1
- package/dist/schema/float16.js.map +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
- package/dist/schema/geometry/geoarrow.d.ts +2 -2
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs +14 -10
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +410 -626
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -6
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/data-type.js +1 -1
- package/dist/schema-utils/lib/schema/data-type.js.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +7 -3
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +15 -76
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +241 -291
- package/dist/vector-table-scan-source.cjs.map +2 -2
- package/dist/wkt/index.cjs.map +1 -1
- package/dist/wkt/index.d.ts.map +1 -1
- package/dist/wkt/index.js.map +1 -1
- package/dist/worker-utils/index.cjs +51 -11
- package/dist/worker-utils/index.cjs.map +3 -3
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js +2 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
- package/dist/worker-utils/lib/npm-tag.js.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +4 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +2 -2
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js.map +1 -1
- package/dist/worker-utils/null-worker.js.map +1 -1
- package/package.json +102 -12
- package/src/arrow-geometry/binary-features.ts +4 -1
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +32 -21
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.ts +3 -1
- package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
- package/src/arrow-geometry/wkb-builder.ts +2 -2
- package/src/arrow-geometry/wkb-statistics.ts +2 -2
- package/src/arrow-worker-transport.ts +89 -50
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geo-column/geo-column.ts +1 -1
- package/src/geoarrow/geoarrow-bounds.ts +3 -3
- package/src/geoarrow/geoarrow-capabilities.ts +1 -1
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +12 -15
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +15 -15
- package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
- package/src/geoarrow/index.ts +0 -2
- package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
- package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +8 -12
- package/src/geoarrow/lib/geoarrow/geoarrow-union-kind.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
- package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
- package/src/geoarrow/lib/kernels/geoarrow-union.ts +1 -1
- package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +4 -3
- package/src/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/geoarrow/mesharrow/get-deck-binary-data.ts +1 -1
- package/src/geoarrow/mesharrow/mesh-accessors.ts +1 -1
- package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
- package/src/index.ts +2 -6
- package/src/lib/api/create-data-source.ts +148 -58
- package/src/lib/api/encode.ts +14 -3
- package/src/lib/api/load-in-batches.ts +15 -7
- package/src/lib/api/load-loader.ts +22 -21
- package/src/lib/api/load.ts +51 -127
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +32 -22
- package/src/lib/api/parse-in-batches.ts +121 -20
- package/src/lib/api/parse-sync.ts +30 -16
- package/src/lib/api/parse.ts +46 -29
- package/src/lib/api/select-loader.ts +54 -69
- package/src/lib/api/select-source.ts +7 -1
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +2 -70
- package/src/lib/loader-utils/native-arrow.ts +83 -0
- package/src/lib/loader-utils/option-defaults.ts +9 -10
- package/src/lib/loader-utils/option-utils.ts +33 -122
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +19 -3
- package/src/loader-utils/lib/log-utils/log.ts +36 -1
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/logical-table-query.ts +18 -8
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +68 -6
- package/src/loader-utils/lib/scan-utils/table-query.ts +28 -1
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +88 -56
- package/src/loader-utils/lib/sources/data-source.ts +3 -15
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- package/src/loader-utils/lib/sources/table-source-collection.ts +2 -1
- package/src/loader-utils/lib/sources/tile-grid.ts +34 -18
- package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +27 -18
- package/src/loader-utils/loader-types.ts +186 -107
- package/src/loader-utils/source-types.ts +17 -6
- package/src/null-loader.ts +1 -20
- package/src/polyfills/index.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +42 -7
- package/src/scan/arrow-execution/filter-arrow-table.ts +3 -18
- package/src/scan/arrow-execution/portable-predicate-compatibility.ts +27 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -1
- package/src/scan/federated-table-scan-source.ts +48 -59
- package/src/scan/index.ts +41 -11
- package/src/scan/parse-sql-predicate.ts +1 -1
- package/src/scan/query-arrow-table-in-batches.ts +62 -33
- package/src/scan/query-arrow-table-math.ts +23 -0
- package/src/scan/query-arrow-table.ts +62 -97
- package/src/scan/query-grouped-sql.ts +69 -0
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +230 -0
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +254 -127
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +7 -7
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/float16.ts +1 -1
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +2 -2
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +20 -11
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/data-type.ts +1 -1
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +29 -96
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/wkt/index.ts +1 -1
- package/src/worker-utils/lib/library-utils/library-utils.ts +2 -1
- package/src/worker-utils/lib/npm-tag.ts +1 -1
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +7 -4
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
- package/dist/arrow-geometry/native-geometry.cjs +0 -215
- package/dist/arrow-geometry/native-geometry.cjs.map +0 -7
- package/dist/arrow-geometry/native-geometry.d.ts +0 -41
- package/dist/arrow-geometry/native-geometry.d.ts.map +0 -1
- package/dist/arrow-geometry/native-geometry.js +0 -224
- package/dist/arrow-geometry/native-geometry.js.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.cjs.map +0 -7
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts +0 -2
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.js +0 -5
- package/dist/geoarrow/get-geoarrow-native-geometry.js.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs +0 -290
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs.map +0 -7
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts +0 -16
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js +0 -334
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +0 -5
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/src/arrow-geometry/native-geometry.ts +0 -278
- package/src/geoarrow/get-geoarrow-native-geometry.ts +0 -8
- package/src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts +0 -373
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
|
@@ -1,73 +1,43 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { Table } from 'apache-arrow';
|
|
5
|
+
import { ArrowTableBuilder } from "./arrow-table-builder.js";
|
|
6
|
+
import { convertArrowToTable } from "../tables/convert-arrow-table.js";
|
|
7
|
+
import { convertToArrayRow, convertToObjectRow, inferHeadersFromArrayRow, inferHeadersFromObjectRow } from "../tables/row-utils.js";
|
|
8
8
|
const DEFAULT_OPTIONS = {
|
|
9
9
|
shape: undefined,
|
|
10
|
-
batchSize: 'auto'
|
|
11
|
-
batchDebounceMs: 0,
|
|
12
|
-
limit: 0,
|
|
13
|
-
_limitMB: 0
|
|
10
|
+
batchSize: 'auto'
|
|
14
11
|
};
|
|
15
12
|
/** Incrementally builds batches from a stream of rows */
|
|
16
13
|
export class TableBatchBuilder {
|
|
17
14
|
schema;
|
|
18
15
|
options;
|
|
19
|
-
|
|
16
|
+
/** Persistent Arrow builders for typed output. */
|
|
17
|
+
arrowBuilder = null;
|
|
18
|
+
/** Rows retained for explicit raw output, including schema-less JSON. */
|
|
19
|
+
rows = [];
|
|
20
20
|
batchCount = 0;
|
|
21
21
|
bytesUsed = 0;
|
|
22
22
|
isChunkComplete = false;
|
|
23
|
-
lastBatchEmittedMs = Date.now();
|
|
24
|
-
totalLength = 0;
|
|
25
|
-
totalBytes = 0;
|
|
26
|
-
rowBytes = 0;
|
|
27
|
-
static ArrowBatch;
|
|
28
23
|
constructor(schema, options) {
|
|
29
24
|
this.schema = schema;
|
|
30
25
|
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
31
26
|
}
|
|
32
|
-
limitReached() {
|
|
33
|
-
if (Boolean(this.options?.limit) && this.totalLength >= this.options.limit) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
if (Boolean(this.options?._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
27
|
/** @deprecated Use addArrayRow or addObjectRow */
|
|
42
28
|
addRow(row) {
|
|
43
|
-
if (this.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
if (this.options.shape === 'columnar-table') {
|
|
30
|
+
this.arrowBuilder ??= new ArrowTableBuilder(this.schema);
|
|
31
|
+
if (Array.isArray(row)) {
|
|
32
|
+
this.arrowBuilder.addArrayRow(row);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
this.arrowBuilder.addObjectRow(row);
|
|
36
|
+
}
|
|
51
37
|
}
|
|
52
38
|
else {
|
|
53
|
-
this.
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/** Add one row to the batch */
|
|
57
|
-
addArrayRow(row) {
|
|
58
|
-
if (!this.aggregator) {
|
|
59
|
-
const TableBatchType = this._getTableBatchType();
|
|
60
|
-
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
39
|
+
this.rows.push(row);
|
|
61
40
|
}
|
|
62
|
-
this.aggregator.addArrayRow(row);
|
|
63
|
-
}
|
|
64
|
-
/** Add one row to the batch */
|
|
65
|
-
addObjectRow(row) {
|
|
66
|
-
if (!this.aggregator) {
|
|
67
|
-
const TableBatchType = this._getTableBatchType();
|
|
68
|
-
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
69
|
-
}
|
|
70
|
-
this.aggregator.addObjectRow(row);
|
|
71
41
|
}
|
|
72
42
|
/** Mark an incoming raw memory chunk has completed */
|
|
73
43
|
chunkComplete(chunk) {
|
|
@@ -86,12 +56,9 @@ export class TableBatchBuilder {
|
|
|
86
56
|
return this._getBatch(options);
|
|
87
57
|
}
|
|
88
58
|
// INTERNAL
|
|
89
|
-
_estimateRowMB(row) {
|
|
90
|
-
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;
|
|
91
|
-
}
|
|
92
59
|
_isFull() {
|
|
93
60
|
// No batch, not ready
|
|
94
|
-
if (
|
|
61
|
+
if (this.rowCount() === 0) {
|
|
95
62
|
return false;
|
|
96
63
|
}
|
|
97
64
|
// if batchSize === 'auto' we wait for chunk to complete
|
|
@@ -101,49 +68,70 @@ export class TableBatchBuilder {
|
|
|
101
68
|
return false;
|
|
102
69
|
}
|
|
103
70
|
}
|
|
104
|
-
else if (this.options.batchSize > this.
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
// Debounce batches
|
|
108
|
-
if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {
|
|
71
|
+
else if (this.options.batchSize > this.rowCount()) {
|
|
109
72
|
return false;
|
|
110
73
|
}
|
|
111
74
|
// Emit batch
|
|
112
75
|
this.isChunkComplete = false;
|
|
113
|
-
this.lastBatchEmittedMs = Date.now();
|
|
114
76
|
return true;
|
|
115
77
|
}
|
|
116
78
|
/**
|
|
117
79
|
* bytesUsed can be set via chunkComplete or via getBatch*
|
|
118
80
|
*/
|
|
119
81
|
_getBatch(options) {
|
|
120
|
-
if (
|
|
82
|
+
if (this.rowCount() === 0) {
|
|
121
83
|
return null;
|
|
122
84
|
}
|
|
123
85
|
// TODO - this can overly increment bytes used?
|
|
124
86
|
if (options?.bytesUsed) {
|
|
125
87
|
this.bytesUsed = options.bytesUsed;
|
|
126
88
|
}
|
|
127
|
-
const normalizedBatch = this.
|
|
89
|
+
const normalizedBatch = this.takeBatch();
|
|
128
90
|
normalizedBatch.count = this.batchCount;
|
|
129
91
|
normalizedBatch.bytesUsed = this.bytesUsed;
|
|
130
92
|
Object.assign(normalizedBatch, options);
|
|
131
93
|
this.batchCount++;
|
|
132
|
-
this.aggregator = null;
|
|
133
94
|
return normalizedBatch;
|
|
134
95
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
96
|
+
/** Returns the number of rows buffered for the next batch. */
|
|
97
|
+
rowCount() {
|
|
98
|
+
return this.arrowBuilder?.length ?? this.rows.length;
|
|
99
|
+
}
|
|
100
|
+
/** Flushes typed output or takes ownership of the buffered raw rows. */
|
|
101
|
+
takeBatch() {
|
|
102
|
+
if (this.arrowBuilder) {
|
|
103
|
+
const batch = this.arrowBuilder.flushBatch();
|
|
104
|
+
return {
|
|
105
|
+
...convertArrowToTable(new Table(batch), 'columnar-table'),
|
|
106
|
+
schema: structuredClone(this.schema),
|
|
107
|
+
batchType: 'data',
|
|
108
|
+
length: batch.numRows
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const rows = this.rows;
|
|
112
|
+
this.rows = [];
|
|
113
|
+
const shape = this.options.shape ?? (Array.isArray(rows[0]) ? 'array-row-table' : 'object-row-table');
|
|
114
|
+
const firstRow = rows[0];
|
|
115
|
+
const fieldNames = this.schema?.fields.map(field => field.name) ??
|
|
116
|
+
(Array.isArray(firstRow)
|
|
117
|
+
? inferHeadersFromArrayRow(firstRow)
|
|
118
|
+
: inferHeadersFromObjectRow(firstRow));
|
|
119
|
+
if (shape === 'array-row-table') {
|
|
120
|
+
return {
|
|
121
|
+
shape,
|
|
122
|
+
batchType: 'data',
|
|
123
|
+
data: rows.map(row => (Array.isArray(row) ? row : convertToArrayRow(row, fieldNames))),
|
|
124
|
+
schema: this.schema,
|
|
125
|
+
length: rows.length
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
shape: 'object-row-table',
|
|
130
|
+
batchType: 'data',
|
|
131
|
+
data: rows.map(row => (Array.isArray(row) ? convertToObjectRow(row, fieldNames) : row)),
|
|
132
|
+
schema: this.schema,
|
|
133
|
+
length: rows.length
|
|
134
|
+
};
|
|
147
135
|
}
|
|
148
136
|
}
|
|
149
137
|
//# sourceMappingURL=table-batch-builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-batch-builder.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batch-builder/table-batch-builder.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"table-batch-builder.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batch-builder/table-batch-builder.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAC,iBAAiB,EAAC,iCAA8B;AACxD,OAAO,EAAC,mBAAmB,EAAC,yCAAsC;AAClE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EAC1B,+BAA4B;AAa7B,MAAM,eAAe,GAAuC;IAC1D,KAAK,EAAE,SAAU;IACjB,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,yDAAyD;AACzD,MAAM,OAAO,iBAAiB;IAC5B,MAAM,CAAS;IACf,OAAO,CAAqC;IAE5C,kDAAkD;IAC1C,YAAY,GAA6B,IAAI,CAAC;IACtD,yEAAyE;IACjE,IAAI,GAAoC,EAAE,CAAC;IAC3C,UAAU,GAAW,CAAC,CAAC;IACvB,SAAS,GAAW,CAAC,CAAC;IACtB,eAAe,GAAY,KAAK,CAAC;IAEzC,YAAY,MAAc,EAAE,OAAkC;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,EAAC,GAAG,eAAe,EAAE,GAAG,OAAO,EAAC,CAAC;IAClD,CAAC;IAED,kDAAkD;IAClD,MAAM,CAAC,GAAwC;QAC7C,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,KAAK,gBAAgB,EAAE,CAAC;YAC5C,IAAI,CAAC,YAAY,KAAK,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACzD,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,YAAY,CAAC,YAAY,CA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ch, ObjectRowTableBatch, ColumnarTableBatch
|
|
1
|
+
import type { TableBatch, ArrayRowTableBatch, ObjectRowTableBatch, ColumnarTableBatch } from '@loaders.gl/core/schema';
|
|
2
|
+
import * as arrow from 'apache-arrow';
|
|
2
3
|
export declare function convertBatch(batches: TableBatch, shape: 'object-row-table'): ObjectRowTableBatch;
|
|
3
4
|
export declare function convertBatch(batches: TableBatch, shape: 'array-row-table'): ArrayRowTableBatch;
|
|
4
5
|
export declare function convertBatch(batches: TableBatch, shape: 'columnar-table'): ColumnarTableBatch;
|
|
5
|
-
export declare function convertBatch(
|
|
6
|
+
export declare function convertBatch(batch: TableBatch | arrow.RecordBatch, shape: 'arrow'): arrow.RecordBatch;
|
|
6
7
|
export declare function convertBatches(batches: Iterable<TableBatch> | AsyncIterable<TableBatch>, shape: 'object-row-table'): AsyncIterableIterator<ObjectRowTableBatch>;
|
|
7
8
|
export declare function convertBatches(batches: Iterable<TableBatch> | AsyncIterable<TableBatch>, shape: 'array-row-table'): AsyncIterableIterator<ArrayRowTableBatch>;
|
|
8
9
|
export declare function convertBatches(batches: Iterable<TableBatch> | AsyncIterable<TableBatch>, shape: 'columnar-table'): AsyncIterableIterator<ColumnarTableBatch>;
|
|
9
|
-
export declare function convertBatches(batches: Iterable<TableBatch> | AsyncIterable<TableBatch>, shape: 'arrow
|
|
10
|
+
export declare function convertBatches(batches: Iterable<TableBatch | arrow.RecordBatch> | AsyncIterable<TableBatch | arrow.RecordBatch>, shape: 'arrow'): AsyncIterableIterator<arrow.RecordBatch>;
|
|
10
11
|
//# sourceMappingURL=convert-batches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"convert-batches.d.ts","sourceR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AAC,EACjG,KAAK,EAAE,OAAO,GACb,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { isArrowRecordBatch } from "../../../../lib/loader-utils/native-arrow.js";
|
|
5
|
+
import { makeArrowMetadataBatch } from "../../arrow/arrow-metadata.js";
|
|
4
6
|
import { convertTable } from "../tables/convert-table.js";
|
|
5
|
-
/**
|
|
7
|
+
/** Converts one portable batch or returns the supplied native record batch. */
|
|
6
8
|
export function convertBatch(batch, shape) {
|
|
9
|
+
if (isArrowRecordBatch(batch)) {
|
|
10
|
+
if (shape === 'arrow')
|
|
11
|
+
return batch;
|
|
12
|
+
throw new Error('Convert a native RecordBatch as a table to select a row or column layout');
|
|
13
|
+
}
|
|
7
14
|
switch (shape) {
|
|
8
15
|
case 'object-row-table':
|
|
9
16
|
return { ...batch, ...convertTable(batch, 'object-row-table') };
|
|
@@ -11,20 +18,26 @@ export function convertBatch(batch, shape) {
|
|
|
11
18
|
return { ...batch, ...convertTable(batch, 'array-row-table') };
|
|
12
19
|
case 'columnar-table':
|
|
13
20
|
return { ...batch, ...convertTable(batch, 'columnar-table') };
|
|
14
|
-
case 'arrow
|
|
15
|
-
|
|
21
|
+
case 'arrow': {
|
|
22
|
+
const table = convertTable(batch, 'arrow');
|
|
23
|
+
return table.batches[0] ?? makeArrowMetadataBatch(table.schema);
|
|
24
|
+
}
|
|
16
25
|
default:
|
|
17
26
|
throw new Error(shape);
|
|
18
27
|
}
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param shape
|
|
24
|
-
* @returns
|
|
30
|
+
* Converts batches in emission order. For Arrow output, yields native record batches,
|
|
31
|
+
* preserving the declared schema of empty inputs.
|
|
25
32
|
*/
|
|
26
33
|
export async function* convertBatches(batches, shape) {
|
|
27
34
|
for await (const batch of batches) {
|
|
35
|
+
if (isArrowRecordBatch(batch)) {
|
|
36
|
+
if (shape !== 'arrow')
|
|
37
|
+
throw new Error('Expected a loaders.gl table batch');
|
|
38
|
+
yield batch;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
28
41
|
switch (shape) {
|
|
29
42
|
case 'object-row-table':
|
|
30
43
|
yield convertBatch(batch, 'object-row-table');
|
|
@@ -35,9 +48,14 @@ export async function* convertBatches(batches, shape) {
|
|
|
35
48
|
case 'columnar-table':
|
|
36
49
|
yield convertBatch(batch, 'columnar-table');
|
|
37
50
|
break;
|
|
38
|
-
case 'arrow
|
|
39
|
-
|
|
51
|
+
case 'arrow': {
|
|
52
|
+
const table = convertTable(batch, 'arrow');
|
|
53
|
+
if (table.batches.length)
|
|
54
|
+
yield* table.batches;
|
|
55
|
+
else
|
|
56
|
+
yield makeArrowMetadataBatch(table.schema);
|
|
40
57
|
break;
|
|
58
|
+
}
|
|
41
59
|
default:
|
|
42
60
|
throw new Error(shape);
|
|
43
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AASpC,OAAO,EAAC,YAAY,EAAC,mCAAgC;
|
|
1
|
+
{"version":3,"file":"convert-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AASpC,OAAO,EAAC,kBAAkB,EAAC,qDAAkD;AAC7E,OAAO,EAAC,sBAAsB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,mCAAgC;AAUrD,+EAA+E;AAC/E,MAAM,UAAU,YAAY,CAC1B,KAAqC,EACrC,KAA0E;IAE1E,IAAI,kBAAkB,CAAC,KA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,CAAC;gBAC9C,MAAM;YACR,KAAK,iBAAiB;gBACpB,MAAM,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;gBAC7C,MAAM;YACR,KAAK,gBAAgB;gBACnB,MAAM,YAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;gBAC5C,MAAM;YACR,KAAK,OAAO,CAAC,CAAC,CAAC;gBACb,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM;oBAAE,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;;oBAC1C,MAAM,sBAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAChD,MAAM;YACR,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import * as arrow from 'apache-arrow';
|
|
2
|
-
import type { Table
|
|
3
|
-
/**
|
|
4
|
-
* Returns an iterator that yields a single table as a sequence of ArrowTable batches.
|
|
5
|
-
* @note All batches will have the same shape and schema as the original table.
|
|
6
|
-
*/
|
|
7
|
-
export declare function makeArrowTableBatchIterator(table: Table, options?: {
|
|
8
|
-
batchSize?: number;
|
|
9
|
-
}): IterableIterator<ArrowTableBatch>;
|
|
2
|
+
import type { Table } from '@loaders.gl/core/schema';
|
|
10
3
|
/**
|
|
11
4
|
* Returns an iterator that yields a single table as a sequence of arrow.RecordBatch batches.
|
|
12
5
|
* @note All batches will have the same shape and schema as the original table.
|
|
13
6
|
*/
|
|
14
|
-
export declare function makeArrowRecordBatchIterator(table: Table, options?: {
|
|
7
|
+
export declare function makeArrowRecordBatchIterator(table: Table | arrow.Table, options?: {
|
|
8
|
+
batchSize?: number;
|
|
9
|
+
}): IterableIterator<arrow.RecordBatch>;
|
|
10
|
+
/** Converts loaders.gl table representations to record batches. */
|
|
11
|
+
export declare function makePortableTableRecordBatchIterator(table: Table, options?: {
|
|
15
12
|
batchSize?: number;
|
|
16
13
|
}): IterableIterator<arrow.RecordBatch>;
|
|
17
14
|
//# sourceMappingURL=make-arrow-batch-iterator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-arrow-batch-iterator.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"make-arrow-batch-iterator.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAwBnD;;;GAGG;AACH,wBAAiB,4BAA4B,CAC3C,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAC1B,OAAO,CAAC,EAAE;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,GAC7B,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAMrC;AAED,mEAAmE;AACnE,wBAAiB,oCAAoC,CACnD,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,GAC7B,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CA0CrC"}
|
|
@@ -4,21 +4,20 @@
|
|
|
4
4
|
import * as arrow from 'apache-arrow';
|
|
5
5
|
import { convertSchemaToArrow } from "../../schema/convert-arrow-schema.js";
|
|
6
6
|
import { getTableLength, getTableNumCols, getTableCellAt } from "../tables/table-accessors.js";
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (const batch of
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
7
|
+
/** Streams native Arrow batches, splitting existing batches without rebuilding columns. */
|
|
8
|
+
function* sliceNativeArrowBatches(table, batchSize) {
|
|
9
|
+
if (batchSize !== undefined && (!Number.isSafeInteger(batchSize) || batchSize < 1)) {
|
|
10
|
+
throw new RangeError('batchSize must be a positive integer');
|
|
11
|
+
}
|
|
12
|
+
for (const batch of table.batches) {
|
|
13
|
+
if (batchSize === undefined || batch.numRows <= batchSize) {
|
|
14
|
+
yield batch;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
for (let offset = 0; offset < batch.numRows; offset += batchSize) {
|
|
18
|
+
yield batch.slice(offset, offset + batchSize);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
@@ -26,6 +25,14 @@ export function* makeArrowTableBatchIterator(table, options) {
|
|
|
26
25
|
* @note All batches will have the same shape and schema as the original table.
|
|
27
26
|
*/
|
|
28
27
|
export function* makeArrowRecordBatchIterator(table, options) {
|
|
28
|
+
if (!('shape' in table)) {
|
|
29
|
+
yield* sliceNativeArrowBatches(table, options?.batchSize);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
yield* makePortableTableRecordBatchIterator(table, options);
|
|
33
|
+
}
|
|
34
|
+
/** Converts loaders.gl table representations to record batches. */
|
|
35
|
+
export function* makePortableTableRecordBatchIterator(table, options) {
|
|
29
36
|
const arrowSchema = convertSchemaToArrow(table.schema);
|
|
30
37
|
const length = getTableLength(table);
|
|
31
38
|
const numColumns = getTableNumCols(table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-arrow-batch-iterator.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AACvE,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,cAAc,EAAC,qCAAkC;AAE1F
|
|
1
|
+
{"version":3,"file":"make-arrow-batch-iterator.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AACvE,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,cAAc,EAAC,qCAAkC;AAE1F,2FAA2F;AAC3F,QAAQ,CAAC,CAAC,uBAAuB,CAC/B,KAAkB,EAClB,SAAkB;IAElB,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,IAAI,UAAU,CAAC,sCAAsC,CAAC,CAAC;IAC/D,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClC,IAAI,SAAS,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,IAAI,SAAS,EAAE,CAAC;YAC1D,MAAM,KAAK,CAAC;QACd,CAAC;aAAM,CAAC;YACN,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,CAAC;gBACjE,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,SAAS,CAAC,CAAC,4BAA4B,C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WAAW,CAAC,CAAC;YACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;QAED,WAAW,EAAE,CAAC;QAEd,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;YACvD,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YACpF,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;YACrD,WAAW,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACrD,WAAW,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { TableBatch, Table } from '@loaders.gl/core/schema';
|
|
2
|
+
import type * as arrow from 'apache-arrow';
|
|
2
3
|
/**
|
|
3
4
|
* Assembles all batches from an async iterator into a single table.
|
|
4
|
-
*
|
|
5
|
+
* All batches must have the same shape and compatible schemas. A native RecordBatch stream
|
|
6
|
+
* produces a native Arrow table with metadata refined in emission order.
|
|
5
7
|
* @param batchIterator
|
|
6
8
|
* @returns `null` if no batches are yielded by the async iterator
|
|
7
9
|
*/
|
|
10
|
+
export declare function makeTableFromBatches(batchIterator: AsyncIterable<arrow.RecordBatch> | Iterable<arrow.RecordBatch>): Promise<arrow.Table | null>;
|
|
8
11
|
export declare function makeTableFromBatches(batchIterator: AsyncIterable<TableBatch> | Iterable<TableBatch>): Promise<Table | null>;
|
|
9
12
|
//# sourceMappingURL=make-table-from-batches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table-from-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EACV,KAAK,EAIN,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"make-table-from-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EACV,KAAK,EAIN,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAK3C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAC5E,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;AAC/B,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,GAC9D,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { makeArrowTableFromBatches } from "../../arrow/arrow-metadata.js";
|
|
5
|
+
import { isArrowRecordBatch } from "../../../../lib/loader-utils/native-arrow.js";
|
|
4
6
|
import { getTableLength } from "../tables/table-accessors.js";
|
|
5
|
-
/**
|
|
6
|
-
* Assembles all batches from an async iterator into a single table.
|
|
7
|
-
* @note All batches must have the same shape and schema
|
|
8
|
-
* @param batchIterator
|
|
9
|
-
* @returns `null` if no batches are yielded by the async iterator
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line complexity
|
|
12
7
|
export async function makeTableFromBatches(batchIterator) {
|
|
13
8
|
let arrayRows;
|
|
14
9
|
let objectRows;
|
|
15
10
|
let features;
|
|
16
11
|
let shape = null;
|
|
17
12
|
let schema;
|
|
13
|
+
const arrowBatches = [];
|
|
18
14
|
for await (const batch of batchIterator) {
|
|
19
|
-
|
|
15
|
+
const batchShape = isArrowRecordBatch(batch) ? 'arrow' : batch.shape;
|
|
16
|
+
shape ??= batchShape;
|
|
17
|
+
if (shape !== batchShape)
|
|
18
|
+
throw new Error('Batches must have the same shape');
|
|
19
|
+
if (isArrowRecordBatch(batch)) {
|
|
20
|
+
arrowBatches.push(batch);
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
20
23
|
schema = schema || batch.schema;
|
|
21
24
|
switch (batch.shape) {
|
|
22
25
|
case 'array-row-table':
|
|
@@ -41,7 +44,6 @@ export async function makeTableFromBatches(batchIterator) {
|
|
|
41
44
|
}
|
|
42
45
|
break;
|
|
43
46
|
case 'columnar-table':
|
|
44
|
-
case 'arrow-table':
|
|
45
47
|
default:
|
|
46
48
|
throw new Error('shape');
|
|
47
49
|
}
|
|
@@ -50,6 +52,8 @@ export async function makeTableFromBatches(batchIterator) {
|
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
54
|
switch (shape) {
|
|
55
|
+
case 'arrow':
|
|
56
|
+
return makeArrowTableFromBatches(arrowBatches);
|
|
53
57
|
case 'array-row-table':
|
|
54
58
|
return { shape: 'array-row-table', data: arrayRows, schema };
|
|
55
59
|
case 'object-row-table':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table-from-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"make-table-from-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAWpC,OAAO,EAAC,yBAAyB,EAAC,sCAAmC;AACrE,OAAO,EAAC,kBAAkB,EAAC,qDAAkD;AAC7E,OAAO,EAAC,cAAc,EAAC,qCAAkC;AAezD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,aAE4C;IAE5C,IAAI,SAAgC,CAAC;IACrC,IAAI,UAAkC,CAAC;IACvC,IAAI,QAAmB,CAAC;IACxB,IAAI,KAAK,GAAoC,IAAI,CAAC;IAClD,IAAI,MAA0B,CAAC;IAC/B,MAAM,YAAY,GAAwB,EAAE,CAAC;IAE7C,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,aAAa,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;QACrE,KAAK,KAAK,UAAU,CAAC;QACrB,IAAI,KAAK,KAAK,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QAC9E,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACzB,SAAS;QACX,CAAC;QACD,MAAM,GAAG,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC;QAEhC,QAAQ,KAAK,CAAC,KAAK,EAAE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QACjD,KAAK,iBAAiB;YACpB,OAAO,EAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAU,EAAE,MAAM,EAAC,CAAC;QAE9D,KAAK,kBAAkB;YACrB,OAAO,EAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,UAAW,EAAE,MAAM,EAAC,CAAC;QAEhE,KAAK,eAAe;YAClB,OAAO,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAS,EAAE,MAAM,EAAC,CAAC;QAE1F;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as arrow from 'apache-arrow';
|
|
2
2
|
/** Portable options for applying a residual query to an Arrow table. */
|
|
3
3
|
export type ArrowTableQueryOptions<PredicateT = unknown> = Readonly<{
|
|
4
4
|
/** Predicate evaluated against all source columns before projection. */
|
|
@@ -17,7 +17,7 @@ export type ArrowTableRowFilter<PredicateT = unknown> = (predicate: PredicateT,
|
|
|
17
17
|
* predicate evaluator. Predicate columns are materialized independently from the projection,
|
|
18
18
|
* allowing WHERE columns that are not returned to the caller.
|
|
19
19
|
*/
|
|
20
|
-
export declare function queryArrowTable<PredicateT = unknown>(table:
|
|
20
|
+
export declare function queryArrowTable<PredicateT = unknown>(table: arrow.Table, options?: ArrowTableQueryOptions<PredicateT>, filterRows?: ArrowTableRowFilter<PredicateT>): arrow.Table;
|
|
21
21
|
/** Selects rows from an Arrow table while preserving the requested column order. */
|
|
22
|
-
export declare function selectArrowTableRows(table:
|
|
22
|
+
export declare function selectArrowTableRows(table: arrow.Table, rowIndices: readonly number[], columns?: readonly string[], limit?: number): arrow.Table;
|
|
23
23
|
//# sourceMappingURL=query-arrow-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-arrow-table.d.ts","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query-arrow-table.d.ts","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,wEAAwE;AACxE,MAAM,MAAM,sBAAsB,CAAC,UAAU,GAAG,OAAO,IAAI,QAAQ,CAAC;IAClE,wEAAwE;IACxE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,gFAAgF;IAChF,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,CAAC,UAAU,GAAG,OAAO,IAAI,CACtD,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAClC,QAAQ,EAAE,MAAM,KACb,SAAS,MAAM,EAAE,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAG,OAAO,EAClD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,GAAE,sBAAsB,CAAC,UAAU,CAAM,EAChD,UAAU,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAC3C,KAAK,CAAC,KAAK,CAwBb;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,KAAK,CAAC,KAAK,CAUb"}
|
|
@@ -10,7 +10,7 @@ import * as arrow from 'apache-arrow';
|
|
|
10
10
|
* allowing WHERE columns that are not returned to the caller.
|
|
11
11
|
*/
|
|
12
12
|
export function queryArrowTable(table, options = {}, filterRows) {
|
|
13
|
-
const availableColumns = table.
|
|
13
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
14
14
|
const selectedColumns = options.columns ? [...options.columns] : availableColumns;
|
|
15
15
|
for (const columnName of selectedColumns) {
|
|
16
16
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -21,26 +21,19 @@ export function queryArrowTable(table, options = {}, filterRows) {
|
|
|
21
21
|
if (options.predicate !== undefined) {
|
|
22
22
|
if (!filterRows)
|
|
23
23
|
throw new Error('Arrow table query requires a predicate evaluator.');
|
|
24
|
-
const columns = Object.fromEntries(availableColumns.map(name => [name, [...(table.
|
|
25
|
-
rowIndices = filterRows(options.predicate, columns, table.
|
|
24
|
+
const columns = Object.fromEntries(availableColumns.map(name => [name, [...(table.getChild(name) || [])]]));
|
|
25
|
+
rowIndices = filterRows(options.predicate, columns, table.numRows);
|
|
26
26
|
}
|
|
27
27
|
const limitedRowIndices = rowIndices
|
|
28
28
|
? rowIndices.slice(0, options.limit ?? Number.POSITIVE_INFINITY)
|
|
29
29
|
: undefined;
|
|
30
|
-
|
|
31
|
-
? createArrowTableFromRowIndices(table
|
|
32
|
-
: table.
|
|
33
|
-
const schema = table.schema
|
|
34
|
-
? {
|
|
35
|
-
...table.schema,
|
|
36
|
-
fields: selectedColumns.flatMap(columnName => table.schema?.fields.filter(field => field.name === columnName) || [])
|
|
37
|
-
}
|
|
38
|
-
: undefined;
|
|
39
|
-
return schema ? { shape: 'arrow-table', schema, data } : { shape: 'arrow-table', data };
|
|
30
|
+
return limitedRowIndices
|
|
31
|
+
? createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices)
|
|
32
|
+
: table.select(selectedColumns).slice(0, options.limit ?? Number.POSITIVE_INFINITY);
|
|
40
33
|
}
|
|
41
34
|
/** Selects rows from an Arrow table while preserving the requested column order. */
|
|
42
35
|
export function selectArrowTableRows(table, rowIndices, columns, limit) {
|
|
43
|
-
const availableColumns = table.
|
|
36
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
44
37
|
const selectedColumns = columns ? [...columns] : availableColumns;
|
|
45
38
|
for (const columnName of selectedColumns) {
|
|
46
39
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -48,17 +41,10 @@ export function selectArrowTableRows(table, rowIndices, columns, limit) {
|
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
const limitedRowIndices = rowIndices.slice(0, limit ?? Number.POSITIVE_INFINITY);
|
|
51
|
-
|
|
52
|
-
const schema = table.schema
|
|
53
|
-
? {
|
|
54
|
-
...table.schema,
|
|
55
|
-
fields: selectedColumns.flatMap(columnName => table.schema?.fields.filter(field => field.name === columnName) || [])
|
|
56
|
-
}
|
|
57
|
-
: undefined;
|
|
58
|
-
return schema ? { shape: 'arrow-table', schema, data } : { shape: 'arrow-table', data };
|
|
44
|
+
return createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices);
|
|
59
45
|
}
|
|
60
46
|
function createArrowTableFromRowIndices(sourceData, selectedColumns, rowIndices) {
|
|
61
|
-
const schema = new arrow.Schema(selectedColumns.map(columnName => sourceData.schema.fields.find(field => field.name === columnName)));
|
|
47
|
+
const schema = new arrow.Schema(selectedColumns.map(columnName => sourceData.schema.fields.find(field => field.name === columnName)), sourceData.schema.metadata);
|
|
62
48
|
const vectors = Object.fromEntries(selectedColumns.map(columnName => {
|
|
63
49
|
const sourceVector = sourceData.getChild(columnName);
|
|
64
50
|
return [
|