@luma.gl/graph 10.0.0-alpha.9 → 10.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -4
- package/THIRD-PARTY-NOTICES.md +19 -0
- package/dist/arrow/arrow-colors.cjs +99 -18
- package/dist/arrow/arrow-colors.d.ts +27 -10
- package/dist/arrow/arrow-colors.d.ts.map +1 -1
- package/dist/arrow/arrow-colors.js +107 -24
- package/dist/arrow/arrow-colors.js.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.cjs +4 -3
- package/dist/arrow/arrow-utils/arrow-paths.d.ts.map +1 -1
- package/dist/arrow/arrow-utils/arrow-paths.js +5 -4
- package/dist/arrow/arrow-utils/arrow-paths.js.map +1 -1
- package/dist/arrow/cpu/arrow-coordinate-projection.cjs +30 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts +5 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js +9 -0
- package/dist/arrow/cpu/arrow-coordinate-projection.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.cjs +31 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts +2 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js +5 -0
- package/dist/arrow/cpu/arrow-cpu-pipelines.js.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.cjs +99 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts +9 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.d.ts.map +1 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js +100 -0
- package/dist/arrow/cpu/arrow-cpu-vector-adapters.js.map +1 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.cjs +9 -371
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts +8 -28
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js +4 -381
- package/dist/arrow/geoarrow/arrow-geoarrow-adapter.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.cjs +11 -11
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts +2 -0
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.d.ts.map +1 -1
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js +4 -4
- package/dist/arrow/geoarrow/arrow-geoarrow-conversion.js.map +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.cjs +2 -2
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js +1 -1
- package/dist/arrow/geoarrow/arrow-polygon-tessellation.js.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.cjs +27 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts +11 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-column-gpu-vector.js +33 -8
- package/dist/arrow/gpu/arrow-column-gpu-vector.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.cjs +68 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts +9 -2
- package/dist/arrow/gpu/arrow-gpu-table-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js +76 -3
- package/dist/arrow/gpu/arrow-gpu-table-conversion.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.cjs +8 -6
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts +1 -0
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js +17 -7
- package/dist/arrow/gpu/arrow-gpu-vector-adapters.js.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.cjs +35 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts +6 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.d.ts.map +1 -1
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js +40 -5
- package/dist/arrow/gpu/arrow-gpu-vector-conversion.js.map +1 -1
- package/dist/arrow/index.cjs +19 -2
- package/dist/arrow/index.cjs.map +3 -3
- package/dist/arrow/index.d.ts +5 -2
- package/dist/arrow/index.d.ts.map +1 -1
- package/dist/arrow/index.js +4 -1
- package/dist/arrow/index.js.map +1 -1
- package/dist/arrow/internal.cjs.map +2 -2
- package/dist/dist.dev.js +3820 -1646
- package/dist/dist.min.js +450 -136
- package/dist/experimental/index.cjs.map +1 -1
- package/dist/experimental/simulation/index.cjs.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.cjs +2 -15
- package/dist/geospatial/gpu-point-spatial-query.d.ts.map +1 -1
- package/dist/geospatial/gpu-point-spatial-query.js +2 -15
- package/dist/geospatial/gpu-point-spatial-query.js.map +1 -1
- package/dist/geospatial/index.cjs.map +2 -2
- package/dist/gpu-a5/index.cjs.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.cjs +47 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts +5 -0
- package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/compiled-gpu-graph.js +54 -1
- package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.cjs +11 -2
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts +2 -1
- package/dist/gpu-core/gpu-command-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-compiler.js +13 -2
- package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts +16 -1
- package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph-types.js.map +1 -1
- package/dist/gpu-core/gpu-command-graph.cjs +34 -11
- package/dist/gpu-core/gpu-command-graph.d.ts +17 -8
- package/dist/gpu-core/gpu-command-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-command-graph.js +39 -11
- package/dist/gpu-core/gpu-command-graph.js.map +1 -1
- package/dist/gpu-core/gpu-cpu-execution.cjs +279 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts +22 -0
- package/dist/gpu-core/gpu-cpu-execution.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-execution.js +294 -0
- package/dist/gpu-core/gpu-cpu-execution.js.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.cjs +54 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts +40 -0
- package/dist/gpu-core/gpu-cpu-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-cpu-operation.js +35 -0
- package/dist/gpu-core/gpu-cpu-operation.js.map +1 -0
- package/dist/gpu-core/gpu-dispatch-utils.cjs +7 -3
- package/dist/gpu-core/gpu-dispatch-utils.d.ts +2 -0
- package/dist/gpu-core/gpu-dispatch-utils.d.ts.map +1 -1
- package/dist/gpu-core/gpu-dispatch-utils.js +4 -1
- package/dist/gpu-core/gpu-dispatch-utils.js.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.cjs +2 -2
- package/dist/gpu-core/gpu-expression-operation.d.ts +1 -1
- package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-operation.js +1 -1
- package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.cjs +5 -1
- package/dist/gpu-core/gpu-expression-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-expression-plan.js +7 -1
- package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.cjs +48 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts +1 -0
- package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph-compiler.js +50 -0
- package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
- package/dist/gpu-core/gpu-graph.d.ts +2 -2
- package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
- package/dist/gpu-core/gpu-graph.js.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.cjs +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-aggregation.js +2 -5
- package/dist/gpu-core/gpu-grid-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.cjs +2 -5
- package/dist/gpu-core/gpu-grid-binning.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-binning.js +2 -5
- package/dist/gpu-core/gpu-grid-binning.js.map +1 -1
- package/dist/gpu-core/gpu-grid-coordinate.cjs +41 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts +7 -0
- package/dist/gpu-core/gpu-grid-coordinate.d.ts.map +1 -0
- package/dist/gpu-core/gpu-grid-coordinate.js +24 -0
- package/dist/gpu-core/gpu-grid-coordinate.js.map +1 -0
- package/dist/gpu-core/gpu-grid-index-internals.cjs +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-internals.js +2 -15
- package/dist/gpu-core/gpu-grid-index-internals.js.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.cjs +2 -16
- package/dist/gpu-core/gpu-grid-index-query.d.ts.map +1 -1
- package/dist/gpu-core/gpu-grid-index-query.js +2 -16
- package/dist/gpu-core/gpu-grid-index-query.js.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.cjs +7 -15
- package/dist/gpu-core/gpu-group-aggregation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-group-aggregation.js +7 -18
- package/dist/gpu-core/gpu-group-aggregation.js.map +1 -1
- package/dist/gpu-core/gpu-operation.d.ts +4 -4
- package/dist/gpu-core/gpu-operation.d.ts.map +1 -1
- package/dist/gpu-core/gpu-operation.js.map +1 -1
- package/dist/gpu-core/gpu-reduction.cjs +6 -14
- package/dist/gpu-core/gpu-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-reduction.js +6 -15
- package/dist/gpu-core/gpu-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-render-operation.cjs +39 -0
- package/dist/gpu-core/gpu-render-operation.d.ts +21 -0
- package/dist/gpu-core/gpu-render-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-render-operation.js +22 -0
- package/dist/gpu-core/gpu-render-operation.js.map +1 -0
- package/dist/gpu-core/gpu-scan.cjs +46 -32
- package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-scan.js +56 -44
- package/dist/gpu-core/gpu-scan.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.cjs +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.d.ts +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-reduction.js +12 -9
- package/dist/gpu-core/gpu-segmented-reduction.js.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.cjs +73 -16
- package/dist/gpu-core/gpu-segmented-scan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-segmented-scan.js +73 -16
- package/dist/gpu-core/gpu-segmented-scan.js.map +1 -1
- package/dist/gpu-core/gpu-semantic-aggregation-operation.cjs +112 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts +71 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js +92 -0
- package/dist/gpu-core/gpu-semantic-aggregation-operation.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.cjs +267 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts +29 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js +260 -0
- package/dist/gpu-core/gpu-shader-pass-kernel.js.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.cjs +85 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts +32 -0
- package/dist/gpu-core/gpu-shader-pass-operation.d.ts.map +1 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js +74 -0
- package/dist/gpu-core/gpu-shader-pass-operation.js.map +1 -0
- package/dist/gpu-core/gpu-texture-plan.d.ts +3 -2
- package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -1
- package/dist/gpu-core/gpu-texture-plan.js.map +1 -1
- package/dist/gpu-core/index.cjs +32 -0
- package/dist/gpu-core/index.cjs.map +3 -3
- package/dist/gpu-core/index.d.ts +21 -1
- package/dist/gpu-core/index.d.ts.map +1 -1
- package/dist/gpu-core/index.js +10 -0
- package/dist/gpu-core/index.js.map +1 -1
- package/dist/gpu-data/color-conversion.cjs +105 -0
- package/dist/gpu-data/color-conversion.d.ts +30 -0
- package/dist/gpu-data/color-conversion.d.ts.map +1 -0
- package/dist/gpu-data/color-conversion.js +109 -0
- package/dist/gpu-data/color-conversion.js.map +1 -0
- package/dist/gpu-data/cpu-data.cjs +60 -0
- package/dist/gpu-data/cpu-data.d.ts +28 -0
- package/dist/gpu-data/cpu-data.d.ts.map +1 -0
- package/dist/gpu-data/cpu-data.js +41 -0
- package/dist/gpu-data/cpu-data.js.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.cjs +98 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts +9 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.d.ts.map +1 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js +85 -0
- package/dist/gpu-data/cpu-gpu-vector-transfer.js.map +1 -0
- package/dist/gpu-data/cpu-vector.cjs +42 -0
- package/dist/gpu-data/cpu-vector.d.ts +17 -0
- package/dist/gpu-data/cpu-vector.d.ts.map +1 -0
- package/dist/gpu-data/cpu-vector.js +21 -0
- package/dist/gpu-data/cpu-vector.js.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.cjs +41 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts +5 -0
- package/dist/gpu-data/gpu-data-buffer-props.d.ts.map +1 -0
- package/dist/gpu-data/gpu-data-buffer-props.js +19 -0
- package/dist/gpu-data/gpu-data-buffer-props.js.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.cjs +50 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts +41 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.d.ts.map +1 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js +45 -0
- package/dist/gpu-data/gpu-vector-wgsl-layout.js.map +1 -0
- package/dist/gpu-data/index.cjs +21 -2
- package/dist/gpu-data/index.cjs.map +3 -3
- package/dist/gpu-data/index.d.ts +6 -0
- package/dist/gpu-data/index.d.ts.map +1 -1
- package/dist/gpu-data/index.js +5 -0
- package/dist/gpu-data/index.js.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.cjs +1 -16
- package/dist/gpu-dataframe/gpu-data-frame-query.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-data-frame-query.js +1 -23
- package/dist/gpu-dataframe/gpu-data-frame-query.js.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.cjs +91 -2
- package/dist/gpu-dataframe/gpu-expression.d.ts +37 -0
- package/dist/gpu-dataframe/gpu-expression.d.ts.map +1 -1
- package/dist/gpu-dataframe/gpu-expression.js +106 -0
- package/dist/gpu-dataframe/gpu-expression.js.map +1 -1
- package/dist/gpu-dataframe/index.cjs +12 -2
- package/dist/gpu-dataframe/index.cjs.map +3 -3
- package/dist/gpu-dataframe/index.d.ts +4 -0
- package/dist/gpu-dataframe/index.d.ts.map +1 -1
- package/dist/gpu-dataframe/index.js +2 -0
- package/dist/gpu-dataframe/index.js.map +1 -1
- package/dist/gpu-dataframe/portable-expression.cjs +103 -0
- package/dist/gpu-dataframe/portable-expression.d.ts +19 -0
- package/dist/gpu-dataframe/portable-expression.d.ts.map +1 -0
- package/dist/gpu-dataframe/portable-expression.js +98 -0
- package/dist/gpu-dataframe/portable-expression.js.map +1 -0
- package/dist/gpu-dggs/benchmarks.cjs.map +1 -1
- package/dist/gpu-dggs/index.cjs.map +1 -1
- package/dist/gpu-geometry/index.cjs.map +1 -1
- package/dist/gpu-graph/index.cjs +8 -0
- package/dist/gpu-graph/index.cjs.map +3 -3
- package/dist/gpu-graph/index.d.ts +4 -0
- package/dist/gpu-graph/index.d.ts.map +1 -1
- package/dist/gpu-graph/index.js +2 -0
- package/dist/gpu-graph/index.js.map +1 -1
- package/dist/gpu-graph-algorithms/benchmarks.cjs.map +2 -2
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.cjs +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.d.ts.map +1 -1
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js +2 -15
- package/dist/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.js.map +1 -1
- package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
- package/dist/gpu-h3/index.cjs.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.cjs +162 -2
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts +25 -0
- package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
- package/dist/gpu-physics/gpu-rigid-body-world.js +181 -2
- package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
- package/dist/gpu-physics/index.cjs.map +2 -2
- package/dist/gpu-physics/index.d.ts +1 -0
- package/dist/gpu-physics/index.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +24 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-parallel-shaders.js +28 -9
- package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.cjs +2 -2
- package/dist/gpu-physics/rigid-body-shaders.d.ts +1 -1
- package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
- package/dist/gpu-physics/rigid-body-shaders.js +2 -2
- package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
- package/dist/gpu-physics/rigid-body-vehicle.cjs +90 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts +35 -0
- package/dist/gpu-physics/rigid-body-vehicle.d.ts.map +1 -0
- package/dist/gpu-physics/rigid-body-vehicle.js +66 -0
- package/dist/gpu-physics/rigid-body-vehicle.js.map +1 -0
- package/dist/gpu-pointcloud/index.cjs.map +1 -1
- package/dist/gpu-project/benchmarks.cjs.map +2 -2
- package/dist/gpu-project/coordinate-projection-graph.cjs +59 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts +23 -0
- package/dist/gpu-project/coordinate-projection-graph.d.ts.map +1 -0
- package/dist/gpu-project/coordinate-projection-graph.js +40 -0
- package/dist/gpu-project/coordinate-projection-graph.js.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.cjs +112 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts +10 -0
- package/dist/gpu-project/cpu-geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geoarrow.js +103 -0
- package/dist/gpu-project/cpu-geoarrow.js.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.cjs +134 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts +19 -0
- package/dist/gpu-project/cpu-geometry-pipelines.d.ts.map +1 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js +114 -0
- package/dist/gpu-project/cpu-geometry-pipelines.js.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.cjs +54 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts +14 -0
- package/dist/gpu-project/cpu-projection-operation.d.ts.map +1 -0
- package/dist/gpu-project/cpu-projection-operation.js +37 -0
- package/dist/gpu-project/cpu-projection-operation.js.map +1 -0
- package/dist/gpu-project/crs.cjs.map +2 -2
- package/dist/gpu-project/geoarrow.cjs +36 -0
- package/dist/gpu-project/geoarrow.cjs.map +6 -0
- package/dist/gpu-project/geoarrow.d.ts +3 -0
- package/dist/gpu-project/geoarrow.d.ts.map +1 -0
- package/dist/gpu-project/geoarrow.js +7 -0
- package/dist/gpu-project/geoarrow.js.map +1 -0
- package/dist/gpu-project/graph.cjs +27 -0
- package/dist/gpu-project/graph.cjs.map +6 -0
- package/dist/gpu-project/graph.d.ts +2 -0
- package/dist/gpu-project/graph.d.ts.map +1 -0
- package/dist/gpu-project/graph.js +6 -0
- package/dist/gpu-project/graph.js.map +1 -0
- package/dist/gpu-project/index.cjs +3 -0
- package/dist/gpu-project/index.cjs.map +3 -3
- package/dist/gpu-project/index.d.ts +1 -0
- package/dist/gpu-project/index.d.ts.map +1 -1
- package/dist/gpu-project/index.js +1 -0
- package/dist/gpu-project/index.js.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +75 -5
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +5 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +86 -6
- package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.cjs +9 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts +2 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js +10 -0
- package/dist/gpu-simple-graph/gpu-simple-graph-lowering.js.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.cjs +126 -10
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +36 -11
- package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
- package/dist/gpu-simple-graph/gpu-simple-graph.js +137 -12
- package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
- package/dist/gpu-simple-graph/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/index.d.ts +1 -1
- package/dist/gpu-simple-graph/index.d.ts.map +1 -1
- package/dist/gpu-simple-graph/index.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.cjs +25 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts +6 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js +28 -0
- package/dist/gpu-simple-graph/operation/gpu-data-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.cjs +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts +2 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js +7 -0
- package/dist/gpu-simple-graph/operation/gpu-vector-evaluator.js.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.cjs +6 -6
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts +5 -1
- package/dist/gpu-simple-graph/operations/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/convert-colors.js +12 -7
- package/dist/gpu-simple-graph/operations/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.cjs +16 -33
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js +22 -35
- package/dist/gpu-simple-graph/operations/cpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/cpu/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgl/index.cjs.map +3 -3
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.cjs +31 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.d.ts.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js +42 -13
- package/dist/gpu-simple-graph/operations/webgpu/convert-colors.js.map +1 -1
- package/dist/gpu-simple-graph/operations/webgpu/index.cjs.map +1 -1
- package/dist/gpu-sql/gpu-sql.cjs +157 -280
- package/dist/gpu-sql/gpu-sql.d.ts +1 -1
- package/dist/gpu-sql/gpu-sql.d.ts.map +1 -1
- package/dist/gpu-sql/gpu-sql.js +168 -291
- package/dist/gpu-sql/gpu-sql.js.map +1 -1
- package/dist/gpu-sql/index.cjs.map +3 -3
- package/dist/gpu-tables/index.cjs.map +2 -2
- package/dist/gpu-tables/table/gpu-table.cjs +2 -2
- package/dist/gpu-tables/table/gpu-table.d.ts.map +1 -1
- package/dist/gpu-tables/table/gpu-table.js +2 -2
- package/dist/gpu-tables/table/gpu-table.js.map +1 -1
- package/dist/gpu-timeseries/index.cjs.map +1 -1
- package/dist/index.cjs +11 -0
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +21 -7
- package/src/arrow/arrow-colors.ts +194 -33
- package/src/arrow/arrow-utils/arrow-paths.ts +5 -3
- package/src/arrow/cpu/arrow-coordinate-projection.ts +18 -0
- package/src/arrow/cpu/arrow-cpu-pipelines.ts +9 -0
- package/src/arrow/cpu/arrow-cpu-vector-adapters.ts +153 -0
- package/src/arrow/geoarrow/arrow-geoarrow-adapter.ts +21 -493
- package/src/arrow/geoarrow/arrow-geoarrow-conversion.ts +7 -5
- package/src/arrow/geoarrow/arrow-polygon-tessellation.ts +1 -1
- package/src/arrow/gpu/arrow-column-gpu-vector.ts +67 -14
- package/src/arrow/gpu/arrow-gpu-table-conversion.ts +96 -4
- package/src/arrow/gpu/arrow-gpu-vector-adapters.ts +20 -7
- package/src/arrow/gpu/arrow-gpu-vector-conversion.ts +49 -6
- package/src/arrow/index.ts +14 -0
- package/src/geospatial/gpu-point-spatial-query.ts +2 -15
- package/src/gpu-core/compiled-gpu-graph.ts +73 -1
- package/src/gpu-core/gpu-command-graph-compiler.ts +25 -2
- package/src/gpu-core/gpu-command-graph-types.ts +20 -0
- package/src/gpu-core/gpu-command-graph.ts +48 -11
- package/src/gpu-core/gpu-cpu-execution.ts +345 -0
- package/src/gpu-core/gpu-cpu-operation.ts +65 -0
- package/src/gpu-core/gpu-dispatch-utils.ts +13 -1
- package/src/gpu-core/gpu-expression-operation.ts +1 -1
- package/src/gpu-core/gpu-expression-plan.ts +11 -3
- package/src/gpu-core/gpu-graph-compiler.ts +61 -0
- package/src/gpu-core/gpu-graph.ts +3 -3
- package/src/gpu-core/gpu-grid-aggregation.ts +2 -5
- package/src/gpu-core/gpu-grid-binning.ts +2 -5
- package/src/gpu-core/gpu-grid-coordinate.ts +24 -0
- package/src/gpu-core/gpu-grid-index-internals.ts +2 -15
- package/src/gpu-core/gpu-grid-index-query.ts +2 -16
- package/src/gpu-core/gpu-group-aggregation.ts +38 -50
- package/src/gpu-core/gpu-operation.ts +9 -7
- package/src/gpu-core/gpu-reduction.ts +32 -42
- package/src/gpu-core/gpu-render-operation.ts +42 -0
- package/src/gpu-core/gpu-scan.ts +59 -45
- package/src/gpu-core/gpu-segmented-reduction.ts +20 -10
- package/src/gpu-core/gpu-segmented-scan.ts +82 -17
- package/src/gpu-core/gpu-semantic-aggregation-operation.ts +150 -0
- package/src/gpu-core/gpu-shader-pass-kernel.ts +307 -0
- package/src/gpu-core/gpu-shader-pass-operation.ts +103 -0
- package/src/gpu-core/gpu-texture-plan.ts +3 -2
- package/src/gpu-core/index.ts +39 -0
- package/src/gpu-data/color-conversion.ts +158 -0
- package/src/gpu-data/cpu-data.ts +62 -0
- package/src/gpu-data/cpu-gpu-vector-transfer.ts +110 -0
- package/src/gpu-data/cpu-vector.ts +31 -0
- package/src/gpu-data/gpu-data-buffer-props.ts +25 -0
- package/src/gpu-data/gpu-vector-wgsl-layout.ts +79 -0
- package/src/gpu-data/index.ts +15 -0
- package/src/gpu-dataframe/gpu-data-frame-query.ts +6 -26
- package/src/gpu-dataframe/gpu-expression.ts +135 -0
- package/src/gpu-dataframe/index.ts +11 -0
- package/src/gpu-dataframe/portable-expression.ts +117 -0
- package/src/gpu-graph/index.ts +17 -0
- package/src/gpu-graph-algorithms/gpu-graph-spatial-force-layout-internals.ts +2 -15
- package/src/gpu-physics/gpu-rigid-body-world.ts +227 -2
- package/src/gpu-physics/index.ts +1 -0
- package/src/gpu-physics/rigid-body-parallel-shaders.ts +32 -9
- package/src/gpu-physics/rigid-body-shaders.ts +3 -2
- package/src/gpu-physics/rigid-body-vehicle.ts +99 -0
- package/src/gpu-project/coordinate-projection-graph.ts +59 -0
- package/src/gpu-project/cpu-geoarrow.ts +135 -0
- package/src/gpu-project/cpu-geometry-pipelines.ts +159 -0
- package/src/gpu-project/cpu-projection-operation.ts +49 -0
- package/src/gpu-project/geoarrow.ts +11 -0
- package/src/gpu-project/graph.ts +10 -0
- package/src/gpu-project/index.ts +2 -0
- package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +97 -6
- package/src/gpu-simple-graph/gpu-simple-graph-lowering.ts +11 -0
- package/src/gpu-simple-graph/gpu-simple-graph.ts +163 -19
- package/src/gpu-simple-graph/index.ts +1 -0
- package/src/gpu-simple-graph/operation/gpu-data-evaluator.ts +24 -0
- package/src/gpu-simple-graph/operation/gpu-vector-evaluator.ts +7 -0
- package/src/gpu-simple-graph/operations/convert-colors.ts +22 -7
- package/src/gpu-simple-graph/operations/cpu/convert-colors.ts +31 -48
- package/src/gpu-simple-graph/operations/webgpu/convert-colors.ts +47 -13
- package/src/gpu-sql/gpu-sql.ts +179 -293
- package/src/gpu-tables/table/gpu-table.ts +2 -1
- package/src/index.ts +21 -0
package/dist/gpu-sql/gpu-sql.cjs
CHANGED
|
@@ -21,12 +21,10 @@ __export(gpu_sql_exports, {
|
|
|
21
21
|
GPUSQLQuery: () => GPUSQLQuery
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(gpu_sql_exports);
|
|
24
|
+
var import_parser = require("@math.gl/sql/parser");
|
|
24
25
|
var import_gpu_data_frame = require("../gpu-dataframe/gpu-data-frame.cjs");
|
|
25
26
|
var import_gpu_data_frame_query = require("../gpu-dataframe/gpu-data-frame-query.cjs");
|
|
26
27
|
var import_gpu_expression = require("../gpu-dataframe/gpu-expression.cjs");
|
|
27
|
-
const MAXIMUM_SQL_LENGTH = 65536;
|
|
28
|
-
const MAXIMUM_SQL_TOKENS = 4096;
|
|
29
|
-
const MAXIMUM_EXPRESSION_DEPTH = 64;
|
|
30
28
|
class GPUSQLContext {
|
|
31
29
|
tables;
|
|
32
30
|
constructor(tables) {
|
|
@@ -45,8 +43,7 @@ class GPUSQLContext {
|
|
|
45
43
|
}
|
|
46
44
|
/** Parses and validates one immutable SELECT plan without touching registered GPU sources. */
|
|
47
45
|
query(source, options = {}) {
|
|
48
|
-
const
|
|
49
|
-
const statement = parser.parse();
|
|
46
|
+
const statement = parseGPUSQLStatement(source, options.parameters ?? {});
|
|
50
47
|
return new GPUSQLQuery(source, buildGPUSQLPlan(this.tables, statement));
|
|
51
48
|
}
|
|
52
49
|
}
|
|
@@ -151,13 +148,14 @@ function buildGPUSQLPlan(tables, statement) {
|
|
|
151
148
|
}
|
|
152
149
|
}
|
|
153
150
|
if (statement.orderBy) {
|
|
154
|
-
const
|
|
151
|
+
const { column: requested, direction, nulls } = statement.orderBy;
|
|
152
|
+
const orderColumn = selected.includes(requested) ? requested : resolve(requested);
|
|
155
153
|
if (!selected.includes(orderColumn)) {
|
|
156
154
|
throw new Error("GPUSQL ORDER BY requires the sort column in the SELECT projection");
|
|
157
155
|
}
|
|
158
156
|
const sort = query.select(selected).sortByGlobal(orderColumn, {
|
|
159
|
-
direction
|
|
160
|
-
...
|
|
157
|
+
direction,
|
|
158
|
+
...nulls ? { nulls } : {}
|
|
161
159
|
});
|
|
162
160
|
return statement.limit === void 0 ? sort : sort.topK(statement.limit);
|
|
163
161
|
}
|
|
@@ -184,10 +182,9 @@ function resolveGPUSQLColumn(name, qualifier, columns) {
|
|
|
184
182
|
throw new Error(`GPUSQL column "${name}" has an unknown table qualifier`);
|
|
185
183
|
}
|
|
186
184
|
const requested = parts[parts.length - 1];
|
|
187
|
-
|
|
188
|
-
if (matches.length !== 1)
|
|
185
|
+
if (!columns.includes(requested))
|
|
189
186
|
throw new Error(`GPUSQL column "${name}" does not exist`);
|
|
190
|
-
return
|
|
187
|
+
return requested;
|
|
191
188
|
}
|
|
192
189
|
function resolveGPUSQLExpression(expression, resolve) {
|
|
193
190
|
switch (expression.kind) {
|
|
@@ -205,292 +202,172 @@ function resolveGPUSQLExpression(expression, resolve) {
|
|
|
205
202
|
return expression;
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
205
|
+
function parseGPUSQLStatement(source, parameters) {
|
|
206
|
+
var _a, _b, _c, _d, _e;
|
|
207
|
+
const statement = (0, import_parser.parseSQLSelectStatement)(source, {
|
|
208
|
+
parseParameter: (name) => ({ type: "Identifier", name, gpuSQLParameter: true })
|
|
209
|
+
});
|
|
210
|
+
if (statement.offset !== void 0)
|
|
211
|
+
throw new Error("GPUSQL does not support OFFSET");
|
|
212
|
+
if (statement.joins.length > 1)
|
|
213
|
+
throw new Error("GPUSQL currently supports one JOIN");
|
|
214
|
+
if ((((_a = statement.groupBy) == null ? void 0 : _a.length) ?? 0) > 1) {
|
|
215
|
+
throw new Error("GPUSQL currently supports one GROUP BY column");
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
217
|
+
if ((((_b = statement.orderBy) == null ? void 0 : _b.length) ?? 0) > 1) {
|
|
218
|
+
throw new Error("GPUSQL currently supports one ORDER BY column");
|
|
219
|
+
}
|
|
220
|
+
if (statement.limit !== void 0 && statement.limit > 4294967295) {
|
|
221
|
+
throw new Error("GPUSQL LIMIT must fit an unsigned 32-bit row count");
|
|
222
|
+
}
|
|
223
|
+
const items = ((_c = statement.select) == null ? void 0 : _c.map(({ expression, alias }) => {
|
|
224
|
+
if (expression.type === "CallExpression" && expression.callee.type === "Identifier") {
|
|
225
|
+
const name = String(expression.callee["name"]).toLowerCase();
|
|
226
|
+
const aggregate = name === "avg" ? "mean" : name;
|
|
227
|
+
switch (aggregate) {
|
|
228
|
+
case "count":
|
|
229
|
+
case "sum":
|
|
230
|
+
case "min":
|
|
231
|
+
case "max":
|
|
232
|
+
case "mean": {
|
|
233
|
+
if (expression.arguments.length !== 1) {
|
|
234
|
+
throw new Error("GPUSQL aggregates require one argument");
|
|
235
|
+
}
|
|
236
|
+
const argument = expression.arguments[0];
|
|
237
|
+
const wildcard = argument.type === "Identifier" && argument["sqlWildcard"] === true;
|
|
238
|
+
if (aggregate === "count" !== wildcard) {
|
|
239
|
+
throw new Error("GPUSQL only permits COUNT(*) as a wildcard aggregation");
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
aggregate,
|
|
243
|
+
...wildcard ? {} : { aggregateColumn: readGPUSQLColumn(argument) },
|
|
244
|
+
alias
|
|
245
|
+
};
|
|
246
|
+
}
|
|
242
247
|
}
|
|
243
|
-
orderBy = { column: sortColumn, direction, ...nulls ? { nulls } : {} };
|
|
244
|
-
if (this.takeSymbol(","))
|
|
245
|
-
throw new Error("GPUSQL currently supports one ORDER BY column");
|
|
246
248
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
249
|
+
return { expression: lowerSQLExpression(expression, parameters), alias };
|
|
250
|
+
})) ?? [{ star: true }];
|
|
251
|
+
const join = statement.joins[0];
|
|
252
|
+
if (statement.from.inputTable !== void 0 || (join == null ? void 0 : join.table.inputTable) !== void 0) {
|
|
253
|
+
throw new Error("GPUSQL does not support table functions");
|
|
254
|
+
}
|
|
255
|
+
let loweredJoin;
|
|
256
|
+
if (join) {
|
|
257
|
+
if (join.unnest)
|
|
258
|
+
throw new Error("GPUSQL does not support JOIN UNNEST");
|
|
259
|
+
if (join.type === "cross")
|
|
260
|
+
throw new Error("GPUSQL does not support CROSS JOIN");
|
|
261
|
+
if (join.on.type !== "BinaryExpression" || join.on.operator !== "==") {
|
|
262
|
+
throw new Error("GPUSQL JOIN requires equality between two columns");
|
|
257
263
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
...alias ? { alias } : {},
|
|
265
|
-
...join ? { join } : {},
|
|
266
|
-
...predicate ? { predicate } : {},
|
|
267
|
-
...groupBy ? { groupBy } : {},
|
|
268
|
-
...orderBy ? { orderBy } : {},
|
|
269
|
-
...limit !== void 0 ? { limit } : {}
|
|
264
|
+
loweredJoin = {
|
|
265
|
+
type: join.type,
|
|
266
|
+
table: join.table.name,
|
|
267
|
+
alias: join.table.alias,
|
|
268
|
+
left: readGPUSQLColumn(join.on.left),
|
|
269
|
+
right: readGPUSQLColumn(join.on.right)
|
|
270
270
|
};
|
|
271
271
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
272
|
+
const sort = (_d = statement.orderBy) == null ? void 0 : _d[0];
|
|
273
|
+
return {
|
|
274
|
+
items,
|
|
275
|
+
table: statement.from.name,
|
|
276
|
+
alias: statement.from.alias,
|
|
277
|
+
join: loweredJoin,
|
|
278
|
+
predicate: statement.where && lowerSQLExpression(statement.where, parameters),
|
|
279
|
+
groupBy: ((_e = statement.groupBy) == null ? void 0 : _e[0]) && readGPUSQLColumn(statement.groupBy[0]),
|
|
280
|
+
orderBy: sort && {
|
|
281
|
+
column: readGPUSQLColumn(sort.expression),
|
|
282
|
+
direction: sort.direction === "desc" ? "descending" : "ascending",
|
|
283
|
+
nulls: sort.nulls
|
|
284
|
+
},
|
|
285
|
+
limit: statement.limit
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
function readGPUSQLColumn(node) {
|
|
289
|
+
const expression = node;
|
|
290
|
+
if (expression.type === "Identifier" && !("gpuSQLParameter" in expression) && !expression.name.includes(".")) {
|
|
291
|
+
return expression.name;
|
|
292
|
+
}
|
|
293
|
+
if (expression.type === "MemberExpression" && !expression.computed) {
|
|
294
|
+
const object = expression.object;
|
|
295
|
+
const property = expression.property;
|
|
296
|
+
if (object.type === "Identifier" && property.type === "Identifier" && !("gpuSQLParameter" in object) && !object.name.includes(".") && !property.name.includes(".")) {
|
|
297
|
+
return `${object.name}.${property.name}`;
|
|
294
298
|
}
|
|
295
|
-
const expression = this.parseExpression(0);
|
|
296
|
-
return {
|
|
297
|
-
...expression ? { expression } : {},
|
|
298
|
-
...this.takeKeyword("AS") ? { alias: this.parseIdentifier() } : {}
|
|
299
|
-
};
|
|
300
299
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
300
|
+
throw new Error("GPUSQL expected a table or column identifier");
|
|
301
|
+
}
|
|
302
|
+
const SQL_BINARY_OPERATORS = {
|
|
303
|
+
"||": "or",
|
|
304
|
+
"&&": "and",
|
|
305
|
+
"==": "equal",
|
|
306
|
+
"!=": "not-equal",
|
|
307
|
+
">": "greater-than",
|
|
308
|
+
">=": "greater-than-or-equal",
|
|
309
|
+
"<": "less-than",
|
|
310
|
+
"<=": "less-than-or-equal",
|
|
311
|
+
"+": "add",
|
|
312
|
+
"-": "subtract",
|
|
313
|
+
"*": "multiply",
|
|
314
|
+
"/": "divide"
|
|
315
|
+
};
|
|
316
|
+
function lowerSQLExpression(node, parameters) {
|
|
317
|
+
const expression = node;
|
|
318
|
+
switch (expression.type) {
|
|
319
|
+
case "Identifier": {
|
|
320
|
+
if (!("gpuSQLParameter" in expression))
|
|
321
|
+
return (0, import_gpu_expression.column)(readGPUSQLColumn(expression)).node;
|
|
322
|
+
const name = expression.name;
|
|
323
|
+
if (!Object.hasOwn(parameters, name)) {
|
|
324
|
+
throw new Error(`GPUSQL parameter ":${name}" requires an explicit default`);
|
|
325
|
+
}
|
|
326
|
+
return (0, import_gpu_expression.parameter)(name, parameters[name]).node;
|
|
312
327
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
328
|
+
case "MemberExpression":
|
|
329
|
+
return (0, import_gpu_expression.column)(readGPUSQLColumn(expression)).node;
|
|
330
|
+
case "Literal": {
|
|
331
|
+
const value = expression.value;
|
|
332
|
+
if (value === null || typeof value === "boolean" || typeof value === "number" && Number.isFinite(value)) {
|
|
333
|
+
return (0, import_gpu_expression.literal)(value).node;
|
|
334
|
+
}
|
|
335
|
+
break;
|
|
317
336
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const left = this.parseIdentifier();
|
|
322
|
-
this.expectSymbol("=");
|
|
323
|
-
const right = this.parseIdentifier();
|
|
324
|
-
return { type, table, ...alias ? { alias } : {}, left, right };
|
|
325
|
-
}
|
|
326
|
-
parseExpression(depth, minimumPrecedence = 0) {
|
|
327
|
-
if (depth > MAXIMUM_EXPRESSION_DEPTH)
|
|
328
|
-
throw new Error("GPUSQL expression nesting exceeds its safe limit");
|
|
329
|
-
let expression = this.parseUnary(depth + 1);
|
|
330
|
-
while (true) {
|
|
331
|
-
if (minimumPrecedence <= 3 && this.takeKeyword("IS")) {
|
|
332
|
-
const negated = this.takeKeyword("NOT");
|
|
333
|
-
this.expectKeyword("NULL");
|
|
334
|
-
expression = {
|
|
337
|
+
case "UnaryExpression":
|
|
338
|
+
if (expression.operator === "!" || expression.operator === "-") {
|
|
339
|
+
return {
|
|
335
340
|
kind: "unary",
|
|
336
|
-
operator:
|
|
337
|
-
operand: expression
|
|
341
|
+
operator: expression.operator === "!" ? "not" : "negate",
|
|
342
|
+
operand: lowerSQLExpression(expression.argument, parameters)
|
|
338
343
|
};
|
|
339
|
-
continue;
|
|
340
344
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
return expression;
|
|
354
|
-
}
|
|
355
|
-
parseUnary(depth) {
|
|
356
|
-
if (this.takeKeyword("NOT")) {
|
|
357
|
-
return { kind: "unary", operator: "not", operand: this.parseExpression(depth, 3) };
|
|
358
|
-
}
|
|
359
|
-
if (this.takeSymbol("-")) {
|
|
360
|
-
return { kind: "unary", operator: "negate", operand: this.parseUnary(depth + 1) };
|
|
361
|
-
}
|
|
362
|
-
if (this.takeSymbol("(")) {
|
|
363
|
-
const expression = this.parseExpression(depth + 1);
|
|
364
|
-
this.expectSymbol(")");
|
|
365
|
-
return expression;
|
|
366
|
-
}
|
|
367
|
-
const token = this.take();
|
|
368
|
-
if (!token)
|
|
369
|
-
throw new Error("GPUSQL expected an expression");
|
|
370
|
-
if (token.kind === "number") {
|
|
371
|
-
const value = Number(token.value);
|
|
372
|
-
if (!Number.isFinite(value))
|
|
373
|
-
throw new Error("GPUSQL numeric literals must be finite");
|
|
374
|
-
return (0, import_gpu_expression.literal)(value).node;
|
|
375
|
-
}
|
|
376
|
-
if (token.kind === "parameter") {
|
|
377
|
-
if (!Object.hasOwn(this.parameters, token.value)) {
|
|
378
|
-
throw new Error(`GPUSQL parameter ":${token.value}" requires an explicit default`);
|
|
345
|
+
break;
|
|
346
|
+
case "BinaryExpression": {
|
|
347
|
+
const operator = SQL_BINARY_OPERATORS[expression.operator];
|
|
348
|
+
if (operator) {
|
|
349
|
+
return {
|
|
350
|
+
kind: "binary",
|
|
351
|
+
operator,
|
|
352
|
+
left: lowerSQLExpression(expression.left, parameters),
|
|
353
|
+
right: lowerSQLExpression(expression.right, parameters)
|
|
354
|
+
};
|
|
379
355
|
}
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
if (token.kind === "identifier") {
|
|
383
|
-
if (/^NULL$/i.test(token.value))
|
|
384
|
-
return (0, import_gpu_expression.literal)(null).node;
|
|
385
|
-
if (/^TRUE$/i.test(token.value))
|
|
386
|
-
return (0, import_gpu_expression.literal)(true).node;
|
|
387
|
-
if (/^FALSE$/i.test(token.value))
|
|
388
|
-
return (0, import_gpu_expression.literal)(false).node;
|
|
389
|
-
return (0, import_gpu_expression.column)(token.value).node;
|
|
356
|
+
break;
|
|
390
357
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
const token = this.take();
|
|
401
|
-
if ((token == null ? void 0 : token.kind) !== "identifier")
|
|
402
|
-
throw new Error("GPUSQL expected a table or column identifier");
|
|
403
|
-
return token.value;
|
|
404
|
-
}
|
|
405
|
-
expectKeyword(keyword) {
|
|
406
|
-
if (!this.takeKeyword(keyword))
|
|
407
|
-
throw new Error(`GPUSQL expected ${keyword}`);
|
|
408
|
-
return true;
|
|
409
|
-
}
|
|
410
|
-
takeKeyword(keyword) {
|
|
411
|
-
const token = this.peek();
|
|
412
|
-
if ((token == null ? void 0 : token.kind) !== "identifier" || token.value.toUpperCase() !== keyword)
|
|
413
|
-
return false;
|
|
414
|
-
this.position++;
|
|
415
|
-
return true;
|
|
416
|
-
}
|
|
417
|
-
expectSymbol(symbol) {
|
|
418
|
-
if (!this.takeSymbol(symbol))
|
|
419
|
-
throw new Error(`GPUSQL expected "${symbol}"`);
|
|
420
|
-
}
|
|
421
|
-
takeSymbol(symbol) {
|
|
422
|
-
const token = this.peek();
|
|
423
|
-
if ((token == null ? void 0 : token.kind) !== "symbol" || token.value !== symbol)
|
|
424
|
-
return false;
|
|
425
|
-
this.position++;
|
|
426
|
-
return true;
|
|
427
|
-
}
|
|
428
|
-
take() {
|
|
429
|
-
const token = this.tokens[this.position];
|
|
430
|
-
if (token)
|
|
431
|
-
this.position++;
|
|
432
|
-
return token;
|
|
433
|
-
}
|
|
434
|
-
peek() {
|
|
435
|
-
return this.tokens[this.position];
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
function tokenizeGPUSQL(source) {
|
|
439
|
-
if (typeof source !== "string" || source.length === 0 || source.length > MAXIMUM_SQL_LENGTH) {
|
|
440
|
-
throw new Error("GPUSQL requires a nonempty, safely bounded SELECT statement");
|
|
441
|
-
}
|
|
442
|
-
const expression = /\s+|(?:--[^\n\r]*)|(?::([A-Za-z_][A-Za-z0-9_]*))|([A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)?)|(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(<=|>=|<>|!=|[(),;*+\-/=<>])/gy;
|
|
443
|
-
const tokens = [];
|
|
444
|
-
let cursor = 0;
|
|
445
|
-
while (cursor < source.length) {
|
|
446
|
-
expression.lastIndex = cursor;
|
|
447
|
-
const match = expression.exec(source);
|
|
448
|
-
if (!match)
|
|
449
|
-
throw new Error(`GPUSQL contains an unsupported token at character ${cursor}`);
|
|
450
|
-
cursor = expression.lastIndex;
|
|
451
|
-
if (match[1])
|
|
452
|
-
tokens.push({ kind: "parameter", value: match[1] });
|
|
453
|
-
else if (match[2])
|
|
454
|
-
tokens.push({ kind: "identifier", value: match[2] });
|
|
455
|
-
else if (match[3])
|
|
456
|
-
tokens.push({ kind: "number", value: match[3] });
|
|
457
|
-
else if (match[4])
|
|
458
|
-
tokens.push({ kind: "symbol", value: match[4] });
|
|
459
|
-
if (tokens.length > MAXIMUM_SQL_TOKENS)
|
|
460
|
-
throw new Error("GPUSQL statement exceeds its safe token limit");
|
|
461
|
-
}
|
|
462
|
-
return tokens;
|
|
463
|
-
}
|
|
464
|
-
function getGPUSQLBinaryOperator(value) {
|
|
465
|
-
switch (value.toUpperCase()) {
|
|
466
|
-
case "OR":
|
|
467
|
-
return { operator: "or", precedence: 1 };
|
|
468
|
-
case "AND":
|
|
469
|
-
return { operator: "and", precedence: 2 };
|
|
470
|
-
case "=":
|
|
471
|
-
return { operator: "equal", precedence: 3 };
|
|
472
|
-
case "!=":
|
|
473
|
-
case "<>":
|
|
474
|
-
return { operator: "not-equal", precedence: 3 };
|
|
475
|
-
case ">":
|
|
476
|
-
return { operator: "greater-than", precedence: 3 };
|
|
477
|
-
case ">=":
|
|
478
|
-
return { operator: "greater-than-or-equal", precedence: 3 };
|
|
479
|
-
case "<":
|
|
480
|
-
return { operator: "less-than", precedence: 3 };
|
|
481
|
-
case "<=":
|
|
482
|
-
return { operator: "less-than-or-equal", precedence: 3 };
|
|
483
|
-
case "+":
|
|
484
|
-
return { operator: "add", precedence: 4 };
|
|
485
|
-
case "-":
|
|
486
|
-
return { operator: "subtract", precedence: 4 };
|
|
487
|
-
case "*":
|
|
488
|
-
return { operator: "multiply", precedence: 5 };
|
|
489
|
-
case "/":
|
|
490
|
-
return { operator: "divide", precedence: 5 };
|
|
358
|
+
case "CallExpression":
|
|
359
|
+
if (expression.arguments.length === 1 && (expression.callee["name"] === "isNull" || expression.callee["name"] === "isNotNull")) {
|
|
360
|
+
return {
|
|
361
|
+
kind: "unary",
|
|
362
|
+
operator: expression.callee["name"] === "isNull" ? "is-null" : "is-valid",
|
|
363
|
+
operand: lowerSQLExpression(expression.arguments[0], parameters)
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
break;
|
|
491
367
|
default:
|
|
492
|
-
|
|
368
|
+
break;
|
|
493
369
|
}
|
|
370
|
+
throw new Error(`GPUSQL does not support SQL expression "${expression.type}"`);
|
|
494
371
|
}
|
|
495
372
|
// Annotate the CommonJS export names for ESM import in node:
|
|
496
373
|
0 && (module.exports = {
|
|
@@ -11,7 +11,7 @@ type GPUSQLCompiledPlan = Readonly<{
|
|
|
11
11
|
compile: (graph: GPUCommandGraph<GPUDataFrameQueryParameters>) => CompiledGPUDataFrameQuery;
|
|
12
12
|
}>;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* SQL frontend over explicitly registered, already GPU-resident dataframes.
|
|
15
15
|
*
|
|
16
16
|
* Parsing and planning never upload data, submit work, or read GPU buffers. Arrow upload/output
|
|
17
17
|
* remain explicit `@luma.gl/graph/arrow` operations around the shared GPU table execution core.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpu-sql.d.ts","sourceRoot":"","sources":["../../src/gpu-sql/gpu-sql.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gpu-sql.d.ts","sourceRoot":"","sources":["../../src/gpu-sql/gpu-sql.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAC,YAAY,EAAC,2CAAwC;AAU7D,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC5B,+CAA4C;AAE7C,2FAA2F;AAC3F,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;AAElE,iGAAiG;AACjG,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IAAC,UAAU,CAAC,EAAE,2BAA2B,CAAA;CAAC,CAAC,CAAC;AA8BtF,KAAK,kBAAkB,GAAG,QAAQ,CAAC;IACjC,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,2BAA2B,CAAC,KAAK,yBAAyB,CAAC;CAC7F,CAAC,CAAC;AAiCH;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;gBAEpD,MAAM,EAAE,YAAY;IAchC,8FAA8F;IAC9F,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,WAAW;CAIrE;AAED,+FAA+F;AAC/F,qBAAa,WAAW;IACtB,2FAA2F;IAC3F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAE1C,gBAAgB;gBACJ,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB;IAMjD,sFAAsF;IACtF,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,2BAA2B,CAAC,GAAG,yBAAyB;CAGxF"}
|