@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,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type * as arrow from 'apache-arrow';
|
|
5
6
|
import type {Table} from '@loaders.gl/core/schema';
|
|
6
7
|
|
|
7
8
|
import {ArrowLikeSchema} from './arrow-like-schema';
|
|
@@ -20,10 +21,10 @@ import {
|
|
|
20
21
|
} from '../tables/table-accessors';
|
|
21
22
|
|
|
22
23
|
class ArrowLikeVector {
|
|
23
|
-
table: Table;
|
|
24
|
+
table: Table | arrow.Table;
|
|
24
25
|
columnName: string;
|
|
25
26
|
|
|
26
|
-
constructor(table: Table, columnName: string) {
|
|
27
|
+
constructor(table: Table | arrow.Table, columnName: string) {
|
|
27
28
|
this.table = table;
|
|
28
29
|
this.columnName = columnName;
|
|
29
30
|
}
|
|
@@ -33,10 +34,8 @@ class ArrowLikeVector {
|
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
toArray(): ArrayLike<unknown> {
|
|
37
|
+
if (!('shape' in this.table)) return this.table.getChild(this.columnName)?.toArray();
|
|
36
38
|
switch (this.table.shape) {
|
|
37
|
-
case 'arrow-table':
|
|
38
|
-
const arrowTable = this.table.data as any;
|
|
39
|
-
return arrowTable.getChild(this.columnName)?.toArray();
|
|
40
39
|
case 'columnar-table':
|
|
41
40
|
return this.table.data[this.columnName];
|
|
42
41
|
default:
|
|
@@ -51,12 +50,13 @@ class ArrowLikeVector {
|
|
|
51
50
|
*/
|
|
52
51
|
export class ArrowLikeTable {
|
|
53
52
|
schema: ArrowLikeSchema;
|
|
54
|
-
table: Table;
|
|
53
|
+
table: Table | arrow.Table;
|
|
55
54
|
|
|
56
|
-
constructor(table: Table) {
|
|
57
|
-
const schema =
|
|
55
|
+
constructor(table: Table | arrow.Table) {
|
|
56
|
+
const schema =
|
|
57
|
+
'shape' in table ? table.schema || deduceTableSchema(table) : deduceTableSchema(table);
|
|
58
58
|
this.schema = new ArrowLikeSchema(schema.fields, schema.metadata);
|
|
59
|
-
this.table = {...table, schema};
|
|
59
|
+
this.table = 'shape' in table ? {...table, schema} : table;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// get schema() {
|
|
@@ -64,6 +64,7 @@ export class ArrowLikeTable {
|
|
|
64
64
|
// }
|
|
65
65
|
|
|
66
66
|
get data() {
|
|
67
|
+
if (!('shape' in this.table)) return this.table;
|
|
67
68
|
return this.table.shape === 'geojson-table' ? this.table.features : this.table.data;
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
ColumnarTableBatch
|
|
10
10
|
} from '@loaders.gl/core/schema';
|
|
11
11
|
import * as arrow from 'apache-arrow';
|
|
12
|
-
import {
|
|
12
|
+
import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
|
|
13
13
|
import {makeArrowMetadataBatch} from '../../arrow/arrow-metadata';
|
|
14
14
|
import {convertTable} from '../tables/convert-table';
|
|
15
15
|
|
|
@@ -21,12 +21,12 @@ export function convertBatch(
|
|
|
21
21
|
shape: 'arrow'
|
|
22
22
|
): arrow.RecordBatch;
|
|
23
23
|
|
|
24
|
-
/** Converts one batch
|
|
24
|
+
/** Converts one portable batch or returns the supplied native record batch. */
|
|
25
25
|
export function convertBatch(
|
|
26
26
|
batch: TableBatch | arrow.RecordBatch,
|
|
27
27
|
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
|
|
28
28
|
): TableBatch | arrow.RecordBatch {
|
|
29
|
-
if (
|
|
29
|
+
if (isArrowRecordBatch(batch)) {
|
|
30
30
|
if (shape === 'arrow') return batch;
|
|
31
31
|
throw new Error('Convert a native RecordBatch as a table to select a row or column layout');
|
|
32
32
|
}
|
|
@@ -39,9 +39,6 @@ export function convertBatch(
|
|
|
39
39
|
return {...batch, ...convertTable(batch, 'columnar-table')};
|
|
40
40
|
case 'arrow': {
|
|
41
41
|
const table = convertTable(batch, 'arrow');
|
|
42
|
-
if (table.batches.length > 1) {
|
|
43
|
-
throw new Error('Use convertBatches to expand multiple Arrow record batches');
|
|
44
|
-
}
|
|
45
42
|
return table.batches[0] ?? makeArrowMetadataBatch(table.schema);
|
|
46
43
|
}
|
|
47
44
|
default:
|
|
@@ -68,14 +65,14 @@ export function convertBatches(
|
|
|
68
65
|
|
|
69
66
|
/**
|
|
70
67
|
* Converts batches in emission order. For Arrow output, yields native record batches,
|
|
71
|
-
*
|
|
68
|
+
* preserving the declared schema of empty inputs.
|
|
72
69
|
*/
|
|
73
70
|
export async function* convertBatches(
|
|
74
71
|
batches: Iterable<TableBatch | arrow.RecordBatch> | AsyncIterable<TableBatch | arrow.RecordBatch>,
|
|
75
72
|
shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
|
|
76
73
|
): AsyncIterableIterator<TableBatch | arrow.RecordBatch> {
|
|
77
74
|
for await (const batch of batches) {
|
|
78
|
-
if (
|
|
75
|
+
if (isArrowRecordBatch(batch)) {
|
|
79
76
|
if (shape !== 'arrow') throw new Error('Expected a loaders.gl table batch');
|
|
80
77
|
yield batch;
|
|
81
78
|
continue;
|
|
@@ -39,18 +39,14 @@ export function* makeArrowRecordBatchIterator(
|
|
|
39
39
|
yield* sliceNativeArrowBatches(table, options?.batchSize);
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
|
-
yield*
|
|
42
|
+
yield* makePortableTableRecordBatchIterator(table, options);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/** Converts loaders.gl table representations to record batches. */
|
|
46
|
-
export function*
|
|
46
|
+
export function* makePortableTableRecordBatchIterator(
|
|
47
47
|
table: Table,
|
|
48
48
|
options?: {batchSize?: number}
|
|
49
49
|
): IterableIterator<arrow.RecordBatch> {
|
|
50
|
-
if (table.shape === 'arrow-table') {
|
|
51
|
-
yield* sliceNativeArrowBatches(table.data, options?.batchSize);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
50
|
const arrowSchema = convertSchemaToArrow(table.schema!);
|
|
55
51
|
|
|
56
52
|
const length = getTableLength(table);
|
|
@@ -10,14 +10,9 @@ import type {
|
|
|
10
10
|
ArrayRowTable,
|
|
11
11
|
Feature
|
|
12
12
|
} from '@loaders.gl/core/schema';
|
|
13
|
-
import * as arrow from 'apache-arrow';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
mergeArrowSchemas,
|
|
17
|
-
makeArrowMetadataBatch
|
|
18
|
-
} from '../../arrow/arrow-metadata';
|
|
19
|
-
import {convertSchemaToArrow, serializeArrowSchema} from '../../schema/convert-arrow-schema';
|
|
20
|
-
import {isNativeArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
|
|
13
|
+
import type * as arrow from 'apache-arrow';
|
|
14
|
+
import {makeArrowTableFromBatches} from '../../arrow/arrow-metadata';
|
|
15
|
+
import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
|
|
21
16
|
import {getTableLength} from '../tables/table-accessors';
|
|
22
17
|
|
|
23
18
|
/**
|
|
@@ -44,13 +39,12 @@ export async function makeTableFromBatches(
|
|
|
44
39
|
let shape: Table['shape'] | 'arrow' | null = null;
|
|
45
40
|
let schema: Schema | undefined;
|
|
46
41
|
const arrowBatches: arrow.RecordBatch[] = [];
|
|
47
|
-
let arrowSchema: arrow.Schema | undefined;
|
|
48
42
|
|
|
49
43
|
for await (const batch of batchIterator) {
|
|
50
|
-
const batchShape =
|
|
44
|
+
const batchShape = isArrowRecordBatch(batch) ? 'arrow' : batch.shape;
|
|
51
45
|
shape ??= batchShape;
|
|
52
46
|
if (shape !== batchShape) throw new Error('Batches must have the same shape');
|
|
53
|
-
if (
|
|
47
|
+
if (isArrowRecordBatch(batch)) {
|
|
54
48
|
arrowBatches.push(batch);
|
|
55
49
|
continue;
|
|
56
50
|
}
|
|
@@ -81,17 +75,6 @@ export async function makeTableFromBatches(
|
|
|
81
75
|
}
|
|
82
76
|
break;
|
|
83
77
|
|
|
84
|
-
case 'arrow-table': {
|
|
85
|
-
for (const recordBatch of batch.data.batches) {
|
|
86
|
-
arrowSchema = mergeArrowSchemas(arrowSchema, recordBatch.schema);
|
|
87
|
-
arrowBatches.push(recordBatch);
|
|
88
|
-
}
|
|
89
|
-
arrowSchema = mergeArrowSchemas(arrowSchema, batch.data.schema);
|
|
90
|
-
if (batch.schema)
|
|
91
|
-
arrowSchema = mergeArrowSchemas(arrowSchema, convertSchemaToArrow(batch.schema));
|
|
92
|
-
if (batch.data.batches.length === 0) arrowBatches.push(makeArrowMetadataBatch(arrowSchema));
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
78
|
case 'columnar-table':
|
|
96
79
|
default:
|
|
97
80
|
throw new Error('shape');
|
|
@@ -105,11 +88,6 @@ export async function makeTableFromBatches(
|
|
|
105
88
|
switch (shape) {
|
|
106
89
|
case 'arrow':
|
|
107
90
|
return makeArrowTableFromBatches(arrowBatches);
|
|
108
|
-
case 'arrow-table': {
|
|
109
|
-
const collected = await makeArrowTableFromBatches(arrowBatches);
|
|
110
|
-
const data = collected && new arrow.Table(arrowSchema || collected.schema, collected.batches);
|
|
111
|
-
return data ? {shape: 'arrow-table', data, schema: serializeArrowSchema(data.schema)} : null;
|
|
112
|
-
}
|
|
113
91
|
case 'array-row-table':
|
|
114
92
|
return {shape: 'array-row-table', data: arrayRows!, schema};
|
|
115
93
|
|
|
@@ -15,38 +15,25 @@ import type {
|
|
|
15
15
|
import {convertTable} from './convert-table';
|
|
16
16
|
import {deduceTableSchema} from '../../schema/deduce-table-schema';
|
|
17
17
|
import {convertArrowToSchema, convertSchemaToArrow} from '../../schema/convert-arrow-schema';
|
|
18
|
-
import {
|
|
18
|
+
import {makePortableTableRecordBatchIterator} from '../batches/make-arrow-batch-iterator';
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Converts a loaders.gl table to native Arrow and preserves the schema on empty input.
|
|
22
|
-
* Native Arrow inputs
|
|
22
|
+
* Native Arrow inputs retain their identity.
|
|
23
23
|
*/
|
|
24
24
|
export function convertTableToArrow(
|
|
25
25
|
table: Table | arrow.Table,
|
|
26
26
|
options?: {batchSize?: number}
|
|
27
27
|
): arrow.Table {
|
|
28
28
|
if (!('shape' in table)) return table;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
case 'columnar-table':
|
|
34
|
-
// TODO - optimized implementation is possible
|
|
35
|
-
// return convertColumnarTableToArrow(table, options);
|
|
36
|
-
|
|
37
|
-
// fall through
|
|
38
|
-
|
|
39
|
-
default:
|
|
40
|
-
const schema = table.schema ?? deduceTableSchema(table);
|
|
41
|
-
return new arrow.Table(convertSchemaToArrow(schema), [
|
|
42
|
-
...makeWrappedTableRecordBatchIterator({...table, schema}, options)
|
|
43
|
-
]);
|
|
44
|
-
}
|
|
29
|
+
const schema = table.schema ?? deduceTableSchema(table);
|
|
30
|
+
return new arrow.Table(convertSchemaToArrow(schema), [
|
|
31
|
+
...makePortableTableRecordBatchIterator({...table, schema}, options)
|
|
32
|
+
]);
|
|
45
33
|
}
|
|
46
34
|
|
|
47
35
|
/** Loader table layouts produced when converting from Arrow. */
|
|
48
|
-
type
|
|
49
|
-
type NonArrowTableShape = NonArrowTable['shape'];
|
|
36
|
+
type NonArrowTableShape = Table['shape'];
|
|
50
37
|
|
|
51
38
|
/**
|
|
52
39
|
* Convert an Apache Arrow table to a loaders.gl Table
|
|
@@ -57,7 +44,7 @@ export function convertArrowToTable(arrow: arrow.Table, shape: 'columnar-table')
|
|
|
57
44
|
export function convertArrowToTable(arrow: arrow.Table, shape: 'object-row-table'): ObjectRowTable;
|
|
58
45
|
export function convertArrowToTable(arrow: arrow.Table, shape: 'array-row-table'): ArrayRowTable;
|
|
59
46
|
export function convertArrowToTable(arrow: arrow.Table, shape: 'geojson-table'): GeoJSONTable;
|
|
60
|
-
export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShape):
|
|
47
|
+
export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShape): Table;
|
|
61
48
|
|
|
62
49
|
/**
|
|
63
50
|
* Convert an Apache Arrow table to a loaders.gl Table
|
|
@@ -66,7 +53,7 @@ export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShap
|
|
|
66
53
|
export function convertArrowToTable(
|
|
67
54
|
arrowTable: arrow.Table,
|
|
68
55
|
shape: NonArrowTableShape | 'arrow'
|
|
69
|
-
):
|
|
56
|
+
): Table | arrow.Table {
|
|
70
57
|
switch (shape) {
|
|
71
58
|
case 'arrow':
|
|
72
59
|
return arrowTable;
|
|
@@ -106,7 +93,8 @@ function convertArrowToColumnarTable(arrowTable: arrow.Table): ColumnarTable {
|
|
|
106
93
|
for (const field of arrowTable.schema.fields) {
|
|
107
94
|
// This (is intended to) coalesce all record batches into a single typed array
|
|
108
95
|
const arrowColumn = arrowTable.getChild(field.name);
|
|
109
|
-
|
|
96
|
+
// Typed value buffers omit the validity bitmap; materialize nullable columns through Arrow.
|
|
97
|
+
const values = arrowColumn?.nullCount ? Array.from(arrowColumn) : arrowColumn?.toArray();
|
|
110
98
|
columns[field.name] = values;
|
|
111
99
|
}
|
|
112
100
|
|
|
@@ -141,53 +129,3 @@ function convertArrowToGeoJSONTable(arrowTable: arrow.Table): GeoJSONTable {
|
|
|
141
129
|
features
|
|
142
130
|
};
|
|
143
131
|
}
|
|
144
|
-
|
|
145
|
-
// /**
|
|
146
|
-
// * Wrap an apache arrow table in a loaders.gl table wrapper.
|
|
147
|
-
// * From this additional conversions are available.
|
|
148
|
-
// * @param arrowTable
|
|
149
|
-
// * @returns
|
|
150
|
-
// */
|
|
151
|
-
// function convertArrowToArrowTable(arrowTable: arrow.Table): ArrowTable {
|
|
152
|
-
// return {
|
|
153
|
-
// shape: 'arrow-table',
|
|
154
|
-
// schema: convertArrowToSchema(arrowTable.schema),
|
|
155
|
-
// data: arrowTable
|
|
156
|
-
// };
|
|
157
|
-
// }
|
|
158
|
-
|
|
159
|
-
// function convertArrowToArrayRowTable(arrowTable: arrow.Table): ArrayRowTable {
|
|
160
|
-
// const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
161
|
-
// return convertTable(columnarTable, 'array-row-table');
|
|
162
|
-
// }
|
|
163
|
-
|
|
164
|
-
// function convertArrowToObjectRowTable(arrowTable: arrow.Table): ObjectRowTable {
|
|
165
|
-
// const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
166
|
-
// return convertTable(columnarTable, 'object-row-table');
|
|
167
|
-
// }
|
|
168
|
-
|
|
169
|
-
// /**
|
|
170
|
-
// * Convert an Apache Arrow table to a ColumnarTable
|
|
171
|
-
// * @note Currently does not convert schema
|
|
172
|
-
// */
|
|
173
|
-
// function convertArrowToColumnarTable(arrowTable: arrow.Table): ColumnarTable {
|
|
174
|
-
// // TODO - avoid calling `getColumn` on columns we are not interested in?
|
|
175
|
-
// // Add options object?
|
|
176
|
-
|
|
177
|
-
// const columns: ColumnarTable['data'] = {};
|
|
178
|
-
|
|
179
|
-
// for (const field of arrowTable.schema.fields) {
|
|
180
|
-
// // This (is intended to) coalesce all record batches into a single typed array
|
|
181
|
-
// const arrowColumn = arrowTable.getChild(field.name);
|
|
182
|
-
// const values = arrowColumn?.toArray();
|
|
183
|
-
// columns[field.name] = values;
|
|
184
|
-
// }
|
|
185
|
-
|
|
186
|
-
// const schema = convertArrowToSchema(arrowTable.schema);
|
|
187
|
-
|
|
188
|
-
// return {
|
|
189
|
-
// shape: 'columnar-table',
|
|
190
|
-
// schema,
|
|
191
|
-
// data: columns
|
|
192
|
-
// };
|
|
193
|
-
// }
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type * as arrow from 'apache-arrow';
|
|
6
6
|
import type {Table, ArrayRowTable, ObjectRowTable, ColumnarTable} from '@loaders.gl/core/schema';
|
|
7
|
-
import {
|
|
7
|
+
import {isArrowTable} from '../../../../lib/loader-utils/native-arrow';
|
|
8
8
|
import {deduceTableSchema} from '../../schema/deduce-table-schema';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -17,7 +17,7 @@ export function makeTableFromData(data: {[column: string]: ArrayLike<unknown>}):
|
|
|
17
17
|
export function makeTableFromData(data: arrow.Table): arrow.Table;
|
|
18
18
|
|
|
19
19
|
export function makeTableFromData(data: unknown): Table | arrow.Table {
|
|
20
|
-
if (
|
|
20
|
+
if (isArrowTable(data)) return data;
|
|
21
21
|
let table: Table;
|
|
22
22
|
switch (getTableShapeFromData(data)) {
|
|
23
23
|
case 'array-row-table':
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/* eslint-disable no-else-return */
|
|
6
6
|
|
|
7
7
|
import type {Table as NativeArrowTable} from 'apache-arrow';
|
|
8
|
-
import {
|
|
8
|
+
import {isArrowTable} from '../../../../lib/loader-utils/native-arrow';
|
|
9
9
|
import {convertArrowToSchema} from '../../schema/convert-arrow-schema';
|
|
10
10
|
import type {Table, ArrayRowTable, ObjectRowTable} from '@loaders.gl/core/schema';
|
|
11
11
|
|
|
12
12
|
/** Checks whether a value is a native Arrow table or a loaders.gl table. */
|
|
13
13
|
export function isTable(table: any): table is Table | NativeArrowTable {
|
|
14
|
-
if (
|
|
14
|
+
if (isArrowTable(table)) return true;
|
|
15
15
|
const shape = typeof table === 'object' && table?.shape;
|
|
16
16
|
switch (shape) {
|
|
17
17
|
case 'array-row-table':
|
|
@@ -24,9 +24,6 @@ export function isTable(table: any): table is Table | NativeArrowTable {
|
|
|
24
24
|
case 'columnar-table':
|
|
25
25
|
return Boolean(table.data && typeof table.data === 'object');
|
|
26
26
|
|
|
27
|
-
case 'arrow-table':
|
|
28
|
-
return Boolean(table?.data?.numRows !== undefined);
|
|
29
|
-
|
|
30
27
|
default:
|
|
31
28
|
return false;
|
|
32
29
|
}
|
|
@@ -45,9 +42,6 @@ export function getTableLength(table: Table | NativeArrowTable): number {
|
|
|
45
42
|
case 'geojson-table':
|
|
46
43
|
return table.features.length;
|
|
47
44
|
|
|
48
|
-
case 'arrow-table':
|
|
49
|
-
return getTableLength(table.data);
|
|
50
|
-
|
|
51
45
|
case 'columnar-table':
|
|
52
46
|
for (const column of Object.values(table.data)) {
|
|
53
47
|
return column.length || 0;
|
|
@@ -79,8 +73,6 @@ export function getTableNumCols(table: Table | NativeArrowTable): number {
|
|
|
79
73
|
return Object.keys(table.features[0]).length;
|
|
80
74
|
case 'columnar-table':
|
|
81
75
|
return Object.keys(table.data).length;
|
|
82
|
-
case 'arrow-table':
|
|
83
|
-
return getTableNumCols(table.data);
|
|
84
76
|
|
|
85
77
|
default:
|
|
86
78
|
throw new Error('table');
|
|
@@ -109,9 +101,6 @@ export function getTableCell(
|
|
|
109
101
|
const column = table.data[columnName];
|
|
110
102
|
return column[rowIndex];
|
|
111
103
|
|
|
112
|
-
case 'arrow-table':
|
|
113
|
-
return getTableCell(table.data, rowIndex, columnName);
|
|
114
|
-
|
|
115
104
|
default:
|
|
116
105
|
throw new Error('todo');
|
|
117
106
|
}
|
|
@@ -141,9 +130,6 @@ export function getTableCellAt(
|
|
|
141
130
|
const column = table.data[columnName3];
|
|
142
131
|
return column[rowIndex];
|
|
143
132
|
|
|
144
|
-
case 'arrow-table':
|
|
145
|
-
return getTableCellAt(table.data, rowIndex, columnIndex);
|
|
146
|
-
|
|
147
133
|
default:
|
|
148
134
|
throw new Error('todo');
|
|
149
135
|
}
|
|
@@ -248,9 +234,6 @@ export function getTableRowAsObject(
|
|
|
248
234
|
return objectRow;
|
|
249
235
|
}
|
|
250
236
|
|
|
251
|
-
case 'arrow-table':
|
|
252
|
-
return getTableRowAsObject(table.data, rowIndex, target, copy);
|
|
253
|
-
|
|
254
237
|
default:
|
|
255
238
|
throw new Error('shape');
|
|
256
239
|
}
|
|
@@ -321,9 +304,6 @@ export function getTableRowAsArray(
|
|
|
321
304
|
return arrayRow;
|
|
322
305
|
}
|
|
323
306
|
|
|
324
|
-
case 'arrow-table':
|
|
325
|
-
return getTableRowAsArray(table.data, rowIndex, target, copy);
|
|
326
|
-
|
|
327
307
|
default:
|
|
328
308
|
throw new Error('shape');
|
|
329
309
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type {Converter} from '../../../converters/converters';
|
|
6
6
|
import type {Table} from '@loaders.gl/core/schema';
|
|
7
7
|
import type * as arrow from 'apache-arrow';
|
|
8
|
-
import {
|
|
8
|
+
import {isArrowTable} from '../../../../../lib/loader-utils/native-arrow';
|
|
9
9
|
import {convertTables} from './convert-tables';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -16,23 +16,23 @@ export type TableShape = 'object-row-table' | 'array-row-table' | 'columnar-tabl
|
|
|
16
16
|
/**
|
|
17
17
|
* Leaf converter for loaders.gl table wrapper shapes.
|
|
18
18
|
*/
|
|
19
|
-
export const TableConverter: Converter<TableShape
|
|
19
|
+
export const TableConverter: Converter<TableShape> = {
|
|
20
20
|
id: 'table',
|
|
21
|
-
from: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow
|
|
21
|
+
from: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow'],
|
|
22
22
|
to: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow'],
|
|
23
23
|
canConvert(sourceShape, targetShape) {
|
|
24
24
|
return sourceShape !== targetShape;
|
|
25
25
|
},
|
|
26
26
|
detectInputShape(input) {
|
|
27
|
-
if (
|
|
27
|
+
if (isArrowTable(input)) return 'arrow';
|
|
28
28
|
if (
|
|
29
29
|
typeof input === 'object' &&
|
|
30
30
|
input !== null &&
|
|
31
31
|
'shape' in input &&
|
|
32
32
|
typeof input.shape === 'string' &&
|
|
33
|
-
['object-row-table', 'array-row-table', 'columnar-table'
|
|
33
|
+
['object-row-table', 'array-row-table', 'columnar-table'].includes(input.shape)
|
|
34
34
|
) {
|
|
35
|
-
return input.shape as TableShape
|
|
35
|
+
return input.shape as TableShape;
|
|
36
36
|
}
|
|
37
37
|
return null;
|
|
38
38
|
},
|
|
@@ -7,8 +7,7 @@ import type {
|
|
|
7
7
|
ObjectRowTable,
|
|
8
8
|
ArrayRowTable,
|
|
9
9
|
ColumnarTable,
|
|
10
|
-
GeoJSONTable
|
|
11
|
-
ArrowTable
|
|
10
|
+
GeoJSONTable
|
|
12
11
|
} from '@loaders.gl/core/schema';
|
|
13
12
|
|
|
14
13
|
/** Checks if a table is of array row layout */
|
|
@@ -30,8 +29,3 @@ export function isColumnarTable(table: Table): table is ColumnarTable {
|
|
|
30
29
|
export function isGeoJSONTable(table: Table): table is GeoJSONTable {
|
|
31
30
|
return table.shape === 'geojson-table';
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
/** Checks if table wraps an Apache Arrow table */
|
|
35
|
-
export function isArrowTable(table: Table): table is ArrowTable {
|
|
36
|
-
return table.shape === 'arrow-table';
|
|
37
|
-
}
|
package/src/wkt/index.ts
CHANGED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { ArrowTable, ArrowTableBatch, Table, TableBatch } from '@loaders.gl/core/schema';
|
|
2
|
-
/** Table layouts supported by the Arrow wrapper adapters. */
|
|
3
|
-
type ArrowTableShape = Exclude<Table['shape'], 'geojson-table' | 'arrow-table'>;
|
|
4
|
-
/** A converted layout retaining the input wrapper's additional properties. */
|
|
5
|
-
type ConvertedArrowTable<Input, Shape extends ArrowTableShape> = Omit<Input, 'shape' | 'data' | 'schema'> & Extract<Table, {
|
|
6
|
-
shape: Shape;
|
|
7
|
-
}>;
|
|
8
|
-
/**
|
|
9
|
-
* Converts an Arrow wrapper while preserving its schema and additional metadata.
|
|
10
|
-
* Infers a schema when the wrapper omits it. Use the native Arrow table directly for Arrow output.
|
|
11
|
-
* @param table Arrow table wrapper.
|
|
12
|
-
* @param shape Requested table layout.
|
|
13
|
-
* @returns Converted table with the input wrapper's metadata.
|
|
14
|
-
*/
|
|
15
|
-
export declare function convertArrowTable<Input extends ArrowTable, Shape extends ArrowTableShape>(table: Input, shape: Shape): ConvertedArrowTable<Input, Shape>;
|
|
16
|
-
/**
|
|
17
|
-
* Converts an Arrow batch while retaining length, batch type, progress and metadata.
|
|
18
|
-
* Does not combine or buffer batches.
|
|
19
|
-
* @param batch Arrow table batch.
|
|
20
|
-
* @param shape Requested table layout.
|
|
21
|
-
* @returns Converted batch with the input batch's metadata.
|
|
22
|
-
*/
|
|
23
|
-
export declare function convertArrowTableBatch<Input extends ArrowTableBatch, Shape extends ArrowTableShape>(batch: Input, shape: Shape): ConvertedArrowTable<Input, Shape> & Extract<TableBatch, {
|
|
24
|
-
shape: Shape;
|
|
25
|
-
}>;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=convert-arrow-table-wrapper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-arrow-table-wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAG5F,6DAA6D;AAC7D,KAAK,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC,CAAC;AAEhF,8EAA8E;AAC9E,KAAK,mBAAmB,CAAC,KAAK,EAAE,KAAK,SAAS,eAAe,IAAI,IAAI,CACnE,KAAK,EACL,OAAO,GAAG,MAAM,GAAG,QAAQ,CAC5B,GACC,OAAO,CAAC,KAAK,EAAE;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CAAC;AAEjC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,UAAU,EAAE,KAAK,SAAS,eAAe,EACvF,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACX,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAUrC;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,SAAS,eAAe,EAC7B,KAAK,SAAS,eAAe,EAE7B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACX,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CAGzE"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { convertArrowToTable } from "./convert-arrow-table.js";
|
|
5
|
-
export function convertArrowTable(table, shape) {
|
|
6
|
-
const converted = convertArrowToTable(table.data, shape);
|
|
7
|
-
return {
|
|
8
|
-
...table,
|
|
9
|
-
...converted,
|
|
10
|
-
schema: table.schema ?? converted.schema
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Converts an Arrow batch while retaining length, batch type, progress and metadata.
|
|
15
|
-
* Does not combine or buffer batches.
|
|
16
|
-
* @param batch Arrow table batch.
|
|
17
|
-
* @param shape Requested table layout.
|
|
18
|
-
* @returns Converted batch with the input batch's metadata.
|
|
19
|
-
*/
|
|
20
|
-
export function convertArrowTableBatch(batch, shape) {
|
|
21
|
-
return convertArrowTable(batch, shape);
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=convert-arrow-table-wrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"convert-arrow-table-wrapper.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAuB1D,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,KAAsB;IACzE,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,OAAO;QACL,GAAG,KAAK;QACR,GAAG,SAAS;QACZ,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM;KACzC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAIpC,KAAY,EACZ,KAAY;IAEZ,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CACA,CAAC;AACxC,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
|
|
5
|
-
import type {ArrowTable, ArrowTableBatch, Table, TableBatch} from '@loaders.gl/core/schema';
|
|
6
|
-
import {convertArrowToTable} from './convert-arrow-table';
|
|
7
|
-
|
|
8
|
-
/** Table layouts supported by the Arrow wrapper adapters. */
|
|
9
|
-
type ArrowTableShape = Exclude<Table['shape'], 'geojson-table' | 'arrow-table'>;
|
|
10
|
-
|
|
11
|
-
/** A converted layout retaining the input wrapper's additional properties. */
|
|
12
|
-
type ConvertedArrowTable<Input, Shape extends ArrowTableShape> = Omit<
|
|
13
|
-
Input,
|
|
14
|
-
'shape' | 'data' | 'schema'
|
|
15
|
-
> &
|
|
16
|
-
Extract<Table, {shape: Shape}>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Converts an Arrow wrapper while preserving its schema and additional metadata.
|
|
20
|
-
* Infers a schema when the wrapper omits it. Use the native Arrow table directly for Arrow output.
|
|
21
|
-
* @param table Arrow table wrapper.
|
|
22
|
-
* @param shape Requested table layout.
|
|
23
|
-
* @returns Converted table with the input wrapper's metadata.
|
|
24
|
-
*/
|
|
25
|
-
export function convertArrowTable<Input extends ArrowTable, Shape extends ArrowTableShape>(
|
|
26
|
-
table: Input,
|
|
27
|
-
shape: Shape
|
|
28
|
-
): ConvertedArrowTable<Input, Shape>;
|
|
29
|
-
export function convertArrowTable(table: ArrowTable, shape: ArrowTableShape): Table {
|
|
30
|
-
const converted = convertArrowToTable(table.data, shape);
|
|
31
|
-
return {
|
|
32
|
-
...table,
|
|
33
|
-
...converted,
|
|
34
|
-
schema: table.schema ?? converted.schema
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Converts an Arrow batch while retaining length, batch type, progress and metadata.
|
|
40
|
-
* Does not combine or buffer batches.
|
|
41
|
-
* @param batch Arrow table batch.
|
|
42
|
-
* @param shape Requested table layout.
|
|
43
|
-
* @returns Converted batch with the input batch's metadata.
|
|
44
|
-
*/
|
|
45
|
-
export function convertArrowTableBatch<
|
|
46
|
-
Input extends ArrowTableBatch,
|
|
47
|
-
Shape extends ArrowTableShape
|
|
48
|
-
>(
|
|
49
|
-
batch: Input,
|
|
50
|
-
shape: Shape
|
|
51
|
-
): ConvertedArrowTable<Input, Shape> & Extract<TableBatch, {shape: Shape}> {
|
|
52
|
-
return convertArrowTable(batch, shape) as ConvertedArrowTable<Input, Shape> &
|
|
53
|
-
Extract<TableBatch, {shape: Shape}>;
|
|
54
|
-
}
|