@loaders.gl/core 5.0.0-beta.1 → 5.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GEOARROW-README.md +1 -1
- package/README.md +4 -2
- package/SCAN-README.md +3 -3
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +295 -18
- package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts +10 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +23 -13
- 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/index.cjs +0 -11
- package/dist/arrow-geometry/index.cjs.map +2 -2
- package/dist/arrow-geometry/index.d.ts +0 -1
- package/dist/arrow-geometry/index.d.ts.map +1 -1
- package/dist/arrow-geometry/index.js +0 -1
- package/dist/arrow-geometry/index.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 +105 -0
- package/dist/arrow-worker-transport.cjs.map +6 -0
- package/dist/arrow-worker-transport.d.ts +11 -0
- package/dist/arrow-worker-transport.d.ts.map +1 -0
- package/dist/arrow-worker-transport.js +77 -0
- package/dist/arrow-worker-transport.js.map +1 -0
- package/dist/cluster-source.cjs +6874 -0
- package/dist/cluster-source.cjs.map +6 -0
- package/dist/cluster-source.d.ts +2 -0
- package/dist/cluster-source.d.ts.map +1 -0
- package/dist/cluster-source.js +2 -0
- package/dist/cluster-source.js.map +1 -0
- package/dist/dist.dev.js +3040 -817
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +2409 -0
- package/dist/federated-table-scan-source.cjs.map +6 -0
- package/dist/federated-table-scan-source.d.ts +2 -0
- package/dist/federated-table-scan-source.d.ts.map +1 -0
- package/dist/federated-table-scan-source.js +2 -0
- package/dist/federated-table-scan-source.js.map +1 -0
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
- package/dist/geoarrow/geoarrow-bounds.cjs.map +2 -2
- 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 +2 -2
- 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 +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +11 -12
- 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 +10 -13
- 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 +4 -8
- 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.d.ts.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +4 -8
- 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 +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
- package/dist/index.cjs +746 -1365
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +20 -9
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +55 -45
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode.d.ts +1 -1
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +11 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +3 -2
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +3 -3
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +15 -19
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +7 -3
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +15 -67
- 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 +5 -3
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +8 -6
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +5 -3
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +60 -9
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +5 -3
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +3 -4
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +5 -3
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +22 -14
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts +4 -2
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +47 -53
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/api/select-source.js +1 -1
- package/dist/lib/api/select-source.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -37
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -63
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
- package/dist/lib/loader-utils/native-arrow.js +66 -0
- package/dist/lib/loader-utils/native-arrow.js.map +1 -0
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +9 -10
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +31 -114
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +854 -1295
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +17 -8
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +9 -5
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.d.ts +4 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.js +45 -1
- package/dist/loader-utils/lib/files/http-file-transport.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-types.d.ts +2 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/read-range-response.d.ts +3 -0
- package/dist/loader-utils/lib/files/read-range-response.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/read-range-response.js +62 -0
- package/dist/loader-utils/lib/files/read-range-response.js.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +32 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +43 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js +104 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/{experimental-scan-options.d.ts → query-options.d.ts} +5 -8
- package/dist/loader-utils/lib/scan-utils/query-options.d.ts.map +1 -0
- package/dist/{schema-utils/lib/table/batch-builder/table-batch-aggregator.js → loader-utils/lib/scan-utils/query-options.js} +1 -1
- package/dist/loader-utils/lib/scan-utils/query-options.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +58 -18
- 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 +17 -6
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +54 -3
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +18 -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 +58 -29
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts +4 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +53 -14
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +31 -0
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -0
- package/dist/loader-utils/lib/{scan-utils/experimental-scan-options.js → sources/table-source-collection.js} +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js +2 -5
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +40 -21
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +118 -91
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +7 -5
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +9 -1
- package/dist/loader-utils/source-types.js.map +1 -1
- package/dist/null-loader.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +771 -82
- package/dist/null-worker.js +742 -81
- package/dist/polyfills/images/encode-image-node.d.ts +18 -15
- package/dist/polyfills/images/encode-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/encode-image-node.js +19 -33
- package/dist/polyfills/images/encode-image-node.js.map +1 -1
- package/dist/polyfills/images/image-codecs-node.d.ts +2 -6
- package/dist/polyfills/images/image-codecs-node.d.ts.map +1 -1
- package/dist/polyfills/images/image-codecs-node.js +2 -24
- package/dist/polyfills/images/image-codecs-node.js.map +1 -1
- package/dist/polyfills/images/load-sharp.d.ts +3 -0
- package/dist/polyfills/images/load-sharp.d.ts.map +1 -0
- package/dist/polyfills/images/load-sharp.js +11 -0
- package/dist/polyfills/images/load-sharp.js.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts +1 -1
- package/dist/polyfills/images/node-image-bitmap.js +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts.map +1 -1
- package/dist/polyfills/images/node-image-formats.js +10 -4
- package/dist/polyfills/images/node-image-formats.js.map +1 -1
- package/dist/polyfills/images/parse-image-node.d.ts +10 -2
- package/dist/polyfills/images/parse-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/parse-image-node.js +20 -32
- package/dist/polyfills/images/parse-image-node.js.map +1 -1
- package/dist/polyfills/index.cjs +76 -151
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +2 -2
- package/dist/polyfills/index.js.map +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +134 -0
- package/dist/scan/arrow-execution/expressions.cjs.map +7 -0
- package/dist/scan/arrow-execution/expressions.d.ts +11 -0
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -0
- package/dist/scan/arrow-execution/expressions.js +86 -0
- package/dist/scan/arrow-execution/expressions.js.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +255 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts +18 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js +224 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs +70 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts +8 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.js +39 -0
- package/dist/scan/arrow-execution/project-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution.cjs +34 -0
- package/dist/scan/arrow-execution.cjs.map +7 -0
- package/dist/scan/arrow-execution.d.ts +4 -0
- package/dist/scan/arrow-execution.d.ts.map +1 -0
- package/dist/scan/arrow-execution.js +6 -0
- package/dist/scan/arrow-execution.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs.map +1 -1
- package/dist/scan/arrow-query.d.ts +1 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/catalog-query-source.cjs +122 -0
- package/dist/scan/catalog-query-source.cjs.map +7 -0
- package/dist/scan/catalog-query-source.d.ts +6 -0
- package/dist/scan/catalog-query-source.d.ts.map +1 -0
- package/dist/scan/catalog-query-source.js +115 -0
- package/dist/scan/catalog-query-source.js.map +1 -0
- package/dist/scan/federated-table-scan-source.cjs +42 -43
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +6 -10
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +39 -40
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +213 -6
- package/dist/scan/index.cjs.map +4 -4
- package/dist/scan/index.d.ts +15 -4
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +8 -2
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +3 -294
- package/dist/scan/parse-sql-predicate.cjs.map +3 -3
- package/dist/scan/parse-sql-predicate.d.ts +6 -9
- package/dist/scan/parse-sql-predicate.d.ts.map +1 -1
- package/dist/scan/parse-sql-predicate.js +5 -314
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.cjs +75 -0
- package/dist/scan/query-arrow-table-in-batches.cjs.map +7 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts +8 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-in-batches.js +54 -0
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +65 -202
- package/dist/scan/query-arrow-table.cjs.map +3 -3
- package/dist/scan/query-arrow-table.d.ts +7 -40
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +51 -211
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +190 -0
- package/dist/scan/query-progressive.cjs.map +7 -0
- package/dist/scan/query-progressive.d.ts +39 -0
- package/dist/scan/query-progressive.d.ts.map +1 -0
- package/dist/scan/query-progressive.js +173 -0
- package/dist/scan/query-progressive.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +140 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +35 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +120 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +385 -0
- package/dist/scan/query.cjs.map +7 -0
- package/dist/scan/query.d.ts +67 -0
- package/dist/scan/query.d.ts.map +1 -0
- package/dist/scan/query.js +402 -0
- package/dist/scan/query.js.map +1 -0
- package/dist/scan/resolve-query-source.cjs +59 -0
- package/dist/scan/resolve-query-source.cjs.map +7 -0
- package/dist/scan/resolve-query-source.d.ts +6 -0
- package/dist/scan/resolve-query-source.d.ts.map +1 -0
- package/dist/scan/resolve-query-source.js +37 -0
- package/dist/scan/resolve-query-source.js.map +1 -0
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/sql-catalog.cjs +110 -0
- package/dist/scan/sql-catalog.cjs.map +7 -0
- package/dist/scan/sql-catalog.d.ts +47 -0
- package/dist/scan/sql-catalog.d.ts.map +1 -0
- package/dist/scan/sql-catalog.js +97 -0
- package/dist/scan/sql-catalog.js.map +1 -0
- package/dist/scan/table-query.cjs.map +2 -2
- package/dist/scan/table-query.d.ts +4 -1
- package/dist/scan/table-query.d.ts.map +1 -1
- package/dist/scan/table-query.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/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 +3 -6
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs +11 -7
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +404 -620
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -6
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/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 +7 -3
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +13 -75
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +1766 -0
- package/dist/vector-table-scan-source.cjs.map +6 -0
- package/dist/vector-table-scan-source.d.ts +2 -0
- package/dist/vector-table-scan-source.d.ts.map +1 -0
- package/dist/vector-table-scan-source.js +2 -0
- package/dist/vector-table-scan-source.js.map +1 -0
- package/dist/worker-utils/index.cjs +407 -1184
- package/dist/worker-utils/index.cjs.map +3 -3
- package/dist/worker-utils/index.d.ts +2 -8
- package/dist/worker-utils/index.d.ts.map +1 -1
- package/dist/worker-utils/index.js +1 -10
- package/dist/worker-utils/index.js.map +1 -1
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js +3 -2
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts +5 -7
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.js +76 -146
- package/dist/worker-utils/lib/worker-api/create-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +17 -45
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +214 -312
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts +36 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js +23 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js +3 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js +836 -147
- package/dist/worker-utils/null-worker-node.js.map +4 -4
- package/dist/worker-utils/null-worker.js +804 -143
- package/dist/worker-utils/null-worker.js.map +4 -4
- package/dist/worker-utils/types.d.ts +55 -72
- package/dist/worker-utils/types.d.ts.map +1 -1
- package/package.json +141 -35
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +32 -21
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/index.ts +0 -9
- 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 +126 -0
- package/src/cluster-source.ts +1 -0
- package/src/federated-table-scan-source.ts +1 -0
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geoarrow-bounds.ts +3 -3
- package/src/geoarrow/geoarrow-capabilities.ts +1 -1
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +3 -3
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +16 -16
- 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 +4 -11
- 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 +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +3 -2
- package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
- package/src/index.ts +2 -6
- package/src/lib/api/create-data-source.ts +148 -58
- package/src/lib/api/encode.ts +14 -3
- package/src/lib/api/load-in-batches.ts +15 -7
- package/src/lib/api/load-loader.ts +22 -21
- package/src/lib/api/load.ts +51 -127
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +32 -22
- package/src/lib/api/parse-in-batches.ts +121 -20
- package/src/lib/api/parse-sync.ts +30 -16
- package/src/lib/api/parse.ts +46 -29
- package/src/lib/api/select-loader.ts +54 -69
- package/src/lib/api/select-source.ts +7 -1
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +2 -70
- package/src/lib/loader-utils/native-arrow.ts +83 -0
- package/src/lib/loader-utils/option-defaults.ts +9 -10
- package/src/lib/loader-utils/option-utils.ts +33 -122
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +50 -10
- package/src/loader-utils/lib/files/http-file-transport.ts +65 -1
- package/src/loader-utils/lib/files/http-file-types.ts +2 -0
- package/src/loader-utils/lib/files/read-range-response.ts +66 -0
- package/src/loader-utils/lib/log-utils/log.ts +36 -1
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/logical-table-query.ts +174 -0
- package/src/loader-utils/lib/scan-utils/query-options.ts +44 -0
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +81 -28
- package/src/loader-utils/lib/scan-utils/table-query.ts +76 -8
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +101 -53
- package/src/loader-utils/lib/sources/data-source.ts +57 -16
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- package/src/loader-utils/lib/sources/table-source-collection.ts +39 -0
- package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts +5 -6
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +41 -24
- package/src/loader-utils/loader-types.ts +190 -111
- package/src/loader-utils/source-types.ts +17 -6
- package/src/null-loader.ts +1 -20
- package/src/polyfills/README.md +2 -2
- package/src/polyfills/images/encode-image-node.ts +44 -37
- package/src/polyfills/images/image-codecs-node.ts +2 -37
- package/src/polyfills/images/load-sharp.ts +13 -0
- package/src/polyfills/images/node-image-bitmap.ts +1 -1
- package/src/polyfills/images/node-image-formats.ts +10 -4
- package/src/polyfills/images/parse-image-node.ts +31 -40
- package/src/polyfills/index.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +116 -0
- package/src/scan/arrow-execution/filter-arrow-table.ts +298 -0
- package/src/scan/arrow-execution/project-arrow-table.ts +53 -0
- package/src/scan/arrow-execution.ts +7 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -0
- package/src/scan/catalog-query-source.ts +132 -0
- package/src/scan/federated-table-scan-source.ts +67 -78
- package/src/scan/index.ts +64 -6
- package/src/scan/parse-sql-predicate.ts +14 -367
- package/src/scan/query-arrow-table-in-batches.ts +55 -0
- package/src/scan/query-arrow-table.ts +81 -271
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +229 -0
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +199 -0
- package/src/scan/query.ts +594 -0
- package/src/scan/resolve-query-source.ts +47 -0
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +6 -6
- package/src/scan/sql-catalog.ts +167 -0
- package/src/scan/table-query.ts +6 -1
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +8 -19
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +19 -10
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +27 -95
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/vector-table-scan-source.ts +1 -0
- package/src/worker-utils/index.ts +2 -18
- package/src/worker-utils/lib/library-utils/library-utils.ts +3 -2
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
- package/src/worker-utils/lib/worker-api/create-worker.ts +89 -188
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +246 -402
- package/src/worker-utils/lib/worker-api/task-runtime.ts +66 -0
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
- package/src/worker-utils/lib/worker-utils/get-transfer-list.ts +2 -0
- package/src/worker-utils/types.ts +74 -109
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs +0 -477
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts +0 -29
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js +0 -434
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs +0 -39
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts +0 -2
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js +0 -5
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/arrow-transport.cjs +0 -691
- package/dist/schema-utils/arrow-transport.cjs.map +0 -6
- package/dist/schema-utils/arrow-transport.d.ts +0 -4
- package/dist/schema-utils/arrow-transport.d.ts.map +0 -1
- package/dist/schema-utils/arrow-transport.js +0 -7
- package/dist/schema-utils/arrow-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts +0 -76
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js +0 -182
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts +0 -33
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js +0 -134
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts +0 -32
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.js +0 -91
- package/dist/worker-utils/lib/async-queue/async-queue.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts +0 -20
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.js +0 -131
- package/dist/worker-utils/lib/worker-farm/worker-body.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts +0 -58
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.js +0 -116
- package/dist/worker-utils/lib/worker-farm/worker-farm.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts +0 -34
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.js +0 -74
- package/dist/worker-utils/lib/worker-farm/worker-job.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts +0 -94
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.js +0 -246
- package/dist/worker-utils/lib/worker-farm/worker-pool.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts +0 -67
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.js +0 -175
- package/dist/worker-utils/lib/worker-farm/worker-thread.js.map +0 -1
- package/src/arrow-geometry/arrow-geoarrow-adapter.ts +0 -568
- package/src/geoarrow/lib/arrow-geoarrow-adapter.ts +0 -12
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/loader-utils/lib/scan-utils/experimental-scan-options.ts +0 -46
- package/src/polyfills/images/encode-image.node.ts.disabled +0 -41
- package/src/polyfills/images/parse-image.node.ts.disabled +0 -55
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/arrow-transport.ts +0 -7
- package/src/schema-utils/lib/arrow/arrow-table-transport.ts +0 -282
- package/src/schema-utils/lib/arrow/split-arrow-buffers.ts +0 -247
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
- package/src/worker-utils/lib/async-queue/async-queue.ts +0 -100
- package/src/worker-utils/lib/worker-farm/worker-body.ts +0 -145
- package/src/worker-utils/lib/worker-farm/worker-farm.ts +0 -144
- package/src/worker-utils/lib/worker-farm/worker-job.ts +0 -85
- package/src/worker-utils/lib/worker-farm/worker-pool.ts +0 -316
- package/src/worker-utils/lib/worker-farm/worker-thread.ts +0 -206
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"convert-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAKtC,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,GAAG,mBAAmB,CAAC;AAClG,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAAC;AAChG,wBAAgB,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,gBAAgB,GAAG,kBAAkB,CAAC;AAC/F,wBAAgB,YAAY,CAC1B,KAAK,EAAE,UAAU,GAAG,KAAK,CAAC,WAAW,EACrC,KAAK,EAAE,OAAO,GACb,KAAK,CAAC,WAAW,CAAC;AA2BrB,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,EACzD,KAAK,EAAE,kBAAkB,GACxB,qBAAqB,CAAC,mBAAmB,CAAC,CAAC;AAC9C,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,EACzD,KAAK,EAAE,iBAAiB,GACvB,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;AAC7C,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,aAAa,CAAC,UAAU,CAAC,EACzD,KAAK,EAAE,gBAAgB,GACtB,qBAAqB,CAAC,kBAAkB,CAAC,CAAC;AAC7C,wBAAgB,cAAc,CAC5B,OAAO,EAAE,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,EACjG,KAAK,EAAE,OAAO,GACb,qBAAqB,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { isArrowRecordBatch } from "../../../../lib/loader-utils/native-arrow.js";
|
|
5
|
+
import { makeArrowMetadataBatch } from "../../arrow/arrow-metadata.js";
|
|
4
6
|
import { convertTable } from "../tables/convert-table.js";
|
|
5
|
-
/**
|
|
7
|
+
/** Converts one portable batch or returns the supplied native record batch. */
|
|
6
8
|
export function convertBatch(batch, shape) {
|
|
9
|
+
if (isArrowRecordBatch(batch)) {
|
|
10
|
+
if (shape === 'arrow')
|
|
11
|
+
return batch;
|
|
12
|
+
throw new Error('Convert a native RecordBatch as a table to select a row or column layout');
|
|
13
|
+
}
|
|
7
14
|
switch (shape) {
|
|
8
15
|
case 'object-row-table':
|
|
9
16
|
return { ...batch, ...convertTable(batch, 'object-row-table') };
|
|
@@ -11,20 +18,26 @@ export function convertBatch(batch, shape) {
|
|
|
11
18
|
return { ...batch, ...convertTable(batch, 'array-row-table') };
|
|
12
19
|
case 'columnar-table':
|
|
13
20
|
return { ...batch, ...convertTable(batch, 'columnar-table') };
|
|
14
|
-
case 'arrow
|
|
15
|
-
|
|
21
|
+
case 'arrow': {
|
|
22
|
+
const table = convertTable(batch, 'arrow');
|
|
23
|
+
return table.batches[0] ?? makeArrowMetadataBatch(table.schema);
|
|
24
|
+
}
|
|
16
25
|
default:
|
|
17
26
|
throw new Error(shape);
|
|
18
27
|
}
|
|
19
28
|
}
|
|
20
29
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* @param shape
|
|
24
|
-
* @returns
|
|
30
|
+
* Converts batches in emission order. For Arrow output, yields native record batches,
|
|
31
|
+
* preserving the declared schema of empty inputs.
|
|
25
32
|
*/
|
|
26
33
|
export async function* convertBatches(batches, shape) {
|
|
27
34
|
for await (const batch of batches) {
|
|
35
|
+
if (isArrowRecordBatch(batch)) {
|
|
36
|
+
if (shape !== 'arrow')
|
|
37
|
+
throw new Error('Expected a loaders.gl table batch');
|
|
38
|
+
yield batch;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
28
41
|
switch (shape) {
|
|
29
42
|
case 'object-row-table':
|
|
30
43
|
yield convertBatch(batch, 'object-row-table');
|
|
@@ -35,9 +48,14 @@ export async function* convertBatches(batches, shape) {
|
|
|
35
48
|
case 'columnar-table':
|
|
36
49
|
yield convertBatch(batch, 'columnar-table');
|
|
37
50
|
break;
|
|
38
|
-
case 'arrow
|
|
39
|
-
|
|
51
|
+
case 'arrow': {
|
|
52
|
+
const table = convertTable(batch, 'arrow');
|
|
53
|
+
if (table.batches.length)
|
|
54
|
+
yield* table.batches;
|
|
55
|
+
else
|
|
56
|
+
yield makeArrowMetadataBatch(table.schema);
|
|
40
57
|
break;
|
|
58
|
+
}
|
|
41
59
|
default:
|
|
42
60
|
throw new Error(shape);
|
|
43
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AASpC,OAAO,EAAC,YAAY,EAAC,mCAAgC;
|
|
1
|
+
{"version":3,"file":"convert-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/convert-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AASpC,OAAO,EAAC,kBAAkB,EAAC,qDAAkD;AAC7E,OAAO,EAAC,sBAAsB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,mCAAgC;AAUrD,+EAA+E;AAC/E,MAAM,UAAU,YAAY,CAC1B,KAAqC,EACrC,KAA0E;IAE1E,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,IAAI,KAAK,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,0EAA0E,CAAC,CAAC;IAC9F,CAAC;IACD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,kBAAkB;YACrB,OAAO,EAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAC,CAAC;QAChE,KAAK,iBAAiB;YACpB,OAAO,EAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAC,CAAC;QAC/D,KAAK,gBAAgB;YACnB,OAAO,EAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,KAAK,EAAE,gBAAgB,CAAC,EAAC,CAAC;QAC9D,KAAK,OAAO,CAAC,CAAC,CAAC;YACb,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC,OAA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
-
import type { Table
|
|
3
|
-
/**
|
|
4
|
-
* Returns an iterator that yields a single table as a sequence of ArrowTable batches.
|
|
5
|
-
* @note All batches will have the same shape and schema as the original table.
|
|
6
|
-
*/
|
|
7
|
-
export declare function makeArrowTableBatchIterator(table: Table, options?: {
|
|
8
|
-
batchSize?: number;
|
|
9
|
-
}): IterableIterator<ArrowTableBatch>;
|
|
2
|
+
import type { Table } from '@loaders.gl/core/schema';
|
|
10
3
|
/**
|
|
11
4
|
* Returns an iterator that yields a single table as a sequence of arrow.RecordBatch batches.
|
|
12
5
|
* @note All batches will have the same shape and schema as the original table.
|
|
13
6
|
*/
|
|
14
|
-
export declare function makeArrowRecordBatchIterator(table: Table, options?: {
|
|
7
|
+
export declare function makeArrowRecordBatchIterator(table: Table | arrow.Table, options?: {
|
|
8
|
+
batchSize?: number;
|
|
9
|
+
}): IterableIterator<arrow.RecordBatch>;
|
|
10
|
+
/** Converts loaders.gl table representations to record batches. */
|
|
11
|
+
export declare function makePortableTableRecordBatchIterator(table: Table, options?: {
|
|
15
12
|
batchSize?: number;
|
|
16
13
|
}): IterableIterator<arrow.RecordBatch>;
|
|
17
14
|
//# sourceMappingURL=make-arrow-batch-iterator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-arrow-batch-iterator.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"make-arrow-batch-iterator.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,yBAAyB,CAAC;AAwBnD;;;GAGG;AACH,wBAAiB,4BAA4B,CAC3C,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAC1B,OAAO,CAAC,EAAE;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,GAC7B,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CAMrC;AAED,mEAAmE;AACnE,wBAAiB,oCAAoC,CACnD,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,GAC7B,gBAAgB,CAAC,KAAK,CAAC,WAAW,CAAC,CA0CrC"}
|
|
@@ -4,21 +4,20 @@
|
|
|
4
4
|
import * as arrow from 'apache-arrow';
|
|
5
5
|
import { convertSchemaToArrow } from "../../schema/convert-arrow-schema.js";
|
|
6
6
|
import { getTableLength, getTableNumCols, getTableCellAt } from "../tables/table-accessors.js";
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (const batch of
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
7
|
+
/** Streams native Arrow batches, splitting existing batches without rebuilding columns. */
|
|
8
|
+
function* sliceNativeArrowBatches(table, batchSize) {
|
|
9
|
+
if (batchSize !== undefined && (!Number.isSafeInteger(batchSize) || batchSize < 1)) {
|
|
10
|
+
throw new RangeError('batchSize must be a positive integer');
|
|
11
|
+
}
|
|
12
|
+
for (const batch of table.batches) {
|
|
13
|
+
if (batchSize === undefined || batch.numRows <= batchSize) {
|
|
14
|
+
yield batch;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
for (let offset = 0; offset < batch.numRows; offset += batchSize) {
|
|
18
|
+
yield batch.slice(offset, offset + batchSize);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
@@ -26,6 +25,14 @@ export function* makeArrowTableBatchIterator(table, options) {
|
|
|
26
25
|
* @note All batches will have the same shape and schema as the original table.
|
|
27
26
|
*/
|
|
28
27
|
export function* makeArrowRecordBatchIterator(table, options) {
|
|
28
|
+
if (!('shape' in table)) {
|
|
29
|
+
yield* sliceNativeArrowBatches(table, options?.batchSize);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
yield* makePortableTableRecordBatchIterator(table, options);
|
|
33
|
+
}
|
|
34
|
+
/** Converts loaders.gl table representations to record batches. */
|
|
35
|
+
export function* makePortableTableRecordBatchIterator(table, options) {
|
|
29
36
|
const arrowSchema = convertSchemaToArrow(table.schema);
|
|
30
37
|
const length = getTableLength(table);
|
|
31
38
|
const numColumns = getTableNumCols(table);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-arrow-batch-iterator.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AACvE,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,cAAc,EAAC,qCAAkC;AAE1F
|
|
1
|
+
{"version":3,"file":"make-arrow-batch-iterator.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAC,oBAAoB,EAAC,6CAA0C;AACvE,OAAO,EAAC,cAAc,EAAE,eAAe,EAAE,cAAc,EAAC,qCAAkC;AAE1F,2FAA2F;AAC3F,QAAQ,CAAC,CAAC,uBAAuB,CAC/B,KAAkB,EAClB,SAAkB;IAElB,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,aAAa,C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K,EAAE,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACpF,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;QACrD,WAAW,GAAG,CAAC,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { TableBatch, Table } from '@loaders.gl/core/schema';
|
|
2
|
+
import type * as arrow from 'apache-arrow';
|
|
2
3
|
/**
|
|
3
4
|
* Assembles all batches from an async iterator into a single table.
|
|
4
|
-
*
|
|
5
|
+
* All batches must have the same shape and compatible schemas. A native RecordBatch stream
|
|
6
|
+
* produces a native Arrow table with metadata refined in emission order.
|
|
5
7
|
* @param batchIterator
|
|
6
8
|
* @returns `null` if no batches are yielded by the async iterator
|
|
7
9
|
*/
|
|
10
|
+
export declare function makeTableFromBatches(batchIterator: AsyncIterable<arrow.RecordBatch> | Iterable<arrow.RecordBatch>): Promise<arrow.Table | null>;
|
|
8
11
|
export declare function makeTableFromBatches(batchIterator: AsyncIterable<TableBatch> | Iterable<TableBatch>): Promise<Table | null>;
|
|
9
12
|
//# sourceMappingURL=make-table-from-batches.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table-from-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EACV,KAAK,EAIN,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"make-table-from-batches.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,UAAU,EACV,KAAK,EAIN,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAC;AAK3C;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,GAC5E,OAAO,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;AAC/B,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,GAC9D,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { makeArrowTableFromBatches } from "../../arrow/arrow-metadata.js";
|
|
5
|
+
import { isArrowRecordBatch } from "../../../../lib/loader-utils/native-arrow.js";
|
|
4
6
|
import { getTableLength } from "../tables/table-accessors.js";
|
|
5
|
-
/**
|
|
6
|
-
* Assembles all batches from an async iterator into a single table.
|
|
7
|
-
* @note All batches must have the same shape and schema
|
|
8
|
-
* @param batchIterator
|
|
9
|
-
* @returns `null` if no batches are yielded by the async iterator
|
|
10
|
-
*/
|
|
11
|
-
// eslint-disable-next-line complexity
|
|
12
7
|
export async function makeTableFromBatches(batchIterator) {
|
|
13
8
|
let arrayRows;
|
|
14
9
|
let objectRows;
|
|
15
10
|
let features;
|
|
16
11
|
let shape = null;
|
|
17
12
|
let schema;
|
|
13
|
+
const arrowBatches = [];
|
|
18
14
|
for await (const batch of batchIterator) {
|
|
19
|
-
|
|
15
|
+
const batchShape = isArrowRecordBatch(batch) ? 'arrow' : batch.shape;
|
|
16
|
+
shape ??= batchShape;
|
|
17
|
+
if (shape !== batchShape)
|
|
18
|
+
throw new Error('Batches must have the same shape');
|
|
19
|
+
if (isArrowRecordBatch(batch)) {
|
|
20
|
+
arrowBatches.push(batch);
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
20
23
|
schema = schema || batch.schema;
|
|
21
24
|
switch (batch.shape) {
|
|
22
25
|
case 'array-row-table':
|
|
@@ -41,7 +44,6 @@ export async function makeTableFromBatches(batchIterator) {
|
|
|
41
44
|
}
|
|
42
45
|
break;
|
|
43
46
|
case 'columnar-table':
|
|
44
|
-
case 'arrow-table':
|
|
45
47
|
default:
|
|
46
48
|
throw new Error('shape');
|
|
47
49
|
}
|
|
@@ -50,6 +52,8 @@ export async function makeTableFromBatches(batchIterator) {
|
|
|
50
52
|
return null;
|
|
51
53
|
}
|
|
52
54
|
switch (shape) {
|
|
55
|
+
case 'arrow':
|
|
56
|
+
return makeArrowTableFromBatches(arrowBatches);
|
|
53
57
|
case 'array-row-table':
|
|
54
58
|
return { shape: 'array-row-table', data: arrayRows, schema };
|
|
55
59
|
case 'object-row-table':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-table-from-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"make-table-from-batches.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/batches/make-table-from-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAWpC,OAAO,EAAC,yBAAyB,EAAC,sCAAmC;AACrE,OAAO,EAAC,kBAAkB,EAAC,qDAAkD;AAC7E,OAAO,EAAC,cAAc,EAAC,qCAAkC;AAezD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,aAE4C;IAE5C,IAAI,SAAgC,CAAC;IACrC,IAAI,UAAkC,CAAC;IACvC,IAAI,QAAmB,CAAC;IACxB,IAAI,K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,MAAM;YAER,KAAK,eAAe;gBAClB,QAAQ,GAAG,QAAS,IAAI,EAAE,CAAC;gBAC3B,KAAK,IAAI,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC;oBACpE,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;oBACrC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrB,CAAC;gBACD,MAAM;YAER,KAAK,gBAAgB,CAAC;YACtB;gBACE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,yBAAyB,CAAC,YAAY,CAAC,CAAC;QACjD,KAAK,iBAAiB;YACpB,OAAO,EAAC,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAU,EAAE,MAAM,EAAC,CAAC;QAE9D,KAAK,kBAAkB;YACrB,OAAO,EAAC,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,UAAW,EAAE,MAAM,EAAC,CAAC;QAEhE,KAAK,eAAe;YAClB,OAAO,EAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,QAAS,EAAE,MAAM,EAAC,CAAC;QAE1F;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as arrow from 'apache-arrow';
|
|
2
2
|
/** Portable options for applying a residual query to an Arrow table. */
|
|
3
3
|
export type ArrowTableQueryOptions<PredicateT = unknown> = Readonly<{
|
|
4
4
|
/** Predicate evaluated against all source columns before projection. */
|
|
@@ -17,7 +17,7 @@ export type ArrowTableRowFilter<PredicateT = unknown> = (predicate: PredicateT,
|
|
|
17
17
|
* predicate evaluator. Predicate columns are materialized independently from the projection,
|
|
18
18
|
* allowing WHERE columns that are not returned to the caller.
|
|
19
19
|
*/
|
|
20
|
-
export declare function queryArrowTable<PredicateT = unknown>(table:
|
|
20
|
+
export declare function queryArrowTable<PredicateT = unknown>(table: arrow.Table, options?: ArrowTableQueryOptions<PredicateT>, filterRows?: ArrowTableRowFilter<PredicateT>): arrow.Table;
|
|
21
21
|
/** Selects rows from an Arrow table while preserving the requested column order. */
|
|
22
|
-
export declare function selectArrowTableRows(table:
|
|
22
|
+
export declare function selectArrowTableRows(table: arrow.Table, rowIndices: readonly number[], columns?: readonly string[], limit?: number): arrow.Table;
|
|
23
23
|
//# sourceMappingURL=query-arrow-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-arrow-table.d.ts","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query-arrow-table.d.ts","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,wEAAwE;AACxE,MAAM,MAAM,sBAAsB,CAAC,UAAU,GAAG,OAAO,IAAI,QAAQ,CAAC;IAClE,wEAAwE;IACxE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,gFAAgF;IAChF,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,oFAAoF;AACpF,MAAM,MAAM,mBAAmB,CAAC,UAAU,GAAG,OAAO,IAAI,CACtD,SAAS,EAAE,UAAU,EACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,EAClC,QAAQ,EAAE,MAAM,KACb,SAAS,MAAM,EAAE,CAAC;AAEvB;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAG,OAAO,EAClD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,GAAE,sBAAsB,CAAC,UAAU,CAAM,EAChD,UAAU,CAAC,EAAE,mBAAmB,CAAC,UAAU,CAAC,GAC3C,KAAK,CAAC,KAAK,CAwBb;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,KAAK,CAAC,KAAK,CAUb"}
|
|
@@ -10,7 +10,7 @@ import * as arrow from 'apache-arrow';
|
|
|
10
10
|
* allowing WHERE columns that are not returned to the caller.
|
|
11
11
|
*/
|
|
12
12
|
export function queryArrowTable(table, options = {}, filterRows) {
|
|
13
|
-
const availableColumns = table.
|
|
13
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
14
14
|
const selectedColumns = options.columns ? [...options.columns] : availableColumns;
|
|
15
15
|
for (const columnName of selectedColumns) {
|
|
16
16
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -21,26 +21,19 @@ export function queryArrowTable(table, options = {}, filterRows) {
|
|
|
21
21
|
if (options.predicate !== undefined) {
|
|
22
22
|
if (!filterRows)
|
|
23
23
|
throw new Error('Arrow table query requires a predicate evaluator.');
|
|
24
|
-
const columns = Object.fromEntries(availableColumns.map(name => [name, [...(table.
|
|
25
|
-
rowIndices = filterRows(options.predicate, columns, table.
|
|
24
|
+
const columns = Object.fromEntries(availableColumns.map(name => [name, [...(table.getChild(name) || [])]]));
|
|
25
|
+
rowIndices = filterRows(options.predicate, columns, table.numRows);
|
|
26
26
|
}
|
|
27
27
|
const limitedRowIndices = rowIndices
|
|
28
28
|
? rowIndices.slice(0, options.limit ?? Number.POSITIVE_INFINITY)
|
|
29
29
|
: undefined;
|
|
30
|
-
|
|
31
|
-
? createArrowTableFromRowIndices(table
|
|
32
|
-
: table.
|
|
33
|
-
const schema = table.schema
|
|
34
|
-
? {
|
|
35
|
-
...table.schema,
|
|
36
|
-
fields: selectedColumns.flatMap(columnName => table.schema?.fields.filter(field => field.name === columnName) || [])
|
|
37
|
-
}
|
|
38
|
-
: undefined;
|
|
39
|
-
return schema ? { shape: 'arrow-table', schema, data } : { shape: 'arrow-table', data };
|
|
30
|
+
return limitedRowIndices
|
|
31
|
+
? createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices)
|
|
32
|
+
: table.select(selectedColumns).slice(0, options.limit ?? Number.POSITIVE_INFINITY);
|
|
40
33
|
}
|
|
41
34
|
/** Selects rows from an Arrow table while preserving the requested column order. */
|
|
42
35
|
export function selectArrowTableRows(table, rowIndices, columns, limit) {
|
|
43
|
-
const availableColumns = table.
|
|
36
|
+
const availableColumns = table.schema.fields.map(field => field.name);
|
|
44
37
|
const selectedColumns = columns ? [...columns] : availableColumns;
|
|
45
38
|
for (const columnName of selectedColumns) {
|
|
46
39
|
if (!availableColumns.includes(columnName)) {
|
|
@@ -48,17 +41,10 @@ export function selectArrowTableRows(table, rowIndices, columns, limit) {
|
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
const limitedRowIndices = rowIndices.slice(0, limit ?? Number.POSITIVE_INFINITY);
|
|
51
|
-
|
|
52
|
-
const schema = table.schema
|
|
53
|
-
? {
|
|
54
|
-
...table.schema,
|
|
55
|
-
fields: selectedColumns.flatMap(columnName => table.schema?.fields.filter(field => field.name === columnName) || [])
|
|
56
|
-
}
|
|
57
|
-
: undefined;
|
|
58
|
-
return schema ? { shape: 'arrow-table', schema, data } : { shape: 'arrow-table', data };
|
|
44
|
+
return createArrowTableFromRowIndices(table, selectedColumns, limitedRowIndices);
|
|
59
45
|
}
|
|
60
46
|
function createArrowTableFromRowIndices(sourceData, selectedColumns, rowIndices) {
|
|
61
|
-
const schema = new arrow.Schema(selectedColumns.map(columnName => sourceData.schema.fields.find(field => field.name === columnName)));
|
|
47
|
+
const schema = new arrow.Schema(selectedColumns.map(columnName => sourceData.schema.fields.find(field => field.name === columnName)), sourceData.schema.metadata);
|
|
62
48
|
const vectors = Object.fromEntries(selectedColumns.map(columnName => {
|
|
63
49
|
const sourceVector = sourceData.getChild(columnName);
|
|
64
50
|
return [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-arrow-table.js","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"query-arrow-table.js","sourceRoot":"","sources":["../../../../src/schema-utils/lib/table/query-arrow-table.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAmBtC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAkB,EAClB,UAA8C,EAAE,EAChD,UAA4C;IAE5C,MAAM,gBAAgB,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAClF,KAAK,MAAM,UAAU,IAAI,eAAe,EAAE,CAAC;QACzC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,4CAA4C,UAAU,IAAI,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IAED,IAAI,UAAyC,CAAC;IAC9C,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAA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CAAC,MAAM,CAAC,EAC/B,CAAC,EACD,UAAU,CAAC,MAAM,EACjB,CAAC,EACD,SAAS,EACT,QAAQ,CACT,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
import * as arrow from 'apache-arrow';
|
|
2
|
-
import type { Table, ArrayRowTable, ColumnarTable, ObjectRowTable, GeoJSONTable
|
|
2
|
+
import type { Table, ArrayRowTable, ColumnarTable, ObjectRowTable, GeoJSONTable } from '@loaders.gl/core/schema';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @param metadata
|
|
7
|
-
* @param batchSize
|
|
8
|
-
* @returns
|
|
4
|
+
* Converts a loaders.gl table to native Arrow and preserves the schema on empty input.
|
|
5
|
+
* Native Arrow inputs retain their identity.
|
|
9
6
|
*/
|
|
10
|
-
export declare function convertTableToArrow(table: Table, options?: {
|
|
7
|
+
export declare function convertTableToArrow(table: Table | arrow.Table, options?: {
|
|
11
8
|
batchSize?: number;
|
|
12
9
|
}): arrow.Table;
|
|
10
|
+
/** Loader table layouts produced when converting from Arrow. */
|
|
11
|
+
type NonArrowTableShape = Table['shape'];
|
|
13
12
|
/**
|
|
14
13
|
* Convert an Apache Arrow table to a loaders.gl Table
|
|
15
14
|
* @note Currently does not convert schema
|
|
16
15
|
*/
|
|
17
|
-
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'arrow
|
|
16
|
+
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'arrow'): arrow.Table;
|
|
18
17
|
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'columnar-table'): ColumnarTable;
|
|
19
18
|
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'object-row-table'): ObjectRowTable;
|
|
20
19
|
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'array-row-table'): ArrayRowTable;
|
|
21
20
|
export declare function convertArrowToTable(arrow: arrow.Table, shape: 'geojson-table'): GeoJSONTable;
|
|
22
|
-
export declare function convertArrowToTable(arrow: arrow.Table, shape:
|
|
23
|
-
export
|
|
21
|
+
export declare function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShape): Table;
|
|
22
|
+
export {};
|
|
24
23
|
//# sourceMappingURL=convert-arrow-table.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-arrow-table.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,
|
|
1
|
+
{"version":3,"file":"convert-arrow-table.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAOjC;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,KAAK,EAC1B,OAAO,CAAC,EAAE;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAC,GAC7B,KAAK,CAAC,KAAK,CAMb;AAED,gEAAgE;AAChE,KAAK,kBAAkB,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAEzC;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,gBAAgB,GAAG,aAAa,CAAC;AAChG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,GAAG,cAAc,CAAC;AACnG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,iBAAiB,GAAG,aAAa,CAAC;AACjG,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,eAAe,GAAG,YAAY,CAAC;AAC9F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,kBAAkB,GAAG,KAAK,CAAC"}
|
|
@@ -3,27 +3,20 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import * as arrow from 'apache-arrow';
|
|
5
5
|
import { convertTable } from "./convert-table.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { deduceTableSchema } from "../../schema/deduce-table-schema.js";
|
|
7
|
+
import { convertArrowToSchema, convertSchemaToArrow } from "../../schema/convert-arrow-schema.js";
|
|
8
|
+
import { makePortableTableRecordBatchIterator } from "../batches/make-arrow-batch-iterator.js";
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param metadata
|
|
12
|
-
* @param batchSize
|
|
13
|
-
* @returns
|
|
10
|
+
* Converts a loaders.gl table to native Arrow and preserves the schema on empty input.
|
|
11
|
+
* Native Arrow inputs retain their identity.
|
|
14
12
|
*/
|
|
15
13
|
export function convertTableToArrow(table, options) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// fall through
|
|
23
|
-
default:
|
|
24
|
-
const arrowBatchIterator = makeArrowRecordBatchIterator(table, options);
|
|
25
|
-
return new arrow.Table(arrowBatchIterator);
|
|
26
|
-
}
|
|
14
|
+
if (!('shape' in table))
|
|
15
|
+
return table;
|
|
16
|
+
const schema = table.schema ?? deduceTableSchema(table);
|
|
17
|
+
return new arrow.Table(convertSchemaToArrow(schema), [
|
|
18
|
+
...makePortableTableRecordBatchIterator({ ...table, schema }, options)
|
|
19
|
+
]);
|
|
27
20
|
}
|
|
28
21
|
/**
|
|
29
22
|
* Convert an Apache Arrow table to a loaders.gl Table
|
|
@@ -31,8 +24,8 @@ export function convertTableToArrow(table, options) {
|
|
|
31
24
|
*/
|
|
32
25
|
export function convertArrowToTable(arrowTable, shape) {
|
|
33
26
|
switch (shape) {
|
|
34
|
-
case 'arrow
|
|
35
|
-
return
|
|
27
|
+
case 'arrow':
|
|
28
|
+
return arrowTable;
|
|
36
29
|
case 'array-row-table':
|
|
37
30
|
return convertArrowToArrayRowTable(arrowTable);
|
|
38
31
|
case 'object-row-table':
|
|
@@ -45,19 +38,6 @@ export function convertArrowToTable(arrowTable, shape) {
|
|
|
45
38
|
throw new Error(shape);
|
|
46
39
|
}
|
|
47
40
|
}
|
|
48
|
-
/**
|
|
49
|
-
* Wrap an apache arrow table in a loaders.gl table wrapper.
|
|
50
|
-
* From this additional conversions are available.
|
|
51
|
-
* @param arrowTable
|
|
52
|
-
* @returns
|
|
53
|
-
*/
|
|
54
|
-
function convertArrowToArrowTable(arrowTable) {
|
|
55
|
-
return {
|
|
56
|
-
shape: 'arrow-table',
|
|
57
|
-
schema: convertArrowToSchema(arrowTable.schema),
|
|
58
|
-
data: arrowTable
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
41
|
function convertArrowToArrayRowTable(arrowTable) {
|
|
62
42
|
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
63
43
|
return convertTable(columnarTable, 'array-row-table');
|
|
@@ -106,46 +86,4 @@ function convertArrowToGeoJSONTable(arrowTable) {
|
|
|
106
86
|
features
|
|
107
87
|
};
|
|
108
88
|
}
|
|
109
|
-
// /**
|
|
110
|
-
// * Wrap an apache arrow table in a loaders.gl table wrapper.
|
|
111
|
-
// * From this additional conversions are available.
|
|
112
|
-
// * @param arrowTable
|
|
113
|
-
// * @returns
|
|
114
|
-
// */
|
|
115
|
-
// function convertArrowToArrowTable(arrowTable: arrow.Table): ArrowTable {
|
|
116
|
-
// return {
|
|
117
|
-
// shape: 'arrow-table',
|
|
118
|
-
// schema: convertArrowToSchema(arrowTable.schema),
|
|
119
|
-
// data: arrowTable
|
|
120
|
-
// };
|
|
121
|
-
// }
|
|
122
|
-
// function convertArrowToArrayRowTable(arrowTable: arrow.Table): Table {
|
|
123
|
-
// const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
124
|
-
// return convertTable(columnarTable, 'array-row-table');
|
|
125
|
-
// }
|
|
126
|
-
// function convertArrowToObjectRowTable(arrowTable: arrow.Table): Table {
|
|
127
|
-
// const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
128
|
-
// return convertTable(columnarTable, 'object-row-table');
|
|
129
|
-
// }
|
|
130
|
-
// /**
|
|
131
|
-
// * Convert an Apache Arrow table to a ColumnarTable
|
|
132
|
-
// * @note Currently does not convert schema
|
|
133
|
-
// */
|
|
134
|
-
// function convertArrowToColumnarTable(arrowTable: arrow.Table): ColumnarTable {
|
|
135
|
-
// // TODO - avoid calling `getColumn` on columns we are not interested in?
|
|
136
|
-
// // Add options object?
|
|
137
|
-
// const columns: ColumnarTable['data'] = {};
|
|
138
|
-
// for (const field of arrowTable.schema.fields) {
|
|
139
|
-
// // This (is intended to) coalesce all record batches into a single typed array
|
|
140
|
-
// const arrowColumn = arrowTable.getChild(field.name);
|
|
141
|
-
// const values = arrowColumn?.toArray();
|
|
142
|
-
// columns[field.name] = values;
|
|
143
|
-
// }
|
|
144
|
-
// const schema = convertArrowToSchema(arrowTable.schema);
|
|
145
|
-
// return {
|
|
146
|
-
// shape: 'columnar-table',
|
|
147
|
-
// schema,
|
|
148
|
-
// data: columns
|
|
149
|
-
// };
|
|
150
|
-
// }
|
|
151
89
|
//# sourceMappingURL=convert-arrow-table.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-arrow-table.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-arrow-table.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAUtC,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAC7C,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AACnE,OAAO,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,6CAA0C;AAC7F,OAAO,EAAC,oCAAoC,EAAC,gDAA6C;AAE1F;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAA0B,EAC1B,OAA8B;IAE9B,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,IAAI,KAAK,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE;QACnD,GAAG,oCAAoC,CAAC,EAAC,GAAG,KAAK,EAAE,MAAM,EAAC,EAAE,OAAO,CAAC;KACrE,CAAC,CAAC;AACL,CAAC;AAgBD;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAAuB,EACvB,KAAmC;IAEnC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,OAAO;YACV,OAAO,UAAU,CAAC;QACpB,KAAK,iBAAiB;YACpB,OAAO,2BAA2B,CAAC,UAAU,CAAC,CAAC;QACjD,KAAK,kBAAkB;YACrB,OAAO,4BAA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AC,CAAC;IAEvD,MAAM,QAAQ,GAAc,EAAE,CAAC;IAE/B,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;QAClD,0CAA0C;QAC1C,MAAM,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAK,EAAE,UAAU,EAAC,CAAC,CAAC;IAChE,CAAC;IAED,OAAO;QACL,KAAK,EAAE,eAAe;QACtB,IAAI,EAAE,mBAAmB;QACzB,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -1,43 +1,13 @@
|
|
|
1
|
-
import type { Table, ArrayRowTable, ObjectRowTable, ColumnarTable
|
|
2
|
-
|
|
3
|
-
export declare function convertTable(table: Table, shape: '
|
|
4
|
-
export declare function convertTable(table: Table, shape: '
|
|
5
|
-
export declare function convertTable(table: Table, shape: '
|
|
1
|
+
import type { Table, ArrayRowTable, ObjectRowTable, ColumnarTable } from '@loaders.gl/core/schema';
|
|
2
|
+
import type * as arrow from 'apache-arrow';
|
|
3
|
+
export declare function convertTable(table: Table | arrow.Table, shape: 'object-row-table'): ObjectRowTable;
|
|
4
|
+
export declare function convertTable(table: Table | arrow.Table, shape: 'array-row-table'): ArrayRowTable;
|
|
5
|
+
export declare function convertTable(table: Table | arrow.Table, shape: 'columnar-table'): ColumnarTable;
|
|
6
|
+
export declare function convertTable(table: Table | arrow.Table, shape: 'arrow'): arrow.Table;
|
|
6
7
|
/** Convert any simple table into columnar format */
|
|
7
8
|
export declare function convertToColumnarTable(table: Table): ColumnarTable;
|
|
8
9
|
/** Convert any table into array row format */
|
|
9
10
|
export declare function convertToArrayRowTable(table: Table): ArrayRowTable;
|
|
10
11
|
/** Convert any table into object row format */
|
|
11
12
|
export declare function convertToObjectRowTable(table: Table): ObjectRowTable;
|
|
12
|
-
/**
|
|
13
|
-
* Convert a table to apache arrow format
|
|
14
|
-
* @note this depends on the `@loaders.gl/tables/arrow module being imported
|
|
15
|
-
*/
|
|
16
|
-
export declare function convertToArrowTable(table: Table): ArrowTable;
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @note - should be part of schema module
|
|
20
|
-
*
|
|
21
|
-
export function convertColumnarToRowFormatTable(columnarTable: ColumnarTable): ObjectRowTable {
|
|
22
|
-
const tableKeys = Object.keys(columnarTable);
|
|
23
|
-
const tableRowsCount = columnarTable[tableKeys[0]].length;
|
|
24
|
-
|
|
25
|
-
const rowFormatTable: {}[] = [];
|
|
26
|
-
|
|
27
|
-
for (let index = 0; index < tableRowsCount; index++) {
|
|
28
|
-
const tableItem = {};
|
|
29
|
-
for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {
|
|
30
|
-
const fieldName = tableKeys[keyIndex];
|
|
31
|
-
tableItem[fieldName] = columnarTable[fieldName][index];
|
|
32
|
-
}
|
|
33
|
-
rowFormatTable.push(tableItem);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
shape: 'object-row-table',
|
|
38
|
-
schema: columnarTable.schema,
|
|
39
|
-
data: rowFormatTable
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
*/
|
|
43
13
|
//# sourceMappingURL=convert-table.d.ts.map
|