Skip to content

fix(reader): a float or decimal operand on an integer column fails instead of truncating - #702

Merged
dfa1 merged 1 commit into
mainfrom
fix/701-fractional-operand
Nov 8, 2026
Merged

dfa1 merged 1 commit into
mainfrom
fix/701-fractional-operand

Conversation

@dfa1

@dfa1 dfa1 commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Closes #701.

  • `Compare` (generic path and zone pruning) and `PrimitiveFilter.lowerLong` (fused kernels) now read integer-column operands through `Compare.integer`. It accepts `Long`, `Integer`, `Short` and `Byte`, and throws `VortexException` for `Double`, `Float` and `BigDecimal`.
  • Matches vortex-jni, which refuses the same filter with "Cannot compare different DTypes i64 and f64" (`FractionalOperandInteropIntegrationTest`).
  • SQL was not affected: Calcite never pushes a fractional literal onto an integer column (`FractionalLiteralTest`, every operator).
  • Breaking: a whole double such as 2^53 is refused too. The reader: ScanIterator.compareValues swallows ClassCastException, silently disabling zone-map pruning on type-mismatched filters #159 test that accepted one is now a rejection test.

🤖 Generated with Claude Code

…stead of truncating

Compare's integer branch and PrimitiveFilter.lowerLong (the fused
kernels' long domain) read the operand with Number.longValue(), so a
Double, Float or BigDecimal was truncated: `x >= 1.5` on an I64 column
matched `x = 1`. Both now go through Compare.integer, which accepts an
integer of any width and throws VortexException otherwise, as Rust's
compare refuses operands of different dtypes ("Cannot compare different
DTypes i64 and f64", pinned against vortex-jni).

SQL was never affected: Calcite does not push a fractional literal onto
an integer column (FractionalLiteralTest pins every operator). A whole
double such as 2^53 is now refused too, which reverses the #159 test
that accepted it; the dtype differs, as in Rust.

Closes #701

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dfa1
dfa1 force-pushed the fix/701-fractional-operand branch from 7855cd9 to 6a5e5a2 Compare November 8, 2026 08:05
@dfa1
dfa1 merged commit 9ccc8c1 into main Nov 8, 2026
6 checks passed
@dfa1
dfa1 deleted the fix/701-fractional-operand branch November 8, 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.

Compare truncates a fractional operand on an integer column (x >= 1.5 matches x = 1)

1 participant