pitrou commented on code in PR #47459:
URL: https://github.com/apache/arrow/pull/47459#discussion_r2318835708
##########
cpp/src/arrow/compute/expression_test.cc:
##########
@@ -800,6 +804,42 @@ TEST(Expression, BindWithImplicitCasts) {
ExpectBindsTo(cmp(field_ref("i32"),
literal(std::make_shared<DoubleScalar>(10.0))),
cmp(cast(field_ref("i32"), float32()),
literal(std::make_shared<FloatScalar>(10.0f))));
+
+ // decimal int
+ ExpectBindsTo(cmp(field_ref("dec128_3_2"), field_ref("i64")),
+ cmp(field_ref("dec128_3_2"), cast(field_ref("i64"),
decimal128(21, 2))),
+ /*bound_out=*/nullptr, *exciting_schema);
+ ExpectBindsTo(cmp(field_ref("i64"), field_ref("dec128_3_2")),
+ cmp(cast(field_ref("i64"), decimal128(21, 2)),
field_ref("dec128_3_2")),
+ /*bound_out=*/nullptr, *exciting_schema);
+
+ // decimal128 decimal256 with different scales
Review Comment:
What happens with the same scale and different precisions, btw? Ideally no
cast would occur since the raw values can be compared directly, but regardless
we might add tests for that situation as well?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]