coderfender commented on code in PR #1996: URL: https://github.com/apache/datafusion-comet/pull/1996#discussion_r2233026854
########## spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala: ########## @@ -677,7 +677,14 @@ object QueryPlanSerde extends Logging with CometExprShim { } None - case div @ IntegralDivide(left, right, _) if supportedDataType(left.dataType) => + case div @ IntegralDivide(leftInt, rightInt, _) if supportedDataType(leftInt.dataType) => + val left = + if (leftInt.dataType.isInstanceOf[DecimalType]) leftInt else Cast(leftInt, DoubleType) + val right = + if (rightInt.dataType.isInstanceOf[DecimalType]) rightInt + else Cast(rightInt, DoubleType) + withInfo(div, s"left data type ${left.dataType} casted to ${leftInt.dataType}") + withInfo(div, s"right data type ${right.dataType} casted to ${rightInt.dataType}") Review Comment: I will make those changes in a separate PR ########## spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala: ########## @@ -2744,6 +2744,16 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper { } } + test("Integral Division Overflow Handling Matches Spark Behavior") { + withTable("t1") { + val value = Long.MinValue + sql(s"create table t1(c1 long, c2 short) using parquet") Review Comment: Fixed this inconsistency in latest commit -- 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-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org