You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Ben Kietzman (Jira)" <ji...@apache.org> on 2021/02/08 21:50:00 UTC

[jira] [Created] (ARROW-11562) [C++][Dataset] Provide more robust handling of comparison guarantees in the presence of implicit casts

Ben Kietzman created ARROW-11562:
------------------------------------

             Summary: [C++][Dataset] Provide more robust handling of comparison guarantees in the presence of implicit casts
                 Key: ARROW-11562
                 URL: https://issues.apache.org/jira/browse/ARROW-11562
             Project: Apache Arrow
          Issue Type: Bug
          Components: C++
    Affects Versions: 3.0.0
            Reporter: Ben Kietzman
            Assignee: Ben Kietzman


After ARROW-8919 it's possible that a field reference may be wrapped in an implicit cast, which complicates destructuring during expression simplification. In particular, some errors can arise as a result of assuming that casts will preserve numeric ordering:

{code:c++}
int two_28 = 1 << 28;

auto partition_expr = less_equal(field_ref("i32"), literal(two_28 + 1));

auto filter = greater(
  cast(field_ref("i32"), float32()),
  literal(float(two_28)));
{code}

Currently the RHS of the filter and the partition expression will be considered equal since casting {{two_28+1}} to float results in the same value as casting {{two_28}} to float (due to limited FP precision). Since {{x <= y}} and {{x > y}} are disjoint, the partition will skipped entirely including any rows where {{i32 == two_28+1}} (which *should* be selected by this filter).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)