@loaders.gl/core 5.0.0-beta.10 → 5.0.0-beta.12
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/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 +1 -5
- 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 +2 -6
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -10
- 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 -13
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +3 -3
- package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts +1 -1
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +2 -2
- 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 +8 -76
- package/dist/arrow-worker-transport.cjs.map +1 -1
- package/dist/arrow-worker-transport.d.ts +4 -8
- package/dist/arrow-worker-transport.d.ts.map +1 -1
- package/dist/arrow-worker-transport.js +15 -89
- package/dist/arrow-worker-transport.js.map +1 -1
- package/dist/cluster-source.cjs +47 -45
- package/dist/cluster-source.cjs.map +2 -2
- package/dist/dist.dev.js +71 -60
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +88 -126
- package/dist/federated-table-scan-source.cjs.map +2 -2
- 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 +12 -12
- 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 +12 -14
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +4 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +5 -5
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +6 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.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 +8 -8
- 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 +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +2 -3
- 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 +2 -3
- 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/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/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/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- 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.js +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/index.cjs +69 -54
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +2 -4
- 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.js +6 -10
- 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/init.js +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +5 -8
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -1
- package/dist/lib/loader-utils/native-arrow.js +13 -31
- package/dist/lib/loader-utils/native-arrow.js.map +1 -1
- package/dist/loader-utils/index.cjs +48 -31
- package/dist/loader-utils/index.cjs.map +1 -1
- package/dist/loader-utils/index.d.ts +1 -1
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +1 -1
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +6 -2
- 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 +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +15 -12
- 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/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/vector-tile-source.d.ts +3 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +3 -5
- package/dist/loader-utils/loader-types.d.ts.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.js +1 -1
- package/dist/null-worker-node.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +4 -4
- package/dist/scan/arrow-execution/expressions.cjs.map +2 -2
- package/dist/scan/arrow-execution/expressions.d.ts +4 -4
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +4 -4
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- 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/federated-table-scan-source.cjs +12 -13
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +14 -15
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +5 -2
- package/dist/scan/index.cjs.map +2 -2
- package/dist/scan/index.d.ts +2 -1
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +2 -1
- 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-pushdown.cjs +6 -6
- package/dist/scan/query-pushdown.cjs.map +2 -2
- package/dist/scan/query-pushdown.d.ts +1 -1
- package/dist/scan/query-pushdown.d.ts.map +1 -1
- package/dist/scan/query-pushdown.js +3 -6
- package/dist/scan/query-pushdown.js.map +1 -1
- 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 +49 -45
- package/dist/scan/query.cjs.map +2 -2
- package/dist/scan/query.d.ts +7 -4
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +35 -52
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +19 -13
- package/dist/scan/vector-table-scan-source.cjs.map +3 -3
- package/dist/scan/vector-table-scan-source.d.ts +3 -4
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +11 -12
- 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/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.map +1 -1
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.d.ts.map +1 -1
- 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 +420 -503
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +4 -5
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +4 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +4 -5
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +21 -18
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +6 -11
- 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 +4 -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 +13 -15
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts +2 -2
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.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/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +5 -8
- 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 +1 -1
- 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 +2 -6
- 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 +1 -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 +4 -24
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +3 -6
- 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 +8 -58
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +2 -2
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +2 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +2 -2
- 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 +4 -4
- 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 +17 -11
- 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 +2 -2
- package/dist/worker-utils/lib/env-utils/version.js +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/null-worker-node.js.map +1 -1
- package/dist/worker-utils/null-worker.js.map +1 -1
- package/package.json +22 -8
- 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 +5 -8
- package/src/arrow-geometry/feature-table.ts +8 -21
- package/src/arrow-geometry/geojson-table.ts +2 -2
- 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 +22 -121
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +16 -23
- package/src/geoarrow/convert-table-to-geoarrow.ts +11 -23
- 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 +3 -7
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +2 -2
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +2 -4
- 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/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/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/table-converters/convert-geoarrow-table.ts +7 -5
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lib/api/load.ts +2 -12
- 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 +8 -12
- package/src/lib/api/parse-sync.ts +3 -7
- package/src/lib/api/parse.ts +2 -6
- package/src/lib/loader-utils/native-arrow.ts +12 -38
- package/src/loader-utils/index.ts +0 -1
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +7 -6
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +64 -41
- 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/vector-tile-source.ts +3 -9
- package/src/loader-utils/loader-types.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +7 -7
- package/src/scan/arrow-execution/filter-arrow-table.ts +1 -1
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/federated-table-scan-source.ts +15 -18
- package/src/scan/index.ts +7 -1
- package/src/scan/parse-sql-predicate.ts +1 -1
- package/src/scan/query-pushdown.ts +7 -7
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +68 -71
- package/src/scan/vector-table-scan-source.ts +16 -21
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +2 -2
- package/src/schema/index.ts +1 -3
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +5 -11
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +33 -30
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +12 -38
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +15 -18
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +4 -13
- 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/batches/convert-batches.ts +5 -8
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +2 -6
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +5 -27
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +11 -73
- package/src/schema-utils/lib/table/tables/make-table.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +2 -22
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +6 -6
- 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/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts +0 -27
- 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 -23
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js.map +0 -1
- package/src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts +0 -54
|
@@ -2,51 +2,51 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow';
|
|
6
|
+
import type {TableBatch} from '@loaders.gl/core/schema';
|
|
6
7
|
import type {TableScanReadOptions, TableQueryExecutionSummary} from './scan-query-metadata';
|
|
7
8
|
import {emitQueryComplete} from './scan-query-metadata';
|
|
8
9
|
import {filterColumnarRowIndices, validateColumnarPredicate} from './columnar-predicate';
|
|
9
10
|
import {validateTableQueryLimit, validateTableQueryOffset} from './table-query';
|
|
10
11
|
|
|
12
|
+
/** Physical batches handled by the shared scan executor. */
|
|
13
|
+
type ScanBatch = TableBatch | ApacheArrowTable | RecordBatch;
|
|
14
|
+
|
|
11
15
|
/** Reads source batches while allowing the shared executor to observe fetched bytes. */
|
|
12
|
-
export type TableScanBatchReader = (
|
|
16
|
+
export type TableScanBatchReader<BatchT = TableBatch> = (
|
|
13
17
|
signal?: AbortSignal,
|
|
14
18
|
onByteLength?: (byteLength: number) => void
|
|
15
|
-
) => AsyncIterable<
|
|
19
|
+
) => AsyncIterable<BatchT>;
|
|
16
20
|
|
|
17
21
|
/** Optional batch kernels for formats with a native vectorized predicate implementation. */
|
|
18
|
-
export type TableScanBatchOperators = Readonly<{
|
|
22
|
+
export type TableScanBatchOperators<BatchT = TableBatch> = Readonly<{
|
|
19
23
|
/** Applies a residual predicate locally or on a worker; async kernels must observe the signal. */
|
|
20
24
|
filter?: (
|
|
21
|
-
batch:
|
|
25
|
+
batch: BatchT,
|
|
22
26
|
predicate: TableScanReadOptions['predicate'],
|
|
23
27
|
signal?: AbortSignal
|
|
24
|
-
) =>
|
|
28
|
+
) => BatchT | Promise<BatchT>;
|
|
25
29
|
/** Applies a projection while preserving the source batch shape. */
|
|
26
|
-
project?: (batch:
|
|
30
|
+
project?: (batch: BatchT, columns?: readonly string[]) => BatchT;
|
|
27
31
|
}>;
|
|
28
32
|
|
|
29
|
-
/** Wraps an Arrow table in the standard single-result scan batch envelope. */
|
|
30
|
-
export function makeTableScanBatch(table: ArrowTable): ArrowTableBatch {
|
|
31
|
-
return {...table, batchType: 'data', length: table.data.numRows} as ArrowTableBatch;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
33
|
/**
|
|
35
|
-
* Executes the common residual table-scan stages for row and
|
|
34
|
+
* Executes the common residual table-scan stages for row, columnar, and native Arrow chunks.
|
|
35
|
+
* Native Arrow predicates require a format-supplied filter kernel.
|
|
36
36
|
*
|
|
37
37
|
* Format adapters provide only their parser-specific batch reader. Keeping filtering, projection,
|
|
38
38
|
* limits, cancellation, and telemetry here avoids copying the same executor into every format
|
|
39
39
|
* package while preserving each format's native batch shape.
|
|
40
40
|
*/
|
|
41
|
-
export async function* executeTableScanBatches(
|
|
42
|
-
readBatches: TableScanBatchReader
|
|
41
|
+
export async function* executeTableScanBatches<BatchT extends ScanBatch>(
|
|
42
|
+
readBatches: TableScanBatchReader<BatchT>,
|
|
43
43
|
options: TableScanReadOptions &
|
|
44
44
|
Readonly<{
|
|
45
45
|
/** Omits empty batches from the output stream. */
|
|
46
46
|
skipEmptyBatches?: boolean;
|
|
47
47
|
}> = {},
|
|
48
|
-
operators: TableScanBatchOperators = {}
|
|
49
|
-
): AsyncIterable<
|
|
48
|
+
operators: TableScanBatchOperators<NoInfer<BatchT>> = {}
|
|
49
|
+
): AsyncIterable<BatchT> {
|
|
50
50
|
validateTableQueryLimit(options.limit);
|
|
51
51
|
validateTableQueryOffset(options.offset);
|
|
52
52
|
let skip = options.offset ?? 0;
|
|
@@ -80,30 +80,37 @@ export async function* executeTableScanBatches(
|
|
|
80
80
|
}
|
|
81
81
|
options.signal?.throwIfAborted();
|
|
82
82
|
batchesRead++;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
const rowCount = getScanBatchRowCount(batch);
|
|
84
|
+
rowsRead += rowCount;
|
|
85
|
+
if (options.predicate && !operators.filter && !('shape' in batch)) {
|
|
86
|
+
throw new Error('Native Arrow scans require a filter kernel for residual predicates.');
|
|
87
|
+
}
|
|
88
|
+
const filteredBatch = operators.filter
|
|
89
|
+
? await operators.filter(batch, options.predicate, options.signal)
|
|
90
|
+
: (('shape' in batch ? filterTableBatch(batch, options.predicate) : batch) as BatchT);
|
|
89
91
|
options.signal?.throwIfAborted();
|
|
92
|
+
const filteredRowCount = getScanBatchRowCount(filteredBatch);
|
|
90
93
|
if (options.predicate) {
|
|
91
|
-
rowsTested +=
|
|
92
|
-
rowsRetained +=
|
|
94
|
+
rowsTested += rowCount;
|
|
95
|
+
rowsRetained += filteredRowCount;
|
|
93
96
|
}
|
|
94
|
-
if (skip >=
|
|
95
|
-
skip -=
|
|
97
|
+
if (skip >= filteredRowCount && (skip > 0 || options.skipEmptyBatches)) {
|
|
98
|
+
skip -= filteredRowCount;
|
|
96
99
|
continue;
|
|
97
100
|
}
|
|
98
|
-
const end = Math.min(
|
|
101
|
+
const end = Math.min(filteredRowCount, skip + remaining);
|
|
99
102
|
const window =
|
|
100
|
-
skip || end <
|
|
101
|
-
?
|
|
103
|
+
skip || end < filteredRowCount
|
|
104
|
+
? (('shape' in filteredBatch
|
|
105
|
+
? sliceTableBatch(filteredBatch, skip, end)
|
|
106
|
+
: filteredBatch.slice(skip, end)) as BatchT)
|
|
102
107
|
: filteredBatch;
|
|
103
108
|
skip = 0;
|
|
104
|
-
const output =
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
const output = operators.project
|
|
110
|
+
? operators.project(window, options.columns)
|
|
111
|
+
: projectTableBatch(window, options.columns);
|
|
112
|
+
remaining -= getScanBatchRowCount(window);
|
|
113
|
+
rowsReturned += getScanBatchRowCount(output);
|
|
107
114
|
if (remaining === 0) earlyTerminationReason = 'limit';
|
|
108
115
|
yield output;
|
|
109
116
|
if (remaining === 0) return;
|
|
@@ -142,9 +149,19 @@ export async function* executeTableScanBatches(
|
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
|
|
152
|
+
/** Reads the row count from native Arrow chunks and portable batch envelopes. */
|
|
153
|
+
function getScanBatchRowCount(batch: ScanBatch): number {
|
|
154
|
+
return 'shape' in batch ? batch.length : batch.numRows;
|
|
155
|
+
}
|
|
156
|
+
|
|
145
157
|
/** Truncates a batch without changing its native representation. */
|
|
146
|
-
export function truncateTableBatch
|
|
147
|
-
|
|
158
|
+
export function truncateTableBatch<BatchType extends ScanBatch>(
|
|
159
|
+
batch: BatchType,
|
|
160
|
+
length: number
|
|
161
|
+
): BatchType {
|
|
162
|
+
return (
|
|
163
|
+
'shape' in batch ? sliceTableBatch(batch, 0, length) : batch.slice(0, length)
|
|
164
|
+
) as BatchType;
|
|
148
165
|
}
|
|
149
166
|
|
|
150
167
|
/** Slices rows in a batch, preserving Arrow buffers and the batch shape. */
|
|
@@ -165,30 +182,36 @@ function sliceTableBatch(batch: TableBatch, start: number, end: number): TableBa
|
|
|
165
182
|
length
|
|
166
183
|
};
|
|
167
184
|
}
|
|
168
|
-
if (batch.shape === 'arrow-table') return {...batch, data: batch.data.slice(start, end), length};
|
|
169
185
|
return {...batch, features: batch.features.slice(start, end), length};
|
|
170
186
|
}
|
|
171
187
|
|
|
172
188
|
/** Projects a batch in the caller-requested order while preserving its shape. */
|
|
173
|
-
export function projectTableBatch
|
|
189
|
+
export function projectTableBatch<BatchType extends ScanBatch>(
|
|
190
|
+
batch: BatchType,
|
|
191
|
+
columns?: readonly string[]
|
|
192
|
+
): BatchType {
|
|
174
193
|
if (columns === undefined) return batch;
|
|
194
|
+
if (!('shape' in batch)) {
|
|
195
|
+
const indices = columns
|
|
196
|
+
.map(column => batch.schema.fields.findIndex(field => field.name === column))
|
|
197
|
+
.filter(index => index >= 0);
|
|
198
|
+
return batch.selectAt(indices) as BatchType;
|
|
199
|
+
}
|
|
175
200
|
const schema = projectTableSchema(batch, columns);
|
|
176
201
|
if (batch.shape === 'object-row-table') {
|
|
177
202
|
return {
|
|
178
203
|
...batch,
|
|
179
204
|
schema,
|
|
180
205
|
data: batch.data.map(row => Object.fromEntries(columns.map(column => [column, row[column]])))
|
|
181
|
-
} as
|
|
206
|
+
} as BatchType;
|
|
182
207
|
}
|
|
183
208
|
if (batch.shape === 'columnar-table') {
|
|
184
209
|
return {
|
|
185
210
|
...batch,
|
|
186
211
|
schema,
|
|
187
212
|
data: Object.fromEntries(columns.map(column => [column, batch.data[column]]))
|
|
188
|
-
};
|
|
213
|
+
} as BatchType;
|
|
189
214
|
}
|
|
190
|
-
if (batch.shape === 'arrow-table')
|
|
191
|
-
return {...batch, schema, data: batch.data.select([...columns])};
|
|
192
215
|
return batch;
|
|
193
216
|
}
|
|
194
217
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {ArrowTable
|
|
5
|
+
import type {Table as ArrowTable} from 'apache-arrow';
|
|
6
|
+
import type {Schema} from '@loaders.gl/core/schema';
|
|
6
7
|
import type {TableScanSource} from '../scan-utils/scan-query-metadata';
|
|
7
8
|
|
|
8
9
|
/** Source exposing named tables. Returned handles remain owned by the source or caller. */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {GetTileParameters, TileGrid, TileGridMatrix, TileGridLimits} from './tile-source';
|
|
6
|
-
import {
|
|
6
|
+
import {resolveTileIndex, validateTileMatrix, validateTileMatrixSet} from '@math.gl/geospatial';
|
|
7
7
|
import type {TileMatrix, TileMatrixSet, VariableMatrixWidth} from '@math.gl/geospatial';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -300,6 +300,17 @@ export function getTileGridValidation(grid: TileGridValidationInput): TileGridVa
|
|
|
300
300
|
message: error instanceof Error ? error.message : 'Invalid tile grid limits.'
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
|
+
// math.gl owns the complete-set contract; it must agree before geometry is called complete.
|
|
304
|
+
if (matrixSet && !issues.length) {
|
|
305
|
+
try {
|
|
306
|
+
validateTileMatrixSet(matrixSet, grid.limits);
|
|
307
|
+
} catch (error) {
|
|
308
|
+
issues.push({
|
|
309
|
+
code: 'invalid-matrix',
|
|
310
|
+
message: error instanceof Error ? error.message : 'Invalid tile matrix set.'
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
303
314
|
const invalid = issues.some(
|
|
304
315
|
issue => issue.code !== 'missing-crs' && issue.code !== 'missing-geometry'
|
|
305
316
|
);
|
|
@@ -320,28 +331,39 @@ export function validateTileGrid(grid: TileGridValidationInput): void {
|
|
|
320
331
|
throw new RangeError('Complete tile matrix geometry requires a CRS.');
|
|
321
332
|
}
|
|
322
333
|
|
|
323
|
-
/**
|
|
334
|
+
/**
|
|
335
|
+
* Validates inclusive base-grid coverage even when resolution or CRS is unknown. Each malformed
|
|
336
|
+
* rectangle throws a `RangeError` that names the reason: a missing or repeated matrix ID, an
|
|
337
|
+
* unknown matrix, an index that is not a nonnegative safe integer, reversed bounds, or bounds
|
|
338
|
+
* beyond the advertised matrix dimensions.
|
|
339
|
+
*/
|
|
324
340
|
export function validateTileGridLimits(grid: TileGridValidationInput): void {
|
|
325
341
|
if (grid.limits === undefined) return;
|
|
326
342
|
if (!Array.isArray(grid.limits)) throw new RangeError('Tile matrix limits require an array.');
|
|
327
343
|
const identifiers = new Set<string>();
|
|
328
344
|
const matrices = grid.tileMatrixSet?.matrices ?? grid.matrices;
|
|
345
|
+
const matrixById = Array.isArray(matrices)
|
|
346
|
+
? new Map(matrices.map(matrix => [matrix?.id, matrix]))
|
|
347
|
+
: undefined;
|
|
329
348
|
for (const limit of grid.limits) {
|
|
330
349
|
if (
|
|
331
350
|
!limit ||
|
|
332
351
|
typeof limit.tileMatrix !== 'string' ||
|
|
333
352
|
!limit.tileMatrix ||
|
|
334
|
-
identifiers.has(limit.tileMatrix)
|
|
353
|
+
identifiers.has(limit.tileMatrix)
|
|
354
|
+
)
|
|
355
|
+
throw new RangeError('Tile matrix limits require unique nonempty matrix identifiers.');
|
|
356
|
+
identifiers.add(limit.tileMatrix);
|
|
357
|
+
if (
|
|
335
358
|
![limit.minTileColumn, limit.maxTileColumn, limit.minTileRow, limit.maxTileRow].every(
|
|
336
359
|
value => Number.isSafeInteger(value) && value >= 0
|
|
337
|
-
)
|
|
338
|
-
limit.minTileColumn > limit.maxTileColumn ||
|
|
339
|
-
limit.minTileRow > limit.maxTileRow
|
|
360
|
+
)
|
|
340
361
|
)
|
|
341
|
-
throw new RangeError('
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
362
|
+
throw new RangeError('Tile matrix limits require nonnegative safe integers.');
|
|
363
|
+
if (limit.minTileColumn > limit.maxTileColumn || limit.minTileRow > limit.maxTileRow)
|
|
364
|
+
throw new RangeError('Tile matrix limits have reversed bounds.');
|
|
365
|
+
const matrix = matrixById?.get(limit.tileMatrix);
|
|
366
|
+
if (matrixById && !matrix)
|
|
345
367
|
throw new RangeError('Tile matrix limits reference an unknown matrix.');
|
|
346
368
|
if (
|
|
347
369
|
matrix?.matrixSize &&
|
|
@@ -391,14 +413,8 @@ export function resolveTileGridTile<
|
|
|
391
413
|
)
|
|
392
414
|
return null;
|
|
393
415
|
if (matrix && grid.tileMatrixSet) {
|
|
394
|
-
const
|
|
395
|
-
|
|
396
|
-
geometry,
|
|
397
|
-
getTileBounds(geometry, parameters.x, parameters.y),
|
|
398
|
-
limits
|
|
399
|
-
);
|
|
400
|
-
if (!ranges.length) return null;
|
|
401
|
-
return {...parameters, x: ranges[0].minTileColumn, tileMatrix};
|
|
416
|
+
const index = resolveTileIndex(matrix as TileMatrix, parameters.x, parameters.y, limits);
|
|
417
|
+
return index ? {...parameters, x: index[0], tileMatrix} : null;
|
|
402
418
|
}
|
|
403
419
|
if (matrix?.variableMatrixWidths?.length)
|
|
404
420
|
throw new RangeError('Coalesced tile requests require complete geometry.');
|
|
@@ -3,17 +3,11 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {Table} from 'apache-arrow';
|
|
6
|
-
import type {
|
|
7
|
-
Schema,
|
|
8
|
-
Feature,
|
|
9
|
-
GeoJSONTable,
|
|
10
|
-
BinaryFeatureCollection,
|
|
11
|
-
ArrowTable
|
|
12
|
-
} from '@loaders.gl/core/schema';
|
|
6
|
+
import type {Schema, Feature, GeoJSONTable, BinaryFeatureCollection} from '@loaders.gl/core/schema';
|
|
13
7
|
import {TileSource, TileSourceProps, GetTileParameters} from './tile-source';
|
|
14
8
|
import type {GetTileDataParameters} from './tile-source';
|
|
15
9
|
|
|
16
|
-
export type VectorTile = Feature[] | GeoJSONTable | BinaryFeatureCollection |
|
|
10
|
+
export type VectorTile = Feature[] | GeoJSONTable | BinaryFeatureCollection | Table;
|
|
17
11
|
|
|
18
12
|
export type VectorTileSourceProps = TileSourceProps;
|
|
19
13
|
|
|
@@ -26,5 +20,5 @@ export interface VectorTileSource extends TileSource {
|
|
|
26
20
|
getVectorTile(parameters: GetTileParameters): Promise<VectorTile | null>;
|
|
27
21
|
getTileData(
|
|
28
22
|
parameters: GetTileDataParameters
|
|
29
|
-
): Promise<Feature[] | GeoJSONTable | BinaryFeatureCollection |
|
|
23
|
+
): Promise<Feature[] | GeoJSONTable | BinaryFeatureCollection | Table | null>;
|
|
30
24
|
}
|
|
@@ -492,9 +492,9 @@ type NativeArrowOutput<T, Options, Wrapped, Native> = [Options] extends [never]
|
|
|
492
492
|
: never;
|
|
493
493
|
|
|
494
494
|
/** Selects native output when certain and a union when shape selection is dynamic. */
|
|
495
|
-
type NativeArrowOutputForOption<T, Options, Wrapped, Native> = [
|
|
496
|
-
|
|
497
|
-
]
|
|
495
|
+
type NativeArrowOutputForOption<T, Options, Wrapped, Native> = [Extract<Wrapped, Native>] extends [
|
|
496
|
+
never
|
|
497
|
+
]
|
|
498
498
|
? Wrapped
|
|
499
499
|
: [RequiredOutputShape<T, Options>] extends [never]
|
|
500
500
|
? [
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import {compileArrowArray, compileArrowExpression} from '@math.gl/
|
|
7
|
-
import type {TableSelection} from '@math.gl/
|
|
8
|
-
import {getExpressionColumns} from '@math.gl/expressions';
|
|
6
|
+
import {compileArrowArray, compileArrowExpression} from '@math.gl/sql/arrow';
|
|
7
|
+
import type {TableSelection} from '@math.gl/sql/parser';
|
|
8
|
+
import {getExpressionColumns} from '@math.gl/sql/expressions';
|
|
9
9
|
|
|
10
|
-
export {compileArrowExpression, compileArrowPredicate} from '@math.gl/
|
|
11
|
-
export {getExpressionColumns} from '@math.gl/expressions';
|
|
10
|
+
export {compileArrowExpression, compileArrowPredicate} from '@math.gl/sql/arrow';
|
|
11
|
+
export {getExpressionColumns} from '@math.gl/sql/expressions';
|
|
12
12
|
|
|
13
13
|
/** Finds source columns and rejects ambiguous projection shapes before a scan. */
|
|
14
14
|
export function getProjectionColumns(selections: readonly TableSelection[]): string[] {
|
|
@@ -87,8 +87,8 @@ export function compileArrowProjection(
|
|
|
87
87
|
|
|
88
88
|
/** Converts typed SELECT items into ordinary SQL CAST expressions. */
|
|
89
89
|
export function normalizeTypedProjection(
|
|
90
|
-
query: import('../query').TypedTableQuery | import('@math.gl/
|
|
91
|
-
): import('@math.gl/
|
|
90
|
+
query: import('../query').TypedTableQuery | import('@math.gl/sql/parser').TableQuery
|
|
91
|
+
): import('@math.gl/sql/parser').TableQuery {
|
|
92
92
|
return {
|
|
93
93
|
...query,
|
|
94
94
|
select: query.select?.map(item => {
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import {TaskRunner, type Task, type TaskWorker} from '@math.gl/tasks';
|
|
6
|
+
import type {Table} from 'apache-arrow';
|
|
7
|
+
import {
|
|
8
|
+
deserializeNativeArrowWorkerResult,
|
|
9
|
+
serializeNativeArrowWorkerResult
|
|
10
|
+
} from '../arrow-worker-transport';
|
|
11
|
+
import {isArrowTable} from '../lib/loader-utils/native-arrow';
|
|
12
|
+
import {queryArrowTable, type ArrowQueryOptions} from './query-arrow-table';
|
|
13
|
+
|
|
14
|
+
type QueryInput =
|
|
15
|
+
| {
|
|
16
|
+
operation: 'query';
|
|
17
|
+
options: Omit<ArrowQueryOptions, 'signal' | 'tables'>;
|
|
18
|
+
tables?: [string, unknown][];
|
|
19
|
+
}
|
|
20
|
+
| {operation: 'get' | 'take'};
|
|
21
|
+
|
|
22
|
+
/** Configuration for the worker that runs Arrow table queries. */
|
|
23
|
+
export type ArrowQueryWorkerOptions = {
|
|
24
|
+
/** Worker module URL or browser worker factory. */
|
|
25
|
+
worker: Pick<TaskWorker, 'url' | 'create'>;
|
|
26
|
+
/** Copy the source by default. Transfer detaches all referenced buffers, including aliases. */
|
|
27
|
+
inputOwnership?: 'copy' | 'transfer';
|
|
28
|
+
/** Cancels initialization. */
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** A worker that retains one source table across calls. */
|
|
33
|
+
export type ArrowQueryWorkerSession = {
|
|
34
|
+
/** Executes a query against the retained table. */
|
|
35
|
+
query(options?: ArrowQueryOptions): Promise<Table>;
|
|
36
|
+
/** Returns a copy of the retained table. The session remains open. */
|
|
37
|
+
getTable(): Promise<Table>;
|
|
38
|
+
/** Transfers the retained table back and closes the session. */
|
|
39
|
+
takeTable(): Promise<Table>;
|
|
40
|
+
/** Drains pending operations and releases the worker. */
|
|
41
|
+
close(): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** Runs one query in a worker and releases it when the query settles. */
|
|
45
|
+
export async function queryArrowTableInWorker(
|
|
46
|
+
source: Table,
|
|
47
|
+
options: ArrowQueryOptions,
|
|
48
|
+
workerOptions: ArrowQueryWorkerOptions
|
|
49
|
+
): Promise<Table> {
|
|
50
|
+
const session = await createArrowQueryWorker(source, {
|
|
51
|
+
...workerOptions,
|
|
52
|
+
signal: options.signal ?? workerOptions.signal
|
|
53
|
+
});
|
|
54
|
+
try {
|
|
55
|
+
return await session.query(options);
|
|
56
|
+
} finally {
|
|
57
|
+
await session.close();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Opens a worker session and sends the source table once. */
|
|
62
|
+
export async function createArrowQueryWorker(
|
|
63
|
+
source: Table,
|
|
64
|
+
{worker, inputOwnership, signal}: ArrowQueryWorkerOptions
|
|
65
|
+
): Promise<ArrowQueryWorkerSession> {
|
|
66
|
+
signal?.throwIfAborted();
|
|
67
|
+
const runner = new TaskRunner();
|
|
68
|
+
try {
|
|
69
|
+
const task = await runner.initializeTask(
|
|
70
|
+
createArrowQueryTask({...worker, capabilities: {atomic: true, streaming: false}}),
|
|
71
|
+
{table: serializeNativeArrowWorkerResult(source, {copy: 'none'})},
|
|
72
|
+
{execution: 'worker', inputOwnership, signal}
|
|
73
|
+
);
|
|
74
|
+
let closing = false;
|
|
75
|
+
/** Rejects operations submitted after session shutdown has started. */
|
|
76
|
+
function assertOpen(): void {
|
|
77
|
+
if (closing) throw new Error('Arrow query worker session is closed');
|
|
78
|
+
}
|
|
79
|
+
return {
|
|
80
|
+
async query({signal: querySignal, tables, ...options} = {}) {
|
|
81
|
+
assertOpen();
|
|
82
|
+
querySignal?.throwIfAborted();
|
|
83
|
+
const childTables =
|
|
84
|
+
tables &&
|
|
85
|
+
Object.entries(tables).map(([name, table]): [string, unknown] => [
|
|
86
|
+
name,
|
|
87
|
+
serializeNativeArrowWorkerResult(table, {copy: 'none'})
|
|
88
|
+
]);
|
|
89
|
+
const result = await task.runTask(
|
|
90
|
+
{operation: 'query', options, tables: childTables},
|
|
91
|
+
{signal: querySignal}
|
|
92
|
+
);
|
|
93
|
+
return deserializeArrowWorkerTable(result.table);
|
|
94
|
+
},
|
|
95
|
+
async getTable() {
|
|
96
|
+
assertOpen();
|
|
97
|
+
const result = await task.runTask({operation: 'get'});
|
|
98
|
+
return deserializeArrowWorkerTable(result.table);
|
|
99
|
+
},
|
|
100
|
+
async takeTable() {
|
|
101
|
+
assertOpen();
|
|
102
|
+
closing = true;
|
|
103
|
+
try {
|
|
104
|
+
const result = await task.runTask({operation: 'take'});
|
|
105
|
+
return deserializeArrowWorkerTable(result.table);
|
|
106
|
+
} finally {
|
|
107
|
+
await runner.close();
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
close() {
|
|
111
|
+
closing = true;
|
|
112
|
+
return runner.close();
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
} catch (error) {
|
|
116
|
+
await runner.close();
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Defines the shared host and worker task for the Arrow query engine. */
|
|
122
|
+
export function createArrowQueryTask(worker?: TaskWorker): Task<{
|
|
123
|
+
initialization: {table: unknown};
|
|
124
|
+
input: QueryInput;
|
|
125
|
+
output: {table: unknown};
|
|
126
|
+
state: Table;
|
|
127
|
+
}> {
|
|
128
|
+
return {
|
|
129
|
+
id: 'loaders.gl-arrow-query',
|
|
130
|
+
worker,
|
|
131
|
+
initialize: ({table}) => deserializeArrowWorkerTable(table),
|
|
132
|
+
process(input, _options, {state, signal}) {
|
|
133
|
+
let result = state;
|
|
134
|
+
if (input.operation === 'query') {
|
|
135
|
+
const tables =
|
|
136
|
+
input.tables &&
|
|
137
|
+
Object.fromEntries(
|
|
138
|
+
input.tables.map(([name, table]) => [name, deserializeArrowWorkerTable(table)])
|
|
139
|
+
);
|
|
140
|
+
result = queryArrowTable(state, {...input.options, tables, signal});
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
// Query results can alias the retained source, including through slices and dictionaries.
|
|
144
|
+
table:
|
|
145
|
+
input.operation === 'take'
|
|
146
|
+
? serializeNativeArrowWorkerResult(result, {copy: 'none'})
|
|
147
|
+
: serializeNativeArrowWorkerResult(result)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Hydrates a table from the query worker protocol. */
|
|
154
|
+
function deserializeArrowWorkerTable(value: unknown): Table {
|
|
155
|
+
const result = deserializeNativeArrowWorkerResult(value);
|
|
156
|
+
if (!isArrowTable(result)) throw new Error('Arrow query workers require an Arrow table');
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
@@ -6,7 +6,6 @@ import * as arrow from 'apache-arrow';
|
|
|
6
6
|
import {
|
|
7
7
|
createScanQueryMetadata,
|
|
8
8
|
emitQueryComplete,
|
|
9
|
-
makeTableScanBatch,
|
|
10
9
|
explainTableQuery,
|
|
11
10
|
getColumnarPredicateColumns,
|
|
12
11
|
planTableQuery,
|
|
@@ -221,7 +220,8 @@ export class FederatedTableScanSource
|
|
|
221
220
|
description: this.description,
|
|
222
221
|
schema: plan.schema,
|
|
223
222
|
capabilities: {table: FEDERATED_TABLE_QUERY_CAPABILITIES},
|
|
224
|
-
statistics: getFederatedStatistics(plan.sources)
|
|
223
|
+
statistics: getFederatedStatistics(plan.sources),
|
|
224
|
+
hasDefaultRowWindow: plan.sources.some(({metadata}) => metadata.hasDefaultRowWindow)
|
|
225
225
|
});
|
|
226
226
|
} finally {
|
|
227
227
|
this.dataSourceManager.unsubscribe({consumerId});
|
|
@@ -321,28 +321,25 @@ export class FederatedTableScanSource
|
|
|
321
321
|
let sourceBatchIndex = 0;
|
|
322
322
|
try {
|
|
323
323
|
for await (const input of resolvedSource.source.read(sourceReadOptions)) {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
? input
|
|
327
|
-
: makeTableScanBatch({
|
|
328
|
-
shape: 'arrow-table',
|
|
329
|
-
data: new arrow.Table(input.schema, [input])
|
|
330
|
-
});
|
|
324
|
+
const native = !('shape' in input);
|
|
325
|
+
const batchLength = native ? input.numRows : input.length;
|
|
331
326
|
throwIfAborted(options.signal);
|
|
332
327
|
if (remaining <= 0) {
|
|
333
328
|
telemetry.earlyTerminationReason = 'limit';
|
|
334
329
|
return;
|
|
335
330
|
}
|
|
336
331
|
if (sourceRemaining <= 0) break;
|
|
337
|
-
if (
|
|
332
|
+
if (!native && input.batchType !== 'data') continue;
|
|
338
333
|
telemetry.batchesRead++;
|
|
339
|
-
telemetry.rowsRead +=
|
|
334
|
+
telemetry.rowsRead += batchLength;
|
|
340
335
|
sourceBatchesDecoded++;
|
|
341
|
-
sourceRowsRead +=
|
|
342
|
-
if (
|
|
343
|
-
const physicalTable =
|
|
344
|
-
|
|
345
|
-
|
|
336
|
+
sourceRowsRead += batchLength;
|
|
337
|
+
if (batchLength <= 0) continue;
|
|
338
|
+
const physicalTable = native
|
|
339
|
+
? new arrow.Table(input.schema, [input])
|
|
340
|
+
: convertTableToArrow(
|
|
341
|
+
input.schema ? input : {...input, schema: resolvedSource.metadata.schema}
|
|
342
|
+
);
|
|
346
343
|
const sourceResult = queryArrowTable(physicalTable, {
|
|
347
344
|
predicate: sourceResidualPredicate,
|
|
348
345
|
limit: Number.isFinite(sourceRemaining) ? sourceRemaining : undefined,
|
|
@@ -376,13 +373,13 @@ export class FederatedTableScanSource
|
|
|
376
373
|
sourceId: resolvedSource.entry.dataSourceId,
|
|
377
374
|
sourceIndex: resolvedSource.sourceIndex,
|
|
378
375
|
sourceBatchIndex: currentSourceBatchIndex,
|
|
379
|
-
sourceMetadata:
|
|
376
|
+
sourceMetadata: native ? Object.fromEntries(input.metadata) : input.metadata
|
|
380
377
|
});
|
|
381
378
|
telemetry.rowsReturned += resultLength;
|
|
382
379
|
sourceRowsReturned += resultLength;
|
|
383
380
|
for (const recordBatch of result.batches) {
|
|
384
381
|
const metadata = new Map(
|
|
385
|
-
|
|
382
|
+
native && resultLength === batchLength ? input.metadata : undefined
|
|
386
383
|
);
|
|
387
384
|
metadata.set('loaders.gl.federation', JSON.stringify(provenance));
|
|
388
385
|
yield new arrow.RecordBatch(recordBatch.schema, recordBatch.data, metadata);
|
package/src/scan/index.ts
CHANGED
|
@@ -8,7 +8,6 @@ export {createScanEngine, registerScanBackend} from './scan-engine';
|
|
|
8
8
|
export {
|
|
9
9
|
executeTableScanBatches,
|
|
10
10
|
filterTableBatch,
|
|
11
|
-
makeTableScanBatch,
|
|
12
11
|
projectTableBatch,
|
|
13
12
|
projectTableSchema,
|
|
14
13
|
truncateTableBatch
|
|
@@ -164,3 +163,10 @@ export type {
|
|
|
164
163
|
TableQueryCapabilities,
|
|
165
164
|
QueryPushdownCapabilityHints
|
|
166
165
|
} from '@loaders.gl/core/loader-utils';
|
|
166
|
+
|
|
167
|
+
export {
|
|
168
|
+
createArrowQueryWorker,
|
|
169
|
+
queryArrowTableInWorker,
|
|
170
|
+
type ArrowQueryWorkerOptions,
|
|
171
|
+
type ArrowQueryWorkerSession
|
|
172
|
+
} from './arrow-query-worker';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {parseSQLPredicate as parseMathSQLPredicate} from '@math.gl/
|
|
5
|
+
import {parseSQLPredicate as parseMathSQLPredicate} from '@math.gl/sql/parser';
|
|
6
6
|
import {validateSQLPredicate} from './sql-predicate-schema';
|
|
7
7
|
import type {
|
|
8
8
|
BoundSQLPredicate,
|