Skip to content

feat(data): say when a Parquet decimal column may be read rounded (#3539 part 2c) - #3638

Merged
elpidioassinaturas merged 1 commit into
opengeos:mainfrom
elpidioassinaturas:feat/parquet-table-3539-p2c
Dec 3, 2026
Merged

elpidioassinaturas merged 1 commit into
opengeos:mainfrom
elpidioassinaturas:feat/parquet-table-3539-p2c

Conversation

@elpidioassinaturas

@elpidioassinaturas elpidioassinaturas commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Part of #3539 (part 2c). Parts 2a (#3625) and 2b (#3630) read a Parquet table's chosen columns, locally and by web address. This part says when a decimal column may be read rounded, in a table and in a GeoParquet layer, as promised in round 4 of #3550.

What changes

  • A notice for decimals a number field may round. RustGIS reads a decimal stored as a 64-bit integer as a floating-point number, which holds whole numbers exactly only up to 2^53. A decimal column is now named in a ChangedRounded notice when its values, before the decimal point is placed, go past 2^53 in a row group's statistics. It is also named when a row group has no statistics for it and its precision is over 15 digits. Example: "1 decimal column may be read rounded ('price'): a number field holds whole numbers exactly only up to 2^53 (9007199254740992), before the decimal point is placed".
    • The check reads only the footer (column statistics), so it adds no read of the rows and works the same by web address.
    • It runs where both readers build their fields: ParquetSource::new (GeoParquet layers: Add Data, uploads, downloads, by range) and ParquetTable::new (tables).
    • "fields" (ParquetTable::keep_fields) and ParquetSource::with_columns (nested STAC columns) change the fields after the file opens, so they say it again for the columns read: a decimal column left out by "fields" is no longer named.
    • Decimals stored as 32-bit integers can't pass 2^53 and are never named. Decimals stored as bytes are left out, as before.
  • Docs: the GeoParquet row of data-formats.md says when the notice appears.

Tests

  • decimals_a_number_field_may_round_are_said (data, table): one column past 2^53 by its statistics and one with no statistics and 18 digits are named. One within, one with no statistics and 12 digits, and a 32-bit decimal are not. With "fields", only the kept ones are named, and none when none is kept.
  • geoparquet_decimals_past_2_53_are_said_to_be_read_rounded (data, GeoParquet): the same notice for a layer's attribute, and none for values within.

cargo test -p rustgis-data -p rustgis-engine for Parquet and decimals, clippy, fmt and cargo xtask test-hygiene pass.

Left for the next parts of #3539

  • Range reads of a table in the desktop app (off the frame) and in the browser.
  • A chunked read of the table: Cancel within a row group, fixed-width columns checked against the budget before decoding, the budget sized with memory::planned, and exact byte ranges for reads with "fields".
  • layer.addDataBytes: put an uploaded table on the background read path.

#3567 (export over a table's own source) was closed by #3582, whose check covers tables, Parquet ones included.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • GeoParquet sources now show a notice when integer-stored decimal columns may exceed the exact precision available when read as floating-point values. The notice identifies affected columns and updates when the selected columns change.
  • Documentation
    • Clarified how integer-stored decimal columns are read and when their values may be rounded.

…engeos#3539 part 2c)

A decimal stored as a 64-bit integer is read as a Double, which holds
whole numbers exactly only up to 2^53. Tables and GeoParquet layers now
name, in a ChangedRounded notice, the decimal columns whose values pass
2^53 in the column statistics, or may (no statistics, more than 15
digits). "fields" and nested STAC columns say it again for the columns
read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Parquet sources and tables now report when INT64 decimal values may be rounded during floating-point conversion. The notice reflects the current selected fields. Tests cover values, statistics, and field selection, and the user guide documents the notice criteria.

Changes: Decimal Rounding Notices

Layer / File(s) Summary
Detect and maintain rounding notices
crates/data/src/source/parquet.rs, crates/data/src/source/parquet/table.rs, crates/data/src/source/tests.rs, docs/user-guide/data-formats.md
The note helper checks INT64 decimal statistics against the exact-integer range and uses precision greater than 15 when bounds are unavailable. Sources and tables add or recalculate the notice as fields change. Tests cover qualifying values and field selection; the guide describes the notice criteria.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature

Possibly related PRs

  • opengeos/RustGIS#3550: This PR adds and updates rounding notices in the ParquetTable reader introduced by that PR.

Suggested reviewers: mavrick-f, giswqs, choupeanut

Merge Risk: Minimal · up to 3533f

This change adds a notice when decimal columns in Parquet and GeoParquet files may lose precision on read. It does not alter the data read. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a Parquet decimal column that may be read rounded now gets a notice. It also names the scope (feat(data)) and the tracking reference (#3539 part 2c). The raw summary a…
Description check Passed The description follows the template's Summary and Testing sections with substantive content. The Summary explains the ChangedRounded notice, its 2^53 rule, the 15-digit fallback, and where the check …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: a Parquet decimal column that may be read rounded now gets a notice. It also names the scope (feat(data)) and the tracking reference (#3539 part 2c). The raw summary and objectives both describe a ChangedRounded notice for decimal columns in Parquet tables and GeoParquet layers, so the title matches the changeset.

Full details: Description check

Explanation

The description follows the template's Summary and Testing sections with substantive content. The Summary explains the ChangedRounded notice, its 2^53 rule, the 15-digit fallback, and where the check runs. The Testing section lists new tests and the commands run. The 'UI evidence' section is missing. It is not a required heading to fill in, since the template says to keep 'No visible UI change.' when there is no visible UI change, and the author's text does not include that line. The 'Related issue' section is also missing its value. The description cites Part of #3539, so this is a minor gap.

Resolution

Add the 'No visible UI change.' line under the UI evidence heading, and replace the placeholder under Related issue with the reference, for example 'Part of #3539'. The Related issue section already names #3539 in the description body, so the second change is a formatting fix.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit reads the stats with care,
And spots where decimals lose their share.
It names the fields that may round away,
Then checks the chosen columns stay.
The guide now tells what numbers show,
And off the rabbit hops through snow.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 571acb24-ce60-4ec8-9c2d-c4afb311c290
Commits

Reviewing files that changed from the base of the PR and between 19b049e and 3533f63.

Files selected for processing: 4

  • crates/data/src/source/parquet.rs
  • crates/data/src/source/parquet/table.rs
  • crates/data/src/source/tests.rs
  • docs/user-guide/data-formats.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3638/
Web app https://preview.rustgis.app/pr-3638/app/
Commit 3533f63

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@elpidioassinaturas
elpidioassinaturas added this pull request to the merge queue Dec 3, 2026
Merged via the queue into opengeos:main with commit 83edfa5 Dec 3, 2026
27 checks passed
@elpidioassinaturas
elpidioassinaturas deleted the feat/parquet-table-3539-p2c branch December 3, 2026 03:30
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