@loaders.gl/core 5.0.0-beta.8 → 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 +270 -4
- package/dist/arrow-geometry/geojson-table.cjs.map +4 -4
- package/dist/arrow-geometry/geojson-table.d.ts +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +5 -4
- 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 +198 -503
- package/dist/cluster-source.cjs.map +3 -3
- package/dist/dist.dev.js +211 -218
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +166 -531
- 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 +5 -2
- 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.js +2 -2
- 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 +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +1 -1
- 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 +1 -1
- 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.map +1 -1
- package/dist/index.cjs +203 -197
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +7 -1
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +2 -2
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/load-loader.js +1 -1
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +13 -12
- 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.map +1 -1
- package/dist/lib/api/parse-file.js +2 -5
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +55 -15
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +2 -5
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +2 -5
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +15 -24
- package/dist/lib/api/select-loader.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/native-arrow.d.ts +7 -5
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -1
- package/dist/lib/loader-utils/native-arrow.js +34 -20
- package/dist/lib/loader-utils/native-arrow.js.map +1 -1
- 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 +7 -8
- 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 +11 -105
- 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 +126 -58
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +7 -2
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +4 -2
- 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 +0 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +2 -2
- 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/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 +17 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- 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 +15 -14
- 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 +36 -22
- 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 +0 -10
- 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 +12 -15
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +19 -67
- 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 +2 -0
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +4 -0
- 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/scan/arrow-execution/expressions.cjs +32 -8
- package/dist/scan/arrow-execution/expressions.cjs.map +2 -2
- 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 +15 -6
- package/dist/scan/index.cjs.map +3 -3
- package/dist/scan/index.d.ts +9 -5
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +7 -4
- 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 +7 -8
- package/dist/scan/query-progressive.cjs.map +2 -2
- package/dist/scan/query-progressive.d.ts +5 -3
- package/dist/scan/query-progressive.d.ts.map +1 -1
- package/dist/scan/query-progressive.js +7 -8
- package/dist/scan/query-progressive.js.map +1 -1
- 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 +118 -103
- package/dist/scan/query.cjs.map +2 -2
- package/dist/scan/query.d.ts +29 -22
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +111 -111
- 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 +623 -860
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -7
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -6
- 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 +3 -1
- 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/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 -292
- 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 +4 -4
- package/dist/worker-utils/index.cjs.map +1 -1
- 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/npm-tag.d.ts.map +1 -1
- package/dist/worker-utils/lib/npm-tag.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/null-worker-node.js.map +1 -1
- package/dist/worker-utils/null-worker.js.map +1 -1
- package/package.json +102 -13
- 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 +5 -4
- 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 +5 -2
- 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 +2 -2
- 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/index.ts +1 -5
- package/src/lib/api/create-data-source.ts +15 -3
- package/src/lib/api/load-loader.ts +1 -1
- package/src/lib/api/load.ts +21 -25
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +2 -11
- package/src/lib/api/parse-in-batches.ts +81 -17
- package/src/lib/api/parse-sync.ts +3 -7
- package/src/lib/api/parse.ts +2 -6
- package/src/lib/api/select-loader.ts +15 -33
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/native-arrow.ts +38 -25
- package/src/lib/loader-utils/option-defaults.ts +7 -8
- package/src/lib/loader-utils/option-utils.ts +12 -112
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +17 -2
- package/src/loader-utils/lib/log-utils/log.ts +2 -5
- 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/scan-query-metadata.ts +68 -6
- package/src/loader-utils/lib/scan-utils/table-query.ts +18 -0
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +64 -43
- package/src/loader-utils/lib/sources/data-source.ts +0 -12
- 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 +12 -18
- package/src/loader-utils/loader-types.ts +23 -69
- package/src/loader-utils/source-types.ts +5 -0
- package/src/null-loader.ts +1 -20
- 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 +34 -10
- 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 +12 -13
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +210 -165
- 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 -16
- 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 +4 -2
- 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/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/npm-tag.ts +1 -1
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +7 -4
- 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/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts +0 -28
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js +0 -26
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.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
- package/src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts +0 -58
|
@@ -2,20 +2,21 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import {Table} from 'apache-arrow';
|
|
5
6
|
import type {Schema, TableBatch} from '@loaders.gl/core/schema';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
import {ArrowTableBuilder} from './arrow-table-builder';
|
|
8
|
+
import {convertArrowToTable} from '../tables/convert-arrow-table';
|
|
9
|
+
import {
|
|
10
|
+
convertToArrayRow,
|
|
11
|
+
convertToObjectRow,
|
|
12
|
+
inferHeadersFromArrayRow,
|
|
13
|
+
inferHeadersFromObjectRow
|
|
14
|
+
} from '../tables/row-utils';
|
|
11
15
|
|
|
12
16
|
// TODO define interface instead
|
|
13
17
|
type TableBatchBuilderOptions = {
|
|
14
|
-
shape?: 'array-row-table' | 'object-row-table' | 'columnar-table'
|
|
18
|
+
shape?: 'array-row-table' | 'object-row-table' | 'columnar-table';
|
|
15
19
|
batchSize?: number | 'auto';
|
|
16
|
-
batchDebounceMs?: number;
|
|
17
|
-
limit?: number;
|
|
18
|
-
_limitMB?: number;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
type GetBatchOptions = {
|
|
@@ -25,10 +26,7 @@ type GetBatchOptions = {
|
|
|
25
26
|
|
|
26
27
|
const DEFAULT_OPTIONS: Required<TableBatchBuilderOptions> = {
|
|
27
28
|
shape: undefined!,
|
|
28
|
-
batchSize: 'auto'
|
|
29
|
-
batchDebounceMs: 0,
|
|
30
|
-
limit: 0,
|
|
31
|
-
_limitMB: 0
|
|
29
|
+
batchSize: 'auto'
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
/** Incrementally builds batches from a stream of rows */
|
|
@@ -36,65 +34,33 @@ export class TableBatchBuilder {
|
|
|
36
34
|
schema: Schema;
|
|
37
35
|
options: Required<TableBatchBuilderOptions>;
|
|
38
36
|
|
|
39
|
-
|
|
37
|
+
/** Persistent Arrow builders for typed output. */
|
|
38
|
+
private arrowBuilder: ArrowTableBuilder | null = null;
|
|
39
|
+
/** Rows retained for explicit raw output, including schema-less JSON. */
|
|
40
|
+
private rows: (any[] | Record<string, any>)[] = [];
|
|
40
41
|
private batchCount: number = 0;
|
|
41
42
|
private bytesUsed: number = 0;
|
|
42
43
|
private isChunkComplete: boolean = false;
|
|
43
|
-
private lastBatchEmittedMs: number = Date.now();
|
|
44
|
-
private totalLength: number = 0;
|
|
45
|
-
private totalBytes: number = 0;
|
|
46
|
-
private rowBytes: number = 0;
|
|
47
|
-
|
|
48
|
-
static ArrowBatch?: TableBatchConstructor;
|
|
49
44
|
|
|
50
45
|
constructor(schema: Schema, options?: TableBatchBuilderOptions) {
|
|
51
46
|
this.schema = schema;
|
|
52
47
|
this.options = {...DEFAULT_OPTIONS, ...options};
|
|
53
48
|
}
|
|
54
49
|
|
|
55
|
-
limitReached(): boolean {
|
|
56
|
-
if (Boolean(this.options?.limit) && this.totalLength >= this.options.limit) {
|
|
57
|
-
return true;
|
|
58
|
-
}
|
|
59
|
-
if (Boolean(this.options?._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
50
|
/** @deprecated Use addArrayRow or addObjectRow */
|
|
66
51
|
addRow(row: any[] | {[columnName: string]: any}): void {
|
|
67
|
-
if (this.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.addArrayRow(row);
|
|
52
|
+
if (this.options.shape === 'columnar-table') {
|
|
53
|
+
this.arrowBuilder ??= new ArrowTableBuilder(this.schema);
|
|
54
|
+
if (Array.isArray(row)) {
|
|
55
|
+
this.arrowBuilder.addArrayRow(row);
|
|
56
|
+
} else {
|
|
57
|
+
this.arrowBuilder.addObjectRow(row);
|
|
58
|
+
}
|
|
75
59
|
} else {
|
|
76
|
-
this.
|
|
60
|
+
this.rows.push(row);
|
|
77
61
|
}
|
|
78
62
|
}
|
|
79
63
|
|
|
80
|
-
/** Add one row to the batch */
|
|
81
|
-
protected addArrayRow(row: any[]) {
|
|
82
|
-
if (!this.aggregator) {
|
|
83
|
-
const TableBatchType = this._getTableBatchType();
|
|
84
|
-
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
85
|
-
}
|
|
86
|
-
this.aggregator.addArrayRow(row);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/** Add one row to the batch */
|
|
90
|
-
protected addObjectRow(row: {[columnName: string]: any}): void {
|
|
91
|
-
if (!this.aggregator) {
|
|
92
|
-
const TableBatchType = this._getTableBatchType();
|
|
93
|
-
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
94
|
-
}
|
|
95
|
-
this.aggregator.addObjectRow(row);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
64
|
/** Mark an incoming raw memory chunk has completed */
|
|
99
65
|
chunkComplete(chunk: ArrayBuffer | string): void {
|
|
100
66
|
if (chunk instanceof ArrayBuffer) {
|
|
@@ -116,13 +82,9 @@ export class TableBatchBuilder {
|
|
|
116
82
|
|
|
117
83
|
// INTERNAL
|
|
118
84
|
|
|
119
|
-
_estimateRowMB(row: any[] | object): number {
|
|
120
|
-
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
85
|
private _isFull(): boolean {
|
|
124
86
|
// No batch, not ready
|
|
125
|
-
if (
|
|
87
|
+
if (this.rowCount() === 0) {
|
|
126
88
|
return false;
|
|
127
89
|
}
|
|
128
90
|
|
|
@@ -132,18 +94,12 @@ export class TableBatchBuilder {
|
|
|
132
94
|
if (!this.isChunkComplete) {
|
|
133
95
|
return false;
|
|
134
96
|
}
|
|
135
|
-
} else if (this.options.batchSize > this.
|
|
136
|
-
return false;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// Debounce batches
|
|
140
|
-
if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {
|
|
97
|
+
} else if (this.options.batchSize > this.rowCount()) {
|
|
141
98
|
return false;
|
|
142
99
|
}
|
|
143
100
|
|
|
144
101
|
// Emit batch
|
|
145
102
|
this.isChunkComplete = false;
|
|
146
|
-
this.lastBatchEmittedMs = Date.now();
|
|
147
103
|
return true;
|
|
148
104
|
}
|
|
149
105
|
|
|
@@ -151,7 +107,7 @@ export class TableBatchBuilder {
|
|
|
151
107
|
* bytesUsed can be set via chunkComplete or via getBatch*
|
|
152
108
|
*/
|
|
153
109
|
private _getBatch(options?: GetBatchOptions): TableBatch | null {
|
|
154
|
-
if (
|
|
110
|
+
if (this.rowCount() === 0) {
|
|
155
111
|
return null;
|
|
156
112
|
}
|
|
157
113
|
|
|
@@ -159,27 +115,56 @@ export class TableBatchBuilder {
|
|
|
159
115
|
if (options?.bytesUsed) {
|
|
160
116
|
this.bytesUsed = options.bytesUsed;
|
|
161
117
|
}
|
|
162
|
-
const normalizedBatch = this.
|
|
118
|
+
const normalizedBatch = this.takeBatch();
|
|
163
119
|
normalizedBatch.count = this.batchCount;
|
|
164
120
|
normalizedBatch.bytesUsed = this.bytesUsed;
|
|
165
121
|
Object.assign(normalizedBatch, options);
|
|
166
122
|
|
|
167
123
|
this.batchCount++;
|
|
168
|
-
this.aggregator = null;
|
|
169
124
|
return normalizedBatch;
|
|
170
125
|
}
|
|
171
126
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
127
|
+
/** Returns the number of rows buffered for the next batch. */
|
|
128
|
+
private rowCount(): number {
|
|
129
|
+
return this.arrowBuilder?.length ?? this.rows.length;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** Flushes typed output or takes ownership of the buffered raw rows. */
|
|
133
|
+
private takeBatch(): TableBatch {
|
|
134
|
+
if (this.arrowBuilder) {
|
|
135
|
+
const batch = this.arrowBuilder.flushBatch()!;
|
|
136
|
+
return {
|
|
137
|
+
...convertArrowToTable(new Table(batch), 'columnar-table'),
|
|
138
|
+
schema: structuredClone(this.schema),
|
|
139
|
+
batchType: 'data',
|
|
140
|
+
length: batch.numRows
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const rows = this.rows;
|
|
144
|
+
this.rows = [];
|
|
145
|
+
const shape =
|
|
146
|
+
this.options.shape ?? (Array.isArray(rows[0]) ? 'array-row-table' : 'object-row-table');
|
|
147
|
+
const firstRow = rows[0];
|
|
148
|
+
const fieldNames =
|
|
149
|
+
this.schema?.fields.map(field => field.name) ??
|
|
150
|
+
(Array.isArray(firstRow)
|
|
151
|
+
? inferHeadersFromArrayRow(firstRow)
|
|
152
|
+
: inferHeadersFromObjectRow(firstRow));
|
|
153
|
+
if (shape === 'array-row-table') {
|
|
154
|
+
return {
|
|
155
|
+
shape,
|
|
156
|
+
batchType: 'data',
|
|
157
|
+
data: rows.map(row => (Array.isArray(row) ? row : convertToArrayRow(row, fieldNames))),
|
|
158
|
+
schema: this.schema,
|
|
159
|
+
length: rows.length
|
|
160
|
+
};
|
|
183
161
|
}
|
|
162
|
+
return {
|
|
163
|
+
shape: 'object-row-table',
|
|
164
|
+
batchType: 'data',
|
|
165
|
+
data: rows.map(row => (Array.isArray(row) ? convertToObjectRow(row, fieldNames) : row)),
|
|
166
|
+
schema: this.schema,
|
|
167
|
+
length: rows.length
|
|
168
|
+
};
|
|
184
169
|
}
|
|
185
170
|
}
|
|
@@ -6,21 +6,30 @@ import type {
|
|
|
6
6
|
TableBatch,
|
|
7
7
|
ArrayRowTableBatch,
|
|
8
8
|
ObjectRowTableBatch,
|
|
9
|
-
ColumnarTableBatch
|
|
10
|
-
ArrowTableBatch
|
|
9
|
+
ColumnarTableBatch
|
|
11
10
|
} from '@loaders.gl/core/schema';
|
|
11
|
+
import * as arrow from 'apache-arrow';
|
|
12
|
+
import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
|
|
13
|
+
import {makeArrowMetadataBatch} from '../../arrow/arrow-metadata';
|
|
12
14
|
import {convertTable} from '../tables/convert-table';
|
|
13
15
|
|
|
14
16
|
export function convertBatch(batches: TableBatch, shape: 'object-row-table'): ObjectRowTableBatch;
|
|
15
17
|
export function convertBatch(batches: TableBatch, shape: 'array-row-table'): ArrayRowTableBatch;
|
|
16
18
|
export function convertBatch(batches: TableBatch, shape: 'columnar-table'): ColumnarTableBatch;
|
|
17
|
-
export function convertBatch(
|
|
19
|
+
export function convertBatch(
|
|
20
|
+
batch: TableBatch | arrow.RecordBatch,
|
|
21
|
+
shape: 'arrow'
|
|
22
|
+
): arrow.RecordBatch;
|
|
18
23
|
|
|
19
|
-
/**
|
|
24
|
+
/** Converts one portable batch or returns the supplied native record batch. */
|
|
20
25
|
export function convertBatch(
|
|
21
|
-
batch: TableBatch,
|
|
22
|
-
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow
|
|
23
|
-
): TableBatch {
|
|
26
|
+
batch: TableBatch | arrow.RecordBatch,
|
|
27
|
+
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
|
|
28
|
+
): TableBatch | arrow.RecordBatch {
|
|
29
|
+
if (isArrowRecordBatch(batch)) {
|
|
30
|
+
if (shape === 'arrow') return batch;
|
|
31
|
+
throw new Error('Convert a native RecordBatch as a table to select a row or column layout');
|
|
32
|
+
}
|
|
24
33
|
switch (shape) {
|
|
25
34
|
case 'object-row-table':
|
|
26
35
|
return {...batch, ...convertTable(batch, 'object-row-table')};
|
|
@@ -28,8 +37,10 @@ export function convertBatch(
|
|
|
28
37
|
return {...batch, ...convertTable(batch, 'array-row-table')};
|
|
29
38
|
case 'columnar-table':
|
|
30
39
|
return {...batch, ...convertTable(batch, 'columnar-table')};
|
|
31
|
-
case 'arrow
|
|
32
|
-
|
|
40
|
+
case 'arrow': {
|
|
41
|
+
const table = convertTable(batch, 'arrow');
|
|
42
|
+
return table.batches[0] ?? makeArrowMetadataBatch(table.schema);
|
|
43
|
+
}
|
|
33
44
|
default:
|
|
34
45
|
throw new Error(shape);
|
|
35
46
|
}
|
|
@@ -48,21 +59,24 @@ export function convertBatches(
|
|
|
48
59
|
shape: 'columnar-table'
|
|
49
60
|
): AsyncIterableIterator<ColumnarTableBatch>;
|
|
50
61
|
export function convertBatches(
|
|
51
|
-
batches: Iterable<TableBatch> | AsyncIterable<TableBatch>,
|
|
52
|
-
shape: 'arrow
|
|
53
|
-
): AsyncIterableIterator<
|
|
62
|
+
batches: Iterable<TableBatch | arrow.RecordBatch> | AsyncIterable<TableBatch | arrow.RecordBatch>,
|
|
63
|
+
shape: 'arrow'
|
|
64
|
+
): AsyncIterableIterator<arrow.RecordBatch>;
|
|
54
65
|
|
|
55
66
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @param shape
|
|
59
|
-
* @returns
|
|
67
|
+
* Converts batches in emission order. For Arrow output, yields native record batches,
|
|
68
|
+
* preserving the declared schema of empty inputs.
|
|
60
69
|
*/
|
|
61
70
|
export async function* convertBatches(
|
|
62
|
-
batches: Iterable<TableBatch> | AsyncIterable<TableBatch>,
|
|
63
|
-
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow
|
|
64
|
-
): AsyncIterableIterator<TableBatch> {
|
|
71
|
+
batches: Iterable<TableBatch | arrow.RecordBatch> | AsyncIterable<TableBatch | arrow.RecordBatch>,
|
|
72
|
+
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
|
|
73
|
+
): AsyncIterableIterator<TableBatch | arrow.RecordBatch> {
|
|
65
74
|
for await (const batch of batches) {
|
|
75
|
+
if (isArrowRecordBatch(batch)) {
|
|
76
|
+
if (shape !== 'arrow') throw new Error('Expected a loaders.gl table batch');
|
|
77
|
+
yield batch;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
66
80
|
switch (shape) {
|
|
67
81
|
case 'object-row-table':
|
|
68
82
|
yield convertBatch(batch, 'object-row-table');
|
|
@@ -73,9 +87,12 @@ export async function* convertBatches(
|
|
|
73
87
|
case 'columnar-table':
|
|
74
88
|
yield convertBatch(batch, 'columnar-table');
|
|
75
89
|
break;
|
|
76
|
-
case 'arrow
|
|
77
|
-
|
|
90
|
+
case 'arrow': {
|
|
91
|
+
const table = convertTable(batch, 'arrow');
|
|
92
|
+
if (table.batches.length) yield* table.batches;
|
|
93
|
+
else yield makeArrowMetadataBatch(table.schema);
|
|
78
94
|
break;
|
|
95
|
+
}
|
|
79
96
|
default:
|
|
80
97
|
throw new Error(shape);
|
|
81
98
|
}
|
|
@@ -3,29 +3,27 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import type {Table
|
|
6
|
+
import type {Table} from '@loaders.gl/core/schema';
|
|
7
7
|
|
|
8
8
|
import {convertSchemaToArrow} from '../../schema/convert-arrow-schema';
|
|
9
9
|
import {getTableLength, getTableNumCols, getTableCellAt} from '../tables/table-accessors';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
for (const batch of
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
data: arrowTable
|
|
28
|
-
};
|
|
11
|
+
/** Streams native Arrow batches, splitting existing batches without rebuilding columns. */
|
|
12
|
+
function* sliceNativeArrowBatches(
|
|
13
|
+
table: arrow.Table,
|
|
14
|
+
batchSize?: number
|
|
15
|
+
): IterableIterator<arrow.RecordBatch> {
|
|
16
|
+
if (batchSize !== undefined && (!Number.isSafeInteger(batchSize) || batchSize < 1)) {
|
|
17
|
+
throw new RangeError('batchSize must be a positive integer');
|
|
18
|
+
}
|
|
19
|
+
for (const batch of table.batches) {
|
|
20
|
+
if (batchSize === undefined || batch.numRows <= batchSize) {
|
|
21
|
+
yield batch;
|
|
22
|
+
} else {
|
|
23
|
+
for (let offset = 0; offset < batch.numRows; offset += batchSize) {
|
|
24
|
+
yield batch.slice(offset, offset + batchSize);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
|
|
@@ -34,6 +32,18 @@ export function* makeArrowTableBatchIterator(
|
|
|
34
32
|
* @note All batches will have the same shape and schema as the original table.
|
|
35
33
|
*/
|
|
36
34
|
export function* makeArrowRecordBatchIterator(
|
|
35
|
+
table: Table | arrow.Table,
|
|
36
|
+
options?: {batchSize?: number}
|
|
37
|
+
): IterableIterator<arrow.RecordBatch> {
|
|
38
|
+
if (!('shape' in table)) {
|
|
39
|
+
yield* sliceNativeArrowBatches(table, options?.batchSize);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
yield* makePortableTableRecordBatchIterator(table, options);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Converts loaders.gl table representations to record batches. */
|
|
46
|
+
export function* makePortableTableRecordBatchIterator(
|
|
37
47
|
table: Table,
|
|
38
48
|
options?: {batchSize?: number}
|
|
39
49
|
): IterableIterator<arrow.RecordBatch> {
|
|
@@ -10,26 +10,44 @@ import type {
|
|
|
10
10
|
ArrayRowTable,
|
|
11
11
|
Feature
|
|
12
12
|
} from '@loaders.gl/core/schema';
|
|
13
|
+
import type * as arrow from 'apache-arrow';
|
|
14
|
+
import {makeArrowTableFromBatches} from '../../arrow/arrow-metadata';
|
|
15
|
+
import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
|
|
13
16
|
import {getTableLength} from '../tables/table-accessors';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Assembles all batches from an async iterator into a single table.
|
|
17
|
-
*
|
|
20
|
+
* All batches must have the same shape and compatible schemas. A native RecordBatch stream
|
|
21
|
+
* produces a native Arrow table with metadata refined in emission order.
|
|
18
22
|
* @param batchIterator
|
|
19
23
|
* @returns `null` if no batches are yielded by the async iterator
|
|
20
24
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
export function makeTableFromBatches(
|
|
26
|
+
batchIterator: AsyncIterable<arrow.RecordBatch> | Iterable<arrow.RecordBatch>
|
|
27
|
+
): Promise<arrow.Table | null>;
|
|
28
|
+
export function makeTableFromBatches(
|
|
23
29
|
batchIterator: AsyncIterable<TableBatch> | Iterable<TableBatch>
|
|
24
|
-
): Promise<Table | null
|
|
30
|
+
): Promise<Table | null>;
|
|
31
|
+
export async function makeTableFromBatches(
|
|
32
|
+
batchIterator:
|
|
33
|
+
| AsyncIterable<TableBatch | arrow.RecordBatch>
|
|
34
|
+
| Iterable<TableBatch | arrow.RecordBatch>
|
|
35
|
+
): Promise<Table | arrow.Table | null> {
|
|
25
36
|
let arrayRows: ArrayRowTable['data'];
|
|
26
37
|
let objectRows: ObjectRowTable['data'];
|
|
27
38
|
let features: Feature[];
|
|
28
|
-
let shape: Table['shape'] | null = null;
|
|
39
|
+
let shape: Table['shape'] | 'arrow' | null = null;
|
|
29
40
|
let schema: Schema | undefined;
|
|
41
|
+
const arrowBatches: arrow.RecordBatch[] = [];
|
|
30
42
|
|
|
31
43
|
for await (const batch of batchIterator) {
|
|
32
|
-
|
|
44
|
+
const batchShape = isArrowRecordBatch(batch) ? 'arrow' : batch.shape;
|
|
45
|
+
shape ??= batchShape;
|
|
46
|
+
if (shape !== batchShape) throw new Error('Batches must have the same shape');
|
|
47
|
+
if (isArrowRecordBatch(batch)) {
|
|
48
|
+
arrowBatches.push(batch);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
33
51
|
schema = schema || batch.schema;
|
|
34
52
|
|
|
35
53
|
switch (batch.shape) {
|
|
@@ -58,7 +76,6 @@ export async function makeTableFromBatches(
|
|
|
58
76
|
break;
|
|
59
77
|
|
|
60
78
|
case 'columnar-table':
|
|
61
|
-
case 'arrow-table':
|
|
62
79
|
default:
|
|
63
80
|
throw new Error('shape');
|
|
64
81
|
}
|
|
@@ -69,6 +86,8 @@ export async function makeTableFromBatches(
|
|
|
69
86
|
}
|
|
70
87
|
|
|
71
88
|
switch (shape) {
|
|
89
|
+
case 'arrow':
|
|
90
|
+
return makeArrowTableFromBatches(arrowBatches);
|
|
72
91
|
case 'array-row-table':
|
|
73
92
|
return {shape: 'array-row-table', data: arrayRows!, schema};
|
|
74
93
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ArrowTable} from '@loaders.gl/core/schema';
|
|
6
5
|
import * as arrow from 'apache-arrow';
|
|
7
6
|
|
|
8
7
|
/** Portable options for applying a residual query to an Arrow table. */
|
|
@@ -30,11 +29,11 @@ export type ArrowTableRowFilter<PredicateT = unknown> = (
|
|
|
30
29
|
* allowing WHERE columns that are not returned to the caller.
|
|
31
30
|
*/
|
|
32
31
|
export function queryArrowTable<PredicateT = unknown>(
|
|
33
|
-
table:
|
|
32
|
+
table: arrow.Table,
|
|
34
33
|
options: ArrowTableQueryOptions<PredicateT> = {},
|
|
35
34
|
filterRows?: ArrowTableRowFilter<PredicateT>
|
|
36
|
-
):
|
|
37
|
-
const availableColumns = table.
|
|
35
|
+
): arrow.Table {
|
|
36
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
38
37
|
const selectedColumns = options.columns ? [...options.columns] : availableColumns;
|
|
39
38
|
for (const columnName of selectedColumns) {
|
|
40
39
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -46,36 +45,27 @@ export function queryArrowTable<PredicateT = unknown>(
|
|
|
46
45
|
if (options.predicate !== undefined) {
|
|
47
46
|
if (!filterRows) throw new Error('Arrow table query requires a predicate evaluator.');
|
|
48
47
|
const columns = Object.fromEntries(
|
|
49
|
-
availableColumns.map(name => [name, [...(table.
|
|
48
|
+
availableColumns.map(name => [name, [...(table.getChild(name) || [])]])
|
|
50
49
|
);
|
|
51
|
-
rowIndices = filterRows(options.predicate, columns, table.
|
|
50
|
+
rowIndices = filterRows(options.predicate, columns, table.numRows);
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
const limitedRowIndices = rowIndices
|
|
55
54
|
? rowIndices.slice(0, options.limit ?? Number.POSITIVE_INFINITY)
|
|
56
55
|
: undefined;
|
|
57
|
-
|
|
58
|
-
? createArrowTableFromRowIndices(table
|
|
59
|
-
: table.
|
|
60
|
-
const schema = table.schema
|
|
61
|
-
? {
|
|
62
|
-
...table.schema,
|
|
63
|
-
fields: selectedColumns.flatMap(
|
|
64
|
-
columnName => table.schema?.fields.filter(field => field.name === columnName) || []
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
: undefined;
|
|
68
|
-
return schema ? {shape: 'arrow-table', schema, data} : {shape: 'arrow-table', data};
|
|
56
|
+
return limitedRowIndices
|
|
57
|
+
? createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices)
|
|
58
|
+
: table.select(selectedColumns).slice(0, options.limit ?? Number.POSITIVE_INFINITY);
|
|
69
59
|
}
|
|
70
60
|
|
|
71
61
|
/** Selects rows from an Arrow table while preserving the requested column order. */
|
|
72
62
|
export function selectArrowTableRows(
|
|
73
|
-
table:
|
|
63
|
+
table: arrow.Table,
|
|
74
64
|
rowIndices: readonly number[],
|
|
75
65
|
columns?: readonly string[],
|
|
76
66
|
limit?: number
|
|
77
|
-
):
|
|
78
|
-
const availableColumns = table.
|
|
67
|
+
): arrow.Table {
|
|
68
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
79
69
|
const selectedColumns = columns ? [...columns] : availableColumns;
|
|
80
70
|
for (const columnName of selectedColumns) {
|
|
81
71
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -83,16 +73,7 @@ export function selectArrowTableRows(
|
|
|
83
73
|
}
|
|
84
74
|
}
|
|
85
75
|
const limitedRowIndices = rowIndices.slice(0, limit ?? Number.POSITIVE_INFINITY);
|
|
86
|
-
|
|
87
|
-
const schema = table.schema
|
|
88
|
-
? {
|
|
89
|
-
...table.schema,
|
|
90
|
-
fields: selectedColumns.flatMap(
|
|
91
|
-
columnName => table.schema?.fields.filter(field => field.name === columnName) || []
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
: undefined;
|
|
95
|
-
return schema ? {shape: 'arrow-table', schema, data} : {shape: 'arrow-table', data};
|
|
76
|
+
return createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices);
|
|
96
77
|
}
|
|
97
78
|
|
|
98
79
|
function createArrowTableFromRowIndices(
|
|
@@ -103,7 +84,8 @@ function createArrowTableFromRowIndices(
|
|
|
103
84
|
const schema = new arrow.Schema(
|
|
104
85
|
selectedColumns.map(
|
|
105
86
|
columnName => sourceData.schema.fields.find(field => field.name === columnName)!
|
|
106
|
-
)
|
|
87
|
+
),
|
|
88
|
+
sourceData.schema.metadata
|
|
107
89
|
);
|
|
108
90
|
const vectors = Object.fromEntries(
|
|
109
91
|
selectedColumns.map(columnName => {
|