@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
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {ReadableFile} from '../files/file';
|
|
5
|
-
import {FileProviderInterface} from './file-provider-interface';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Provides file data using range requests to the server
|
|
9
|
-
* @deprecated - will be replaced with ReadableFile
|
|
10
|
-
*/
|
|
11
|
-
export class FileProvider implements FileProviderInterface {
|
|
12
|
-
/** The File object from which data is provided */
|
|
13
|
-
private file: ReadableFile;
|
|
14
|
-
private size: bigint;
|
|
15
|
-
|
|
16
|
-
/** Create a new BrowserFile */
|
|
17
|
-
private constructor(file: ReadableFile, size: bigint | number) {
|
|
18
|
-
this.file = file;
|
|
19
|
-
this.size = BigInt(size);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static async create(file: ReadableFile): Promise<FileProvider> {
|
|
23
|
-
let size: bigint | number = 0n;
|
|
24
|
-
if (file.bigsize > 0n) {
|
|
25
|
-
size = file.bigsize;
|
|
26
|
-
} else if (file.size > 0) {
|
|
27
|
-
size = file.size;
|
|
28
|
-
} else {
|
|
29
|
-
const stats = await file.stat?.();
|
|
30
|
-
size = stats?.bigsize ?? 0n;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return new FileProvider(file, size);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Truncates the file descriptor.
|
|
38
|
-
* @param length desired file lenght
|
|
39
|
-
*/
|
|
40
|
-
async truncate(length: number): Promise<void> {
|
|
41
|
-
throw new Error('file loaded via range requests cannot be changed');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Append data to a file.
|
|
46
|
-
* @param buffer data to append
|
|
47
|
-
*/
|
|
48
|
-
async append(buffer: Uint8Array): Promise<void> {
|
|
49
|
-
throw new Error('file loaded via range requests cannot be changed');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** Close file */
|
|
53
|
-
async destroy(): Promise<void> {
|
|
54
|
-
throw new Error('file loaded via range requests cannot be changed');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Gets an unsigned 8-bit integer at the specified byte offset from the start of the file.
|
|
59
|
-
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
60
|
-
*/
|
|
61
|
-
async getUint8(offset: number | bigint): Promise<number> {
|
|
62
|
-
const arrayBuffer = await this.file.read(offset, 1);
|
|
63
|
-
const val = new Uint8Array(arrayBuffer).at(0);
|
|
64
|
-
if (val === undefined) {
|
|
65
|
-
throw new Error('something went wrong');
|
|
66
|
-
}
|
|
67
|
-
return val;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Gets an unsigned 16-bit integer at the specified byte offset from the start of the file.
|
|
72
|
-
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
73
|
-
*/
|
|
74
|
-
async getUint16(offset: number | bigint): Promise<number> {
|
|
75
|
-
const arrayBuffer = await this.file.read(offset, 2);
|
|
76
|
-
const val = new Uint16Array(arrayBuffer).at(0);
|
|
77
|
-
if (val === undefined) {
|
|
78
|
-
throw new Error('something went wrong');
|
|
79
|
-
}
|
|
80
|
-
return val;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
85
|
-
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
86
|
-
*/
|
|
87
|
-
async getUint32(offset: number | bigint): Promise<number> {
|
|
88
|
-
const arrayBuffer = await this.file.read(offset, 4);
|
|
89
|
-
const val = new Uint32Array(arrayBuffer).at(0);
|
|
90
|
-
if (val === undefined) {
|
|
91
|
-
throw new Error('something went wrong');
|
|
92
|
-
}
|
|
93
|
-
return val;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Gets an unsigned 32-bit integer at the specified byte offset from the start of the file.
|
|
98
|
-
* @param offset The offset, in bytes, from the start of the file where to read the data.
|
|
99
|
-
*/
|
|
100
|
-
async getBigUint64(offset: number | bigint): Promise<bigint> {
|
|
101
|
-
const arrayBuffer = await this.file.read(offset, 8);
|
|
102
|
-
const val = new BigInt64Array(arrayBuffer).at(0);
|
|
103
|
-
if (val === undefined) {
|
|
104
|
-
throw new Error('something went wrong');
|
|
105
|
-
}
|
|
106
|
-
return val;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* returns an ArrayBuffer whose contents are a copy of this file bytes from startOffset, inclusive, up to endOffset, exclusive.
|
|
111
|
-
* @param startOffset The offset, in byte, from the start of the file where to start reading the data.
|
|
112
|
-
* @param endOffset The offset, in bytes, from the start of the file where to end reading the data.
|
|
113
|
-
*/
|
|
114
|
-
async slice(startOffset: bigint | number, endOffset: bigint | number): Promise<ArrayBuffer> {
|
|
115
|
-
const bigLength = BigInt(endOffset) - BigInt(startOffset);
|
|
116
|
-
if (bigLength > Number.MAX_SAFE_INTEGER) {
|
|
117
|
-
throw new Error('too big slice');
|
|
118
|
-
}
|
|
119
|
-
const length = Number(bigLength);
|
|
120
|
-
|
|
121
|
-
return await this.file.read(startOffset, length);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* the length (in bytes) of the data.
|
|
126
|
-
*/
|
|
127
|
-
get length(): bigint {
|
|
128
|
-
return this.size;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import {MeshAttributes} from '../categories/category-mesh';
|
|
6
|
-
|
|
7
|
-
type BoundingBox = [[number, number, number], [number, number, number]];
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get the (axis aligned) bounding box of a mesh.
|
|
11
|
-
* @param attributes Mesh attributes.
|
|
12
|
-
* @returns The axis aligned bounding box as minimum and maximum vectors.
|
|
13
|
-
* @deprecated Import `getMeshBoundingBox` from `@loaders.gl/core/schema-utils` instead. This root
|
|
14
|
-
* export remains temporarily for deck.gl 9.4 compatibility.
|
|
15
|
-
*/
|
|
16
|
-
// eslint-disable-next-line complexity
|
|
17
|
-
export function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {
|
|
18
|
-
let minX = Infinity;
|
|
19
|
-
let minY = Infinity;
|
|
20
|
-
let minZ = Infinity;
|
|
21
|
-
let maxX = -Infinity;
|
|
22
|
-
let maxY = -Infinity;
|
|
23
|
-
let maxZ = -Infinity;
|
|
24
|
-
|
|
25
|
-
const positions = attributes.POSITION ? attributes.POSITION.value : [];
|
|
26
|
-
const length = positions && positions.length;
|
|
27
|
-
|
|
28
|
-
for (let index = 0; index < length; index += 3) {
|
|
29
|
-
const x = positions[index];
|
|
30
|
-
const y = positions[index + 1];
|
|
31
|
-
const z = positions[index + 2];
|
|
32
|
-
|
|
33
|
-
minX = x < minX ? x : minX;
|
|
34
|
-
minY = y < minY ? y : minY;
|
|
35
|
-
minZ = z < minZ ? z : minZ;
|
|
36
|
-
|
|
37
|
-
maxX = x > maxX ? x : maxX;
|
|
38
|
-
maxY = y > maxY ? y : maxY;
|
|
39
|
-
maxZ = z > maxZ ? z : maxZ;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return [
|
|
43
|
-
[minX, minY, minZ],
|
|
44
|
-
[maxX, maxY, maxZ]
|
|
45
|
-
];
|
|
46
|
-
}
|
package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {Schema, ColumnarTableBatch, ArrowTableBatch} from '@loaders.gl/core/schema';
|
|
6
|
-
import {TableBatchAggregator} from './table-batch-aggregator';
|
|
7
|
-
import {convertSchemaToArrow} from '../../schema/convert-arrow-schema';
|
|
8
|
-
import * as arrow from 'apache-arrow';
|
|
9
|
-
|
|
10
|
-
/** @note Should be part of @loaders.gl/core/schema - kept separate to avoid hard arrow dependency */
|
|
11
|
-
export class ArrowTableBatchAggregator extends TableBatchAggregator {
|
|
12
|
-
|
|
13
|
-
constructor(schema: Schema, options) {
|
|
14
|
-
super(schema, options);
|
|
15
|
-
this.arrowSchema = null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
getBatch(): ArrowTableBatch | null {
|
|
19
|
-
const batch = super.getBatch();
|
|
20
|
-
if (batch) {
|
|
21
|
-
// Get the arrow schema
|
|
22
|
-
this.arrowSchema = this.arrowSchema || getArrowSchema(batch.schema);
|
|
23
|
-
|
|
24
|
-
// Get arrow format vectors
|
|
25
|
-
const arrowVectors = getArrowVectors(this.arrowSchema, batch.data);
|
|
26
|
-
|
|
27
|
-
// Create the record batch
|
|
28
|
-
const recordBatch = new arrow.RecordBatch(
|
|
29
|
-
this.arrowSchema,
|
|
30
|
-
arrow.makeData({
|
|
31
|
-
type: new arrow.Struct(this.arrowSchema.fields),
|
|
32
|
-
children: arrowVectors.map(({data}) => data[0])
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
shape: 'arrow-table',
|
|
38
|
-
batchType: 'data',
|
|
39
|
-
data: new arrow.Table([recordBatch]),
|
|
40
|
-
length: batch.length
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Convert from a simple loaders.gl schema to an Arrow schema
|
|
49
|
-
function getArrowSchema(schema): arrow.Schema {
|
|
50
|
-
const arrowFields: arrow.Field[] = [];
|
|
51
|
-
for (const key in schema) {
|
|
52
|
-
const field = schema[key];
|
|
53
|
-
if (field.type === Float32Array) {
|
|
54
|
-
// TODO - just store the original field as metadata?
|
|
55
|
-
const metadata = new Map(); // field;
|
|
56
|
-
// arrow: new arrow.Field(name, nullable, metadata)
|
|
57
|
-
const arrowField = new arrow.Field(field.name, new arrow.Float32(), field.nullable, metadata);
|
|
58
|
-
arrowFields.push(arrowField);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (arrowFields.length === 0) {
|
|
62
|
-
throw new Error('No arrow convertible fields');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return new arrow.Schema(arrowFields);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// Convert from simple loaders.gl arrays to arrow vectors
|
|
69
|
-
function getArrowVectors(arrowSchema, data): arrow.Vector[] {
|
|
70
|
-
const arrowVectors: any[] = [];
|
|
71
|
-
for (const field of arrowSchema.fields) {
|
|
72
|
-
const vector = data[field.name];
|
|
73
|
-
if (vector instanceof Float32Array) {
|
|
74
|
-
const arrowVector = arrow.makeVector(vector);
|
|
75
|
-
arrowVectors.push(arrowVector);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (arrowSchema.fields.length !== arrowVectors.length) {
|
|
79
|
-
throw new Error('Some columns not arrow convertible');
|
|
80
|
-
}
|
|
81
|
-
return arrowVectors;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type ColumnarTableBatchOptions = {};
|
|
85
|
-
|
|
86
|
-
const DEFAULT_ROW_COUNT = 100;
|
|
87
|
-
|
|
88
|
-
export class ArrowBatchAggregator implements TableBatchAggregator {
|
|
89
|
-
schema: Schema;
|
|
90
|
-
length: number = 0;
|
|
91
|
-
allocated: number = 0;
|
|
92
|
-
columns: {[columnName: string]: any[]} = {};
|
|
93
|
-
|
|
94
|
-
arrowSchema: arrow.Schema | null;
|
|
95
|
-
|
|
96
|
-
constructor(schema: Schema, options: ColumnarTableBatchOptions) {
|
|
97
|
-
this.schema = schema;
|
|
98
|
-
this.arrowSchema = convertSchemaToArrow(schema);
|
|
99
|
-
this._reallocateColumns();
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
rowCount(): number {
|
|
103
|
-
return this.length;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
addArrayRow(row: any[]) {
|
|
107
|
-
// If user keeps pushing rows beyond batch size, reallocate
|
|
108
|
-
this._reallocateColumns();
|
|
109
|
-
let i = 0;
|
|
110
|
-
// TODO what if no csv header, columns not populated?
|
|
111
|
-
for (const fieldName in this.columns) {
|
|
112
|
-
this.columns[fieldName][this.length] = row[i++];
|
|
113
|
-
}
|
|
114
|
-
this.length++;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
addObjectRow(row: {[columnName: string]: any}): void {
|
|
118
|
-
// If user keeps pushing rows beyond batch size, reallocate
|
|
119
|
-
this._reallocateColumns();
|
|
120
|
-
for (const fieldName in row) {
|
|
121
|
-
this.columns[fieldName][this.length] = row[fieldName];
|
|
122
|
-
}
|
|
123
|
-
this.length++;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
getBatch(): ColumnarTableBatch | ArrowTableBatch | null {
|
|
127
|
-
this._pruneColumns();
|
|
128
|
-
const columns = Array.isArray(this.schema) ? this.columns : {};
|
|
129
|
-
|
|
130
|
-
// schema is an array if there're no headers
|
|
131
|
-
// object if there are headers
|
|
132
|
-
// columns should match schema format
|
|
133
|
-
if (!Array.isArray(this.schema)) {
|
|
134
|
-
for (const fieldName in this.schema) {
|
|
135
|
-
const field = this.schema[fieldName];
|
|
136
|
-
columns[field.name] = this.columns[field.index];
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
this.columns = {};
|
|
141
|
-
|
|
142
|
-
const batch: ColumnarTableBatch = {
|
|
143
|
-
shape: 'columnar-table',
|
|
144
|
-
batchType: 'data',
|
|
145
|
-
data: columns,
|
|
146
|
-
schema: this.schema,
|
|
147
|
-
length: this.length
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
return batch;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
// HELPERS
|
|
154
|
-
|
|
155
|
-
_reallocateColumns() {
|
|
156
|
-
if (this.length < this.allocated) {
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// @ts-ignore TODO
|
|
161
|
-
this.allocated = this.allocated > 0 ? (this.allocated *= 2) : DEFAULT_ROW_COUNT;
|
|
162
|
-
this.columns = {};
|
|
163
|
-
|
|
164
|
-
for (const fieldName in this.schema) {
|
|
165
|
-
const field = this.schema[fieldName];
|
|
166
|
-
const ArrayType = field.type || Float32Array;
|
|
167
|
-
const oldColumn = this.columns[field.index];
|
|
168
|
-
|
|
169
|
-
if (oldColumn && ArrayBuffer.isView(oldColumn)) {
|
|
170
|
-
// Copy the old data to the new array
|
|
171
|
-
const typedArray = new ArrayType(this.allocated);
|
|
172
|
-
typedArray.set(oldColumn);
|
|
173
|
-
this.columns[field.index] = typedArray;
|
|
174
|
-
} else if (oldColumn) {
|
|
175
|
-
// Plain array
|
|
176
|
-
oldColumn.length = this.allocated;
|
|
177
|
-
this.columns[field.index] = oldColumn;
|
|
178
|
-
} else {
|
|
179
|
-
// Create new
|
|
180
|
-
this.columns[field.index] = new ArrayType(this.allocated);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
_pruneColumns() {
|
|
186
|
-
for (const [columnName, column] of Object.entries(this.columns)) {
|
|
187
|
-
this.columns[columnName] = column.slice(0, this.length);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {ArrowTableBatch} from '@loaders.gl/core/schema';
|
|
6
|
-
import {ColumnarTableBatchAggregator} from './columnar-table-batch-aggregator';
|
|
7
|
-
import * as arrow from 'apache-arrow';
|
|
8
|
-
|
|
9
|
-
/** @note Should be part of @loaders.gl/core/schema - kept separate to avoid hard arrow dependency */
|
|
10
|
-
export class ArrowTableBatchAggregator extends ColumnarTableBatchAggregator {
|
|
11
|
-
arrowSchema: arrow.Schema | null;
|
|
12
|
-
|
|
13
|
-
constructor(schema, options) {
|
|
14
|
-
super(schema, options);
|
|
15
|
-
this.arrowSchema = null;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
getBatch(): ArrowTableBatch | null {
|
|
19
|
-
const batch = super.getBatch();
|
|
20
|
-
if (batch) {
|
|
21
|
-
// Get the arrow schema
|
|
22
|
-
this.arrowSchema = this.arrowSchema || getArrowSchema(batch.schema);
|
|
23
|
-
|
|
24
|
-
// Get arrow format vectors
|
|
25
|
-
const arrowVectors = getArrowVectors(this.arrowSchema, batch.data);
|
|
26
|
-
|
|
27
|
-
// Create the record batch
|
|
28
|
-
const recordBatch = new arrow.RecordBatch(
|
|
29
|
-
this.arrowSchema,
|
|
30
|
-
arrow.makeData({
|
|
31
|
-
type: new arrow.Struct(this.arrowSchema.fields),
|
|
32
|
-
children: arrowVectors.map(({data}) => data[0])
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
shape: 'arrow-table',
|
|
38
|
-
batchType: 'data',
|
|
39
|
-
data: new arrow.Table([recordBatch]),
|
|
40
|
-
length: batch.length
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Convert from a simple loaders.gl schema to an Arrow schema
|
|
49
|
-
function getArrowSchema(schema): arrow.Schema {
|
|
50
|
-
const arrowFields: arrow.Field[] = [];
|
|
51
|
-
const fields = Array.isArray(schema.fields) ? schema.fields : Object.values(schema);
|
|
52
|
-
for (const field of fields as any[]) {
|
|
53
|
-
if (field.type === 'float32' || field.type === Float32Array) {
|
|
54
|
-
// TODO - just store the original field as metadata?
|
|
55
|
-
const metadata = new Map(); // field;
|
|
56
|
-
// arrow: new arrow.Field(name, nullable, metadata)
|
|
57
|
-
const arrowField = new arrow.Field(field.name, new arrow.Float32(), field.nullable, metadata);
|
|
58
|
-
arrowFields.push(arrowField);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (arrowFields.length === 0) {
|
|
62
|
-
throw new Error('No arrow convertible fields');
|
|
63
|
-
}
|
|
64
|
-
if (arrowFields.length !== fields.length) {
|
|
65
|
-
throw new Error('Some schema fields are not arrow convertible');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return new arrow.Schema(arrowFields);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Convert from simple loaders.gl arrays to arrow vectors
|
|
72
|
-
function getArrowVectors(arrowSchema, data): arrow.Vector[] {
|
|
73
|
-
const arrowVectors: any[] = [];
|
|
74
|
-
for (const field of arrowSchema.fields) {
|
|
75
|
-
const vector = data[field.name];
|
|
76
|
-
if (vector instanceof Float32Array) {
|
|
77
|
-
const arrowVector = arrow.makeVector(vector as any);
|
|
78
|
-
arrowVectors.push(arrowVector);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (arrowSchema.fields.length !== arrowVectors.length) {
|
|
82
|
-
throw new Error('Some columns not arrow convertible');
|
|
83
|
-
}
|
|
84
|
-
return arrowVectors;
|
|
85
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {Schema, TableBatch} from '@loaders.gl/core/schema';
|
|
6
|
-
import {TableBatchAggregator, TableBatchOptions} from './table-batch-aggregator';
|
|
7
|
-
|
|
8
|
-
const DEFAULT_ROW_COUNT = 100;
|
|
9
|
-
|
|
10
|
-
export class BaseTableBatchAggregator implements TableBatchAggregator {
|
|
11
|
-
schema: Schema;
|
|
12
|
-
options: TableBatchOptions;
|
|
13
|
-
|
|
14
|
-
shape?: 'array-row-table' | 'object-row-table';
|
|
15
|
-
length: number = 0;
|
|
16
|
-
rows: any[] | null = null;
|
|
17
|
-
cursor: number = 0;
|
|
18
|
-
private _headers: string[] = [];
|
|
19
|
-
|
|
20
|
-
constructor(schema: Schema, options: TableBatchOptions) {
|
|
21
|
-
this.options = options;
|
|
22
|
-
this.schema = schema;
|
|
23
|
-
|
|
24
|
-
// schema is an array if there're no headers
|
|
25
|
-
// object if there are headers
|
|
26
|
-
if (!Array.isArray(schema)) {
|
|
27
|
-
this._headers = [];
|
|
28
|
-
for (const key in schema) {
|
|
29
|
-
this._headers[schema[key].index] = schema[key].name;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
rowCount(): number {
|
|
35
|
-
return this.length;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
addArrayRow(row: any[], cursor?: number): void {
|
|
39
|
-
if (Number.isFinite(cursor)) {
|
|
40
|
-
this.cursor = cursor as number;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
this.shape = 'array-row-table';
|
|
44
|
-
|
|
45
|
-
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
46
|
-
this.rows[this.length] = row;
|
|
47
|
-
this.length++;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
addObjectRow(row: {[columnName: string]: any}, cursor?: number): void {
|
|
51
|
-
if (Number.isFinite(cursor)) {
|
|
52
|
-
this.cursor = cursor as number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
this.shape = 'object-row-table';
|
|
56
|
-
|
|
57
|
-
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
58
|
-
this.rows[this.length] = row;
|
|
59
|
-
this.length++;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
getBatch(): TableBatch | null {
|
|
63
|
-
let rows = this.rows;
|
|
64
|
-
if (!rows) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
rows = rows.slice(0, this.length);
|
|
69
|
-
this.rows = null;
|
|
70
|
-
|
|
71
|
-
const batch: TableBatch = {
|
|
72
|
-
shape: this.shape || 'array-row-table',
|
|
73
|
-
batchType: 'data',
|
|
74
|
-
data: rows,
|
|
75
|
-
length: this.length,
|
|
76
|
-
schema: this.schema,
|
|
77
|
-
cursor: this.cursor
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return batch;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {
|
|
6
|
-
Schema,
|
|
7
|
-
ColumnarTableBatch,
|
|
8
|
-
ArrowTableBatch,
|
|
9
|
-
TypedArray
|
|
10
|
-
} from '@loaders.gl/core/schema';
|
|
11
|
-
import {getArrayTypeFromDataType} from '../../schema/data-type';
|
|
12
|
-
import {TableBatchAggregator} from './table-batch-aggregator';
|
|
13
|
-
type ColumnarTableBatchOptions = {};
|
|
14
|
-
|
|
15
|
-
const DEFAULT_ROW_COUNT = 100;
|
|
16
|
-
|
|
17
|
-
export class ColumnarTableBatchAggregator implements TableBatchAggregator {
|
|
18
|
-
schema: Schema;
|
|
19
|
-
length: number = 0;
|
|
20
|
-
allocated: number = 0;
|
|
21
|
-
columns: Record<string, TypedArray | Array<any>> = {};
|
|
22
|
-
|
|
23
|
-
constructor(schema: Schema, options: ColumnarTableBatchOptions) {
|
|
24
|
-
this.schema = schema;
|
|
25
|
-
this._reallocateColumns();
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
rowCount(): number {
|
|
29
|
-
return this.length;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
addArrayRow(row: any[]) {
|
|
33
|
-
// If user keeps pushing rows beyond batch size, reallocate
|
|
34
|
-
this._reallocateColumns();
|
|
35
|
-
let i = 0;
|
|
36
|
-
// TODO what if no csv header, columns not populated?
|
|
37
|
-
for (const fieldName in this.columns) {
|
|
38
|
-
this.columns[fieldName][this.length] = row[i++];
|
|
39
|
-
}
|
|
40
|
-
this.length++;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
addObjectRow(row: {[columnName: string]: any}): void {
|
|
44
|
-
// If user keeps pushing rows beyond batch size, reallocate
|
|
45
|
-
this._reallocateColumns();
|
|
46
|
-
for (const fieldName in row) {
|
|
47
|
-
this.columns[fieldName][this.length] = row[fieldName];
|
|
48
|
-
}
|
|
49
|
-
this.length++;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
getBatch(): ColumnarTableBatch | ArrowTableBatch | null {
|
|
53
|
-
this._pruneColumns();
|
|
54
|
-
|
|
55
|
-
const batch: ColumnarTableBatch = {
|
|
56
|
-
shape: 'columnar-table',
|
|
57
|
-
batchType: 'data',
|
|
58
|
-
data: this.columns,
|
|
59
|
-
schema: this.schema,
|
|
60
|
-
length: this.length
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
return batch;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// HELPERS
|
|
67
|
-
|
|
68
|
-
_reallocateColumns() {
|
|
69
|
-
if (this.length < this.allocated) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// @ts-ignore TODO
|
|
74
|
-
this.allocated = this.allocated > 0 ? this.allocated * 2 : DEFAULT_ROW_COUNT;
|
|
75
|
-
this.columns = {};
|
|
76
|
-
|
|
77
|
-
for (const field of this.schema.fields) {
|
|
78
|
-
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
79
|
-
const oldColumn = this.columns[field.name];
|
|
80
|
-
|
|
81
|
-
if (!oldColumn) {
|
|
82
|
-
// Create new
|
|
83
|
-
this.columns[field.name] = new ArrayType(this.allocated);
|
|
84
|
-
} else if (Array.isArray(oldColumn)) {
|
|
85
|
-
// Plain array, just increase its size
|
|
86
|
-
oldColumn.length = this.allocated;
|
|
87
|
-
} else if (ArrayBuffer.isView(oldColumn) && !(oldColumn instanceof DataView)) {
|
|
88
|
-
const typedArray = new ArrayType(this.allocated) as TypedArray;
|
|
89
|
-
// Copy the old data to the new array
|
|
90
|
-
typedArray.set(oldColumn);
|
|
91
|
-
this.columns[field.name] = typedArray;
|
|
92
|
-
} else {
|
|
93
|
-
throw new Error('Invalid column type');
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
_pruneColumns() {
|
|
99
|
-
for (const [columnName, column] of Object.entries(this.columns)) {
|
|
100
|
-
this.columns[columnName] = column.slice(0, this.length);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|