Repository navigation
feat(layers): align Arrow vector and SQL accessors across tabular layers - #11219
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cda71d7075
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
[Medium impact] The PR appears safe to merge; no new blocking issues were found. SummaryAdds Arrow vector and SQL accessor support across row-based layers and lets
The four earlier findings remain addressed. No new issues found. Reviews (5) · Last reviewed commit: "Type merged sublayer triggers" · Reviewed by Greptile |
chrisgervang
left a comment
There was a problem hiding this comment.
Reviewed c4ccf77 after merge; follow-ups below.
One P1: the Arrow guide's units for color columns are wrong.
Labels: P1 settle before this is merged, P2 can follow, Non-blocking optional.
Generated by Claude Code
| These accessors use the same shapes and units as row callbacks. Supply the | ||
| source table alongside the accessors so the layer has a row count. Passing | ||
| `data: null` clears the layer and defers SQL evaluation. A zero-row Arrow | ||
| table retains its schema and draws no features. |
There was a problem hiding this comment.
P1: "the same shapes and units as row callbacks" is wrong for colors. Without normalizedColors, a float column [1, 0, 0, 1] draws red, and a callback returning it draws near-black. Null cells are unexplained, while Limitations says Arrow columns must not contain nulls.
Could we use this wording?
| These accessors use the same shapes and units as row callbacks. Supply the | |
| source table alongside the accessors so the layer has a row count. Passing | |
| `data: null` clears the layer and defers SQL evaluation. A zero-row Arrow | |
| table retains its schema and draws no features. | |
| These accessors read the same shapes as row callbacks. Color columns follow the | |
| [Arrow color convention](#colors), and a null cell acts like a callback that | |
| returns `null`. Supply the source table alongside the accessors so the layer has | |
| a row count. Passing `data: null` clears the layer and defers SQL evaluation. | |
| A zero-row Arrow table retains its schema and draws no features. |
Generated by Claude Code
| readAccessorValue(value.get(index), color) | ||
| ); | ||
| } | ||
| return value; |
There was a problem hiding this comment.
P2: Int64 cells reach row consumers as BigInt. A getWeight or getWidth column of Int64 falls back to the default value, and Int64 trip timestamps throw.
- With apache-arrow 21.2.0, this returns
3nfor an Int64 cell and[0n, 1n]forList<Int64>. _normalizeValuetreats a BigInt as missing, and aFloat32Arraywrite of one throws.
Could BigInt cells go through Number(), as the color branch does, with an Int64 test case?
Details
- Parquet and DuckDB integer columns often load as Int64, and
tableFromArraysmakes Int64 from bigint values. - The tests build
List<Float64>columns only.FixedSizeListcells and null cells read correctly in the same replay.
Generated by Claude Code
| Object.keys(columns ?? {}).some(name => columns[name] !== oldColumns?.[name]) || | ||
| Object.keys(oldColumns ?? {}).some(name => !columns?.[name]) | ||
| ) { | ||
| return 'An Arrow row accessor changed'; |
There was a problem hiding this comment.
P2: Swapping one row accessor vector counts as a data change, so every attribute rebuilds. A new getFillColor vector on a PolygonLayer re-tessellates every polygon.
Layer.updateStatecallsattributeManager.invalidateAll()for any data change reason.
Could a changed column invalidate only its own accessor, as an update trigger does?
Details
- SQL resolution already sets
dataChangedthe same way (layer.ts:716). Not measured on a large table.
Generated by Claude Code
| /** Decodes feature geometry while retaining the table's row order for styling and picking. */ | ||
| function getArrowFeatures(data: Table): Feature[] { | ||
| /** First declared GeoArrow geometry field. */ | ||
| const field = data.schema.fields.find(candidate => getGeoArrowFieldInfo(candidate)?.encoding); |
There was a problem hiding this comment.
P2: GeoJsonLayer now takes an Arrow table but always decodes the first GeoArrow field. GeoArrowLayer from #11213 decodes the same inputs and takes getGeometry and geometryType. The data entry in geojson-layer.md does not list Arrow tables.
Should GeoJsonLayer take a geometry column prop like GeoArrowLayer? Could the data entry list the table input and link to Using with Arrow?
Generated by Claude Code
Resolve conflicts with the Arrow accessor and normalized color work on master: - text-layer.ts: keep TEXT_ALIGN from this branch and the color helpers from visgl#11164. Keep the 'arrow: row' default props from visgl#11219, and give getTextAlign and getLetterSpacing the same ArrowAccessor type and 'arrow: row' default, like every other TextLayer accessor. - text-layer.spec.ts: keep the letter spacing and alignment tests from this branch and the normalized color test from master. - whats-new.md (no conflict): move the TextLayer entry into the v10 Layers list. The automatic merge put it below the v10 separator.
Background
Several tabular layers consume row callbacks but do not accept Arrow vectors or SQL accessors.
Change List
Verified lint, affected package builds, and 14 Chromium layer tests.
Note
Medium Risk
Modifies core prop normalization, diffing, and sublayer propagation across numerous fundamental and aggregation layers to support Arrow and SQL inputs in row accessors.
Overview
Extends Apache Arrow vector and SQL query accessor support to row-oriented deck.gl layers across the core, layers, aggregation, mesh, and geo packages.
Introduces
'row'and'row-color'Arrow accessor modes in component prop types. When given an Arrow column vector or SQL query, layers automatically wrap the input in an accessor callback viareadAccessorValueto convert Arrow vectors into standard arrays or clamped color arrays. Column inputs are tracked viaROW_ACCESSOR_COLUMNS_SYMBOLto drive prop diffing and trigger sublayer updates in composite layers.Enables row-based Arrow and SQL accessors across
PathLayer,PolygonLayer,SolidPolygonLayer,TextLayer,IconLayer,TripsLayer,SimpleMeshLayer,ScenegraphLayer, and all aggregation layers. Additionally, updatesGeoJsonLayerto directly accept Arrow tables with GeoArrow geometry fields.Reviewed by Cursor Bugbot for commit c4ccf77. Bugbot is set up for automated code reviews on this repo. Configure here.