uros-b commented on code in PR #57308:
URL: https://github.com/apache/spark/pull/57308#discussion_r3614228032
##########
sql/connect/client/jvm/src/test/scala/org/apache/spark/sql/DataFrameSubquerySuite.scala:
##########
@@ -337,6 +337,15 @@ class DataFrameSubquerySuite extends QueryTest with
RemoteSparkSession {
.table("l")
.where($"l.a".isin(spark.table("r").select("c")) && $"l.a" > 2 &&
$"l.b".isNotNull),
sql("select * from l where l.a in (select c from r) and l.a > 2 and l.b
is not null"))
+
+ // SPARK-58165: a scalar subquery nested inside the IN subquery's values.
The nested
+ // SubqueryExpression must still contribute its plan to WithRelations;
otherwise the server
+ // fails with "Missing relation in WithRelations". Regression guard for
the Connect path.
+ checkAnswer(
+ spark
+ .table("l")
+
.where(spark.table("r").select(max($"c")).scalar().isin(spark.table("r").select($"c"))),
Review Comment:
Also optional, non-blocking (purely a general-robustness add): this test
case exercises only the non-correlated shape; select(max($"c")) is constant
across rows. A correlated variant would broaden coverage, e.g.:
```
spark.table("l").where(
spark.table("r").where($"c" === $"a".outer()).select(max($"d")).scalar()
.isin(spark.table("r").select($"c")))
```
--
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]