philo-he commented on code in PR #13184:
URL: https://github.com/apache/gluten/pull/13184#discussion_r4244821841
##########
backends-velox/src/test/scala/org/apache/gluten/execution/MiscOperatorSuite.scala:
##########
@@ -1649,12 +1649,17 @@ class MiscOperatorSuite extends
VeloxWholeStageTransformerSuite with AdaptiveSpa
}
test("Support multi-children count with row construct") {
- runQueryAndCompare(
- """
- |select l_orderkey, count(distinct l_partkey, l_comment),
corr(l_partkey, l_partkey+1)
- |from lineitem group by l_orderkey
- |""".stripMargin
- )(df => checkFallbackOperators(df, 0))
+ // Spark before 4.3 (SPARK-58213) throws DIVIDE_BY_ZERO for corr on a
column with zero variance
+ // in ANSI mode, while Velox returns NULL as Spark 4.3 does. Run with ANSI
mode disabled until
+ // the minimum supported Spark version includes the fix.
Review Comment:
Could you create a GitHub issue for future tracking? Thanks.
##########
gluten-substrait/src/test/scala/org/apache/gluten/execution/GlutenQueryComparisonTest.scala:
##########
@@ -72,6 +74,32 @@ abstract class GlutenQueryComparisonTest extends
GlutenQueryTest {
cache)
}
+ /**
+ * Like `runQueryAndCompare`, but in ANSI mode also accepts a query that
fails on vanilla Spark,
+ * which happens when ANSI mode rejects its input (for example, a malformed
string cast to a
+ * number). In that case, checks that Gluten fails too.
+ */
+ protected def runQueryAndCompareOrBothFail(
Review Comment:
This method name is a bit long.
How about naming it `runQueryAndCheck`? It compares results when both
succeed, accepts both failing, and rejects mismatched outcomes (one fails, the
another doesn't).
--
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]