@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
|
@@ -31,36 +31,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var arrow_worker_transport_exports = {};
|
|
32
32
|
__export(arrow_worker_transport_exports, {
|
|
33
33
|
deserializeArrowWorkerResult: () => deserializeArrowWorkerResult,
|
|
34
|
-
deserializeArrowWorkerTable: () => deserializeArrowWorkerTable,
|
|
35
34
|
deserializeNativeArrowWorkerResult: () => deserializeNativeArrowWorkerResult,
|
|
36
35
|
serializeArrowWorkerResult: () => serializeArrowWorkerResult,
|
|
37
|
-
serializeArrowWorkerTable: () => serializeArrowWorkerTable,
|
|
38
36
|
serializeNativeArrowWorkerResult: () => serializeNativeArrowWorkerResult
|
|
39
37
|
});
|
|
40
38
|
module.exports = __toCommonJS(arrow_worker_transport_exports);
|
|
41
39
|
var arrow = __toESM(require("apache-arrow"), 1);
|
|
42
|
-
var import_arrow = require("@math.gl/arrow");
|
|
43
|
-
function serializeArrowWorkerTable(result) {
|
|
44
|
-
if (!isArrowTableWrapper(result)) {
|
|
45
|
-
throw new Error("Workers require Arrow table output");
|
|
46
|
-
}
|
|
47
|
-
const { data, shape: _shape, ...metadata } = result;
|
|
48
|
-
return {
|
|
49
|
-
transport: "arrow-column-envelope",
|
|
50
|
-
metadata: structuredClone(metadata),
|
|
51
|
-
...serializeWorkerColumns(data, { copy: "all" })
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function deserializeArrowWorkerTable(result) {
|
|
55
|
-
if (isArrowWorkerEnvelope(result)) {
|
|
56
|
-
return { ...result.metadata, shape: "arrow-table", data: hydrateWorkerTable(result) };
|
|
57
|
-
}
|
|
58
|
-
if (isLegacyArrowWorkerEnvelope(result)) {
|
|
59
|
-
const { arrowBatchMetadata: _snapshots, data: _columns, ...metadata } = result;
|
|
60
|
-
return { ...metadata, data: hydrateWorkerTable(result) };
|
|
61
|
-
}
|
|
62
|
-
throw new Error("Workers require Arrow column transport");
|
|
63
|
-
}
|
|
40
|
+
var import_arrow = require("@math.gl/core/arrow");
|
|
64
41
|
function serializeNativeArrowWorkerResult(result, options = { copy: "all" }) {
|
|
65
42
|
const batch = result instanceof arrow.RecordBatch;
|
|
66
43
|
if (!batch && !(result instanceof arrow.Table)) {
|
|
@@ -84,62 +61,26 @@ function deserializeNativeArrowWorkerResult(result) {
|
|
|
84
61
|
}
|
|
85
62
|
function serializeArrowWorkerResult(result, options) {
|
|
86
63
|
const workerOptions = options;
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
return serializeNativeArrowWorkerResult(result, { copy: bufferCopyMode ?? "all" });
|
|
90
|
-
}
|
|
91
|
-
if (!isArrowTableWrapper(result)) {
|
|
92
|
-
return result;
|
|
93
|
-
}
|
|
94
|
-
const { data, shape: _shape, ...metadata } = result;
|
|
95
|
-
return {
|
|
96
|
-
transport: "arrow-column-envelope",
|
|
97
|
-
metadata: structuredClone(metadata),
|
|
98
|
-
...serializeWorkerColumns(data, bufferCopyMode ? { copy: bufferCopyMode } : void 0)
|
|
99
|
-
};
|
|
64
|
+
const copy = workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
|
|
65
|
+
return result instanceof arrow.Table || result instanceof arrow.RecordBatch ? serializeNativeArrowWorkerResult(result, { copy: copy ?? "all" }) : result;
|
|
100
66
|
}
|
|
101
67
|
function deserializeArrowWorkerResult(result) {
|
|
102
68
|
const transport = result?.transport;
|
|
103
|
-
|
|
104
|
-
return deserializeNativeArrowWorkerResult(result);
|
|
105
|
-
}
|
|
106
|
-
return isArrowWorkerEnvelope(result) || isLegacyArrowWorkerEnvelope(result) ? deserializeArrowWorkerTable(result) : result;
|
|
107
|
-
}
|
|
108
|
-
function isArrowTableWrapper(value) {
|
|
109
|
-
const table = value;
|
|
110
|
-
return Boolean(
|
|
111
|
-
table && table.shape === "arrow-table" && table.data && typeof table.data === "object" && "batches" in table.data
|
|
112
|
-
);
|
|
69
|
+
return transport === "arrow-table-columns" || transport === "arrow-record-batch" ? deserializeNativeArrowWorkerResult(result) : result;
|
|
113
70
|
}
|
|
114
71
|
function hasArrowWorkerColumns(value) {
|
|
115
72
|
const columns = value;
|
|
116
73
|
return columns?.data?.transport === "arrow-js" && Array.isArray(columns.data.batches);
|
|
117
74
|
}
|
|
118
|
-
function isArrowWorkerEnvelope(value) {
|
|
119
|
-
return value?.transport === "arrow-column-envelope" && hasArrowWorkerColumns(value);
|
|
120
|
-
}
|
|
121
|
-
function isLegacyArrowWorkerEnvelope(value) {
|
|
122
|
-
return value?.shape === "arrow-table" && hasArrowWorkerColumns(value);
|
|
123
|
-
}
|
|
124
75
|
function serializeWorkerColumns(table, options) {
|
|
125
76
|
return {
|
|
126
77
|
arrowBatchMetadata: snapshotBatchMetadata(table),
|
|
127
|
-
data:
|
|
78
|
+
data: (0, import_arrow.dehydrateArrowTable)(table, options)
|
|
128
79
|
};
|
|
129
80
|
}
|
|
130
|
-
function dehydrateWorkerTable(table, options) {
|
|
131
|
-
const payload = (0, import_arrow.dehydrateArrowTable)(table, options);
|
|
132
|
-
if (table.numCols === 0) {
|
|
133
|
-
for (const [index, batch] of table.batches.entries()) {
|
|
134
|
-
payload.batches[index].length = batch.numRows;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return payload;
|
|
138
|
-
}
|
|
139
81
|
function snapshotBatchMetadata(table) {
|
|
140
82
|
return table.batches.map((batch) => ({
|
|
141
|
-
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
142
|
-
metadata: Array.from(batch.metadata)
|
|
83
|
+
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
143
84
|
}));
|
|
144
85
|
}
|
|
145
86
|
function hydrateWorkerTable(result) {
|
|
@@ -147,27 +88,18 @@ function hydrateWorkerTable(result) {
|
|
|
147
88
|
const table = (0, import_arrow.hydrateArrowTable)(data);
|
|
148
89
|
const batches = table.batches.map((batch, index) => {
|
|
149
90
|
const snapshot = arrowBatchMetadata?.[index];
|
|
150
|
-
|
|
91
|
+
return snapshot ? (0, import_arrow.createRecordBatchWithMetadata)(
|
|
151
92
|
arrow.tableFromIPC(snapshot.schema).schema,
|
|
152
93
|
batch.data,
|
|
153
|
-
new Map(snapshot.metadata)
|
|
94
|
+
snapshot.metadata ? new Map(snapshot.metadata) : (0, import_arrow.getRecordBatchMetadata)(batch)
|
|
154
95
|
) : batch;
|
|
155
|
-
const rowCount = data.batches[index].length;
|
|
156
|
-
if (restored.numCols === 0 && restored.numRows !== rowCount) {
|
|
157
|
-
Object.defineProperty(restored, "data", {
|
|
158
|
-
value: new arrow.Data(new arrow.Struct([]), 0, rowCount, 0, void 0, [])
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return restored;
|
|
162
96
|
});
|
|
163
97
|
return new arrow.Table(table.schema, batches);
|
|
164
98
|
}
|
|
165
99
|
// Annotate the CommonJS export names for ESM import in node:
|
|
166
100
|
0 && (module.exports = {
|
|
167
101
|
deserializeArrowWorkerResult,
|
|
168
|
-
deserializeArrowWorkerTable,
|
|
169
102
|
deserializeNativeArrowWorkerResult,
|
|
170
103
|
serializeArrowWorkerResult,
|
|
171
|
-
serializeArrowWorkerTable,
|
|
172
104
|
serializeNativeArrowWorkerResult
|
|
173
105
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/arrow-worker-transport.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAIA,YAAuB;AACvB,mBASO;AAkBD,SAAU,iCACd,QACA,UAAoC,EAAC,MAAM,MAAK,GAAC;AAEjD,QAAM,QAAQ,kBAAwB;AACtC,MAAI,CAAC,SAAS,EAAE,kBAAwB,cAAQ;AAC9C,UAAM,IAAI,MAAM,oCAAoC;EACtD;AACA,SAAO;IACL,WAAW,QAAQ,uBAAuB;IAC1C,SAAS,QACL,EAAC,UAAM,wCAA0B,QAAQ,OAAO,EAAC,IACjD,uBAAuB,QAAQ,OAAO;;AAE9C;AAGM,SAAU,mCACd,QAAe;AAEf,QAAM,UAAU;AAChB,OACG,mCAAS,eAAc,0BAAyB,mCAAS,eAAc,wBACxE,CAAC,sBAAsB,QAAQ,OAAO,GACtC;AACA,UAAM,IAAI,MAAM,wCAAwC;EA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,QAAI,qCAAuB,KAAK,CAAC,IAEhF;EACN,CAAC;AACD,SAAO,IAAU,YAAM,MAAM,QAAQ,OAAO;AAC9C;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import * as arrow from 'apache-arrow';
|
|
2
|
-
import { type SplitArrowBuffersOptions } from '@math.gl/arrow';
|
|
3
|
-
/** Serializes Arrow columns with owned buffers so transfers cannot detach retained parser state. */
|
|
4
|
-
export declare function serializeArrowWorkerTable(result: unknown): unknown;
|
|
5
|
-
/** Hydrates the column-buffer worker protocol; other wire formats are rejected. */
|
|
6
|
-
export declare function deserializeArrowWorkerTable(result: unknown): any;
|
|
2
|
+
import { type SplitArrowBuffersOptions } from '@math.gl/core/arrow';
|
|
7
3
|
/** Serializes a native Arrow table or batch with owned column buffers for worker transport. */
|
|
8
4
|
export declare function serializeNativeArrowWorkerResult(result: arrow.Table | arrow.RecordBatch, options?: SplitArrowBuffersOptions): unknown;
|
|
9
5
|
/** Hydrates a native Arrow worker result while preserving its table or batch type. */
|
|
10
6
|
export declare function deserializeNativeArrowWorkerResult(result: unknown): arrow.Table | arrow.RecordBatch;
|
|
11
|
-
/**
|
|
7
|
+
/** Transfers native Arrow columns and passes other loader results through. */
|
|
12
8
|
export declare function serializeArrowWorkerResult(result: unknown, options?: unknown): unknown;
|
|
13
|
-
/**
|
|
14
|
-
export declare function deserializeArrowWorkerResult(result: unknown):
|
|
9
|
+
/** Restores native Arrow worker results and passes other loader results through. */
|
|
10
|
+
export declare function deserializeArrowWorkerResult<ResultType = unknown>(result: unknown): ResultType;
|
|
15
11
|
//# sourceMappingURL=arrow-worker-transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-worker-transport.d.ts","sourceRoot":"","sources":["../src/arrow-worker-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"arrow-worker-transport.d.ts","sourceRoot":"","sources":["../src/arrow-worker-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAQL,KAAK,wBAAwB,EAC9B,MAAM,qBAAqB,CAAC;AAiB7B,+FAA+F;AAC/F,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,EACvC,OAAO,GAAE,wBAAwC,GAChD,OAAO,CAWT;AAED,sFAAsF;AACtF,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,OAAO,GACd,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,WAAW,CAajC;AAED,8EAA8E;AAC9E,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAOtF;AAED,oFAAoF;AACpF,wBAAgB,4BAA4B,CAAC,UAAU,GAAG,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,UAAU,CAO9F"}
|
|
@@ -2,32 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import * as arrow from 'apache-arrow';
|
|
5
|
-
import { dehydrateArrowTable, dehydrateArrowRecordBatch, hydrateArrowTable, hydrateArrowRecordBatch } from '@math.gl/arrow';
|
|
6
|
-
/** Serializes Arrow columns with owned buffers so transfers cannot detach retained parser state. */
|
|
7
|
-
export function serializeArrowWorkerTable(result) {
|
|
8
|
-
if (!isArrowTableWrapper(result)) {
|
|
9
|
-
throw new Error('Workers require Arrow table output');
|
|
10
|
-
}
|
|
11
|
-
const { data, shape: _shape, ...metadata } = result;
|
|
12
|
-
// Headers, sidecar indexes, and mesh indices can also retain parser-owned binary buffers.
|
|
13
|
-
// Clone only this small envelope; the Arrow table always uses column-buffer transfer.
|
|
14
|
-
return {
|
|
15
|
-
transport: 'arrow-column-envelope',
|
|
16
|
-
metadata: structuredClone(metadata),
|
|
17
|
-
...serializeWorkerColumns(data, { copy: 'all' })
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
/** Hydrates the column-buffer worker protocol; other wire formats are rejected. */
|
|
21
|
-
export function deserializeArrowWorkerTable(result) {
|
|
22
|
-
if (isArrowWorkerEnvelope(result)) {
|
|
23
|
-
return { ...result.metadata, shape: 'arrow-table', data: hydrateWorkerTable(result) };
|
|
24
|
-
}
|
|
25
|
-
if (isLegacyArrowWorkerEnvelope(result)) {
|
|
26
|
-
const { arrowBatchMetadata: _snapshots, data: _columns, ...metadata } = result;
|
|
27
|
-
return { ...metadata, data: hydrateWorkerTable(result) };
|
|
28
|
-
}
|
|
29
|
-
throw new Error('Workers require Arrow column transport');
|
|
30
|
-
}
|
|
5
|
+
import { createRecordBatchWithMetadata, getRecordBatchMetadata, dehydrateArrowTable, dehydrateArrowRecordBatch, hydrateArrowTable, hydrateArrowRecordBatch } from '@math.gl/core/arrow';
|
|
31
6
|
/** Serializes a native Arrow table or batch with owned column buffers for worker transport. */
|
|
32
7
|
export function serializeNativeArrowWorkerResult(result, options = { copy: 'all' }) {
|
|
33
8
|
const batch = result instanceof arrow.RecordBatch;
|
|
@@ -54,78 +29,37 @@ export function deserializeNativeArrowWorkerResult(result) {
|
|
|
54
29
|
const data = hydrateWorkerTable(payload.columns);
|
|
55
30
|
return payload.transport === 'arrow-record-batch' ? data.batches[0] : data;
|
|
56
31
|
}
|
|
57
|
-
/**
|
|
32
|
+
/** Transfers native Arrow columns and passes other loader results through. */
|
|
58
33
|
export function serializeArrowWorkerResult(result, options) {
|
|
59
34
|
const workerOptions = options;
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (!isArrowTableWrapper(result)) {
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
const { data, shape: _shape, ...metadata } = result;
|
|
68
|
-
return {
|
|
69
|
-
transport: 'arrow-column-envelope',
|
|
70
|
-
metadata: structuredClone(metadata),
|
|
71
|
-
...serializeWorkerColumns(data, bufferCopyMode ? { copy: bufferCopyMode } : undefined)
|
|
72
|
-
};
|
|
35
|
+
const copy = workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
|
|
36
|
+
return result instanceof arrow.Table || result instanceof arrow.RecordBatch
|
|
37
|
+
? serializeNativeArrowWorkerResult(result, { copy: copy ?? 'all' })
|
|
38
|
+
: result;
|
|
73
39
|
}
|
|
74
|
-
/**
|
|
40
|
+
/** Restores native Arrow worker results and passes other loader results through. */
|
|
75
41
|
export function deserializeArrowWorkerResult(result) {
|
|
76
42
|
const transport = result?.transport;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return isArrowWorkerEnvelope(result) || isLegacyArrowWorkerEnvelope(result)
|
|
81
|
-
? deserializeArrowWorkerTable(result)
|
|
82
|
-
: result;
|
|
83
|
-
}
|
|
84
|
-
function isArrowTableWrapper(value) {
|
|
85
|
-
const table = value;
|
|
86
|
-
return Boolean(table &&
|
|
87
|
-
table.shape === 'arrow-table' &&
|
|
88
|
-
table.data &&
|
|
89
|
-
typeof table.data === 'object' &&
|
|
90
|
-
'batches' in table.data);
|
|
43
|
+
return (transport === 'arrow-table-columns' || transport === 'arrow-record-batch'
|
|
44
|
+
? deserializeNativeArrowWorkerResult(result)
|
|
45
|
+
: result);
|
|
91
46
|
}
|
|
92
47
|
/** Recognizes a transferable Arrow columns descriptor. */
|
|
93
48
|
function hasArrowWorkerColumns(value) {
|
|
94
49
|
const columns = value;
|
|
95
50
|
return columns?.data?.transport === 'arrow-js' && Array.isArray(columns.data.batches);
|
|
96
51
|
}
|
|
97
|
-
/** Recognizes payloads carrying format-specific metadata. */
|
|
98
|
-
function isArrowWorkerEnvelope(value) {
|
|
99
|
-
return (value?.transport === 'arrow-column-envelope' &&
|
|
100
|
-
hasArrowWorkerColumns(value));
|
|
101
|
-
}
|
|
102
|
-
/** Recognizes wrapped column payloads from older workers. */
|
|
103
|
-
function isLegacyArrowWorkerEnvelope(value) {
|
|
104
|
-
return (value?.shape === 'arrow-table' &&
|
|
105
|
-
hasArrowWorkerColumns(value));
|
|
106
|
-
}
|
|
107
52
|
/** Serializes columns and independent batch metadata. */
|
|
108
53
|
function serializeWorkerColumns(table, options) {
|
|
109
54
|
return {
|
|
110
55
|
arrowBatchMetadata: snapshotBatchMetadata(table),
|
|
111
|
-
data:
|
|
56
|
+
data: dehydrateArrowTable(table, options)
|
|
112
57
|
};
|
|
113
58
|
}
|
|
114
|
-
/**
|
|
115
|
-
function dehydrateWorkerTable(table, options) {
|
|
116
|
-
const payload = dehydrateArrowTable(table, options);
|
|
117
|
-
if (table.numCols === 0) {
|
|
118
|
-
for (const [index, batch] of table.batches.entries()) {
|
|
119
|
-
payload.batches[index].length = batch.numRows;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return payload;
|
|
123
|
-
}
|
|
124
|
-
/** Captures batch schemas and custom metadata before transferring column buffers. */
|
|
59
|
+
/** Captures batch schemas before transferring column buffers. */
|
|
125
60
|
function snapshotBatchMetadata(table) {
|
|
126
61
|
return table.batches.map(batch => ({
|
|
127
|
-
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
128
|
-
metadata: Array.from(batch.metadata)
|
|
62
|
+
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
129
63
|
}));
|
|
130
64
|
}
|
|
131
65
|
/** Restores the table and its batch snapshots, including legacy payloads without snapshots. */
|
|
@@ -134,17 +68,9 @@ function hydrateWorkerTable(result) {
|
|
|
134
68
|
const table = hydrateArrowTable(data);
|
|
135
69
|
const batches = table.batches.map((batch, index) => {
|
|
136
70
|
const snapshot = arrowBatchMetadata?.[index];
|
|
137
|
-
|
|
138
|
-
?
|
|
71
|
+
return snapshot
|
|
72
|
+
? createRecordBatchWithMetadata(arrow.tableFromIPC(snapshot.schema).schema, batch.data, snapshot.metadata ? new Map(snapshot.metadata) : getRecordBatchMetadata(batch))
|
|
139
73
|
: batch;
|
|
140
|
-
// Arrow JS derives the length of a struct from its children, which can be empty.
|
|
141
|
-
const rowCount = data.batches[index].length;
|
|
142
|
-
if (restored.numCols === 0 && restored.numRows !== rowCount) {
|
|
143
|
-
Object.defineProperty(restored, 'data', {
|
|
144
|
-
value: new arrow.Data(new arrow.Struct([]), 0, rowCount, 0, undefined, [])
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
return restored;
|
|
148
74
|
});
|
|
149
75
|
return new arrow.Table(table.schema, batches);
|
|
150
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow-worker-transport.js","sourceRoot":"","sources":["../src/arrow-worker-transport.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EAGxB,MAAM,
|
|
1
|
+
{"version":3,"file":"arrow-worker-transport.js","sourceRoot":"","sources":["../src/arrow-worker-transport.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EACL,6BAA6B,EAC7B,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,uBAAuB,EAGxB,MAAM,qBAAqB,CAAC;AAiB7B,+FAA+F;AAC/F,MAAM,UAAU,gCAAgC,CAC9C,MAAuC,EACvC,UAAoC,EAAC,IAAI,EAAE,KAAK,EAAC;IAEjD,MAAM,KAAK,GAAG,MAAM,YAAY,KAAK,CAAC,WAAW,CAAC;IAClD,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,MAAM,YAAY,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,C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