You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "mbutrovich (via GitHub)" <gi...@apache.org> on 2024/09/17 22:51:22 UTC
Re: [PR] Normalize float zeros (-0.0 -> 0.0) before binary operations [datafusion]
mbutrovich commented on code in PR #11585:
URL: https://github.com/apache/datafusion/pull/11585#discussion_r1764114102
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -289,6 +289,14 @@ impl PhysicalExpr for BinaryExpr {
return apply_cmp_for_nested(self.op, &lhs, &rhs);
}
+ if left_data_type.is_floating() {
+ lhs = normalize_floating_zeros(lhs, &left_data_type)?;
+ };
+
+ if right_data_type.is_floating() {
+ rhs = normalize_floating_zeros(rhs, &right_data_type)?;
+ }
Review Comment:
Following up on this: Is the proposal here to add a new kernel to arrow-rs that supports these floating point comparison semantics, or hoist arrow-rs comparison code to DataFusion and implement it there?
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -289,6 +289,14 @@ impl PhysicalExpr for BinaryExpr {
return apply_cmp_for_nested(self.op, &lhs, &rhs);
}
+ if left_data_type.is_floating() {
+ lhs = normalize_floating_zeros(lhs, &left_data_type)?;
+ };
+
+ if right_data_type.is_floating() {
+ rhs = normalize_floating_zeros(rhs, &right_data_type)?;
+ }
Review Comment:
@ozankabak Following up on this: Is the proposal here to add a new kernel to arrow-rs that supports these floating point comparison semantics, or hoist arrow-rs comparison code to DataFusion and implement it there?
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org