viirya commented on code in PR #7730:
URL: https://github.com/apache/datafusion-comet/pull/7730#discussion_r4703070930
##########
native/core/src/execution/planner.rs:
##########
@@ -1492,6 +1492,11 @@ impl PhysicalPlanner {
let left = self.create_expr(left, Arc::clone(&input_schema))?;
let right = self.create_expr(right, Arc::clone(&input_schema))?;
+ let right = if op == DataFusionOperator::Divide && eval_mode !=
EvalMode::Ansi {
Review Comment:
This fixes the divisor side. The dividend still differs from Spark.
`DivModLike` evaluates the right operand first and skips the left one when the
divisor is null or zero, in both `eval` and codegen. Comet evaluates `left` for
every row. So with `rand(42) / x` or `monotonically_increasing_id() / x`, Comet
advances the generator on rows that Spark skips, and later rows stop matching.
This is pre-existing and a guard can't fix it, so could you open a tracking
issue and link it here?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]