comphead commented on code in PR #4869:
URL: https://github.com/apache/datafusion-comet/pull/4869#discussion_r3546744812
##########
spark/src/test/scala/org/apache/comet/exec/CometExecSuite.scala:
##########
@@ -2209,6 +2209,48 @@ class CometExecSuite extends CometTestBase {
}
}
+ // Regression test for https://github.com/apache/datafusion-comet/issues/4787
+ // A scalar subquery inside a RepartitionByExpression (DISTRIBUTE BY) lives
in the shuffle's
+ // partitioning expressions, not the native child subtree, so it must be
registered separately
+ // for the native shuffle writer to resolve it.
+ test("scalar subquery in repartition") {
+ withParquetTable((0 until 10).map(i => (i, i)), "t") {
+ val df = sql("SELECT * FROM t DISTRIBUTE BY (_1 + (SELECT max(_2) FROM
t))")
+ checkSparkAnswerAndOperator(df)
+ }
+ }
+
+ // Same as above but forces a non-native shuffle child
(CometSparkToColumnarExec) by disabling
+ // the native scan and routing the parquet read through Spark-to-Arrow
conversion. This exercises
+ // the prepareShuffleDependency convenience-overload path, which builds its
own NativeExecContext.
+ test("scalar subquery in repartition over non-native child") {
+ withSQLConf(
+ CometConf.COMET_NATIVE_SCAN_ENABLED.key -> "false",
Review Comment:
wondering, do we really need this test with native scan disabled?
considering native scan is only supported
--
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]