Skip to content

fix: handle Arrow Int64 BigInt values in accessors and filters - #3641

Open
igorDykhta wants to merge 2 commits into
masterfrom
igr/bigint-improvements
Open

fix: handle Arrow Int64 BigInt values in accessors and filters#3641
igorDykhta wants to merge 2 commits into
masterfrom
igr/bigint-improvements

Conversation

@igorDykhta

@igorDykhta igorDykhta commented Aug 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Parquet/Arrow Int64 columns surface as JS BigInt, which breaks d3 scales, GPU filters (bigint - number), and integer formatters.

  • Bind Number() on field.valueAccessor once per Int64 column at import; other columns are unchanged.
  • Leave valueAt raw so H3/A5 64-bit ids stay exact.
  • Point GPU filters, filter line charts, aggregations, and flow counts at valueAccessor.
  • Coerce BigInt in numeric d3 formatters (table display format / tooltips).

Test plan

  • Load a GeoParquet/Parquet file with Int64 columns (no DuckDB)
  • Color Scale on an Int64 field
  • Create a range filter on an Int64 field (GeoJSON PathLayer should stay enabled)
  • Set integer display format in the data table
  • H3 layer still renders when hex ids are Int64

Ihor Dykhta added 2 commits August 16, 2026 07:59
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Signed-off-by: Ihor Dykhta <ihordykhta@Ihors-MacBook-Pro.local>
Copilot AI lite review requested due to automatic review settings August 16, 2026 05:28
@igorDykhta igorDykhta changed the title Igr/bigint improvements fix: handle Arrow Int64 BigInt values in accessors and filters Aug 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves handling of Arrow Int64/Uint64 columns (which materialize as JS bigint) by routing reads through field valueAccessors (which can coerce Int64 to number), and by updating formatting/aggregation/filtering paths to avoid d3-format failures on bigint.

Changes:

  • Add Int64-aware valueAccessor binding in KeplerTable (convert raw bigint cell values to number for consumers).
  • Update aggregation/plotting, filter plotting, GPU filter accessors, and several layers to use field.valueAccessor(...) instead of dataContainer.valueAt(...).
  • Add node tests covering Int64 accessors and BigInt formatting.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/node/utils/kepler-table-test.js Adds coverage for Int64 Arrow columns: raw valueAt stays bigint, valueAccessor yields number.
test/node/utils/data-utils-test.js Adds coverage ensuring numeric formatters can handle bigint inputs.
src/utils/src/plot.ts Routes aggregation accessors through valueAccessor (esp. percent fields).
src/utils/src/filter-utils.ts Uses valueAccessor when building y-series for non-histogram plots.
src/utils/src/data-utils.ts Switches numeric tooltip formatting to a BigInt-safe wrapper.
src/table/src/kepler-table.ts Introduces Int64 Arrow column detection + valueAccessor conversion to number.
src/table/src/gpu-filter-utils.ts Makes GPU filter accessor prefer field.valueAccessor (Int64-safe) with optional custom getData.
src/layers/src/trip-layer/trip-layer.ts Uses valueAccessor for GeoJSON column-mode value reads.
src/layers/src/heatmap-layer/heatmap-layer.ts Simplifies GPU filter accessor wiring to rely on valueAccessor.
src/layers/src/geojson-layer/geojson-layer.ts Uses dataset fields + valueAccessor for filter values (incl. text labels).
src/layers/src/flow-layer/flow-layer.ts Uses valueAccessor for magnitudes and coerces tooltip formatting for BigInt.
src/layers/src/aggregation-layer.ts Uses field.valueAccessor in aggregation and GPU filtering paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +457 to +461
/** d3-format cannot take BigInt; Int64 table cells are still raw bigint from valueAt. */
function formatNumeric(spec: string): FieldFormatter {
const format = d3Format(spec);
return v => format(Number(v));
}
fieldValues: Array<{labelMessage: string; value: any}>;
} | null {
const fmt = d3Format(TOOLTIP_FORMATS.DECIMAL_COMMA.format);
const fmt = v => d3Format(TOOLTIP_FORMATS.DECIMAL_COMMA.format)(Number(v));
Comment thread src/utils/src/plot.ts
Comment on lines 384 to 387
return {
getNumerator: i => dataContainer.valueAt(i, numeratorIdx),
getDenominator: i => dataContainer.valueAt(i, denominatorIdx)
getNumerator: i => fields[numeratorIdx].valueAccessor({index: i}),
getDenominator: i => fields[denominatorIdx].valueAccessor({index: i})
};
Comment on lines +162 to +164
const datum = d || objectInfo;
// field.valueAccessor is Number() for Int64 columns; valueAt stays raw BigInt.
const data = getData ? getData(dc, datum, fieldIndex) : field.valueAccessor(datum);
@igorDykhta
igorDykhta requested a review from lixun910 August 16, 2026 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants