Skip to content

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

Closed

Description

@dfa1

Compare.values (reader/src/main/java/io/github/dfa1/vortex/reader/compute/Compare.java) compares integer columns as longs: Long.compare(na.longValue(), nb.longValue()), or Long.compareUnsigned for unsigned columns. When the predicate operand is fractional, longValue() truncates it. So on an I64 column, x >= 1.5 compares against 1, and a row with x = 1 matches when it should not.

To check first: whether Calcite casts or rounds the literal before it reaches Compare, which would hide the bug on the SQL path. The direct ScanFilter API would still hit it.

Fix direction: on an integer column, compare a fractional operand by value (or fold it into an integer bound per operator, e.g. x >= 1.5 becomes x >= 2), and look up what Rust does with a mismatched scalar (coerce or reject). Pin it with a filtered-scan test against vortex-jni.

Activity

  1. added
    bugSomething isn't working
    on Nov 8, 2026
  2. added a commit that references this issue on Nov 8, 2026
    6a5e5a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions