Repository navigation
feat(examples v10): infer position precision with SQL ARRAY - #11266
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed d28bb79 after merge; follow-ups below. No P1s.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| data: AIRPORTS, | ||
| loaders: [JSONTableLoader], | ||
| getPosition: {sql: 'ARRAY_FLOAT64(longitude, latitude)'}, | ||
| getPosition: {sql: 'ARRAY[longitude, latitude]'}, |
There was a problem hiding this comment.
P2: (Outside the diff: docs/api-reference/core/layer.md:377) The examples now teach ARRAY[longitude, latitude], but docs/api-reference/core/layer.md:377 on master still shows FLOAT64x2(longitude, latitude), and website/src/doc-demos/widgets.js:584 uses ARRAY_FLOAT64(x, y). The precision rule this PR relies on is not documented either: with math.gl rc.2, integer-only inputs give Float64 and otherwise the widest float input wins. Could layer.md show ARRAY[...] and state that rule?
Generated by Claude Code
Background
The v10 examples can infer coordinate precision from numeric Arrow columns.
Change List
ARRAY[...]Verified with lint, WebGL and WebGPU picking tests, and coordinate comparisons on six example datasets.
Note
Low Risk
The changes are confined to example applications and new test coverage, with no changes to core library runtime code.
Overview
Updates v10 example applications to use standard SQL
ARRAY[...]constructor syntax instead ofARRAY_FLOAT64(...)for position and target/source position accessors. This allows coordinate precision to be inferred directly from the underlying Arrow column types rather than explicitly casting to float64.Also adds Vitest coverage for
ScatterplotLayerverifying SQLARRAY[...]position evaluation on WebGL and WebGPU with bothFloat32ArrayandFloat64Arraybuffers.Reviewed by Cursor Bugbot for commit d28bb79. Bugbot is set up for automated code reviews on this repo. Configure here.