dtenedor commented on code in PR #37840:
URL: https://github.com/apache/spark/pull/37840#discussion_r971345715


##########
sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out:
##########
@@ -317,11 +317,20 @@ SELECT * FROM t1, LATERAL (SELECT c1 + c2 + rand(0) AS c3)
 struct<>
 -- !query output
 org.apache.spark.sql.AnalysisException
-Non-deterministic lateral subqueries are not supported when joining with outer 
relations that produce more than one row
-SubqueryAlias __auto_generated_subquery_name
-+- Project [(cast((outer(c1#x) + outer(c2#x)) as double) + rand(0)) AS c3#x]
-   +- OneRowRelation
-; line 1 pos 9
+{
+  "errorClass" : "UNSUPPORTED_SUBQUERY_EXPRESSION_CATEGORY",
+  "errorSubClass" : "NON_DETERMINISTIC_LATERAL_SUBQUERIES",
+  "messageParameters" : {
+    "treeNode" : ": !LateralJoin lateral-subquery#5 [c1#6 && c2#7], Inner\n:  
+- SubqueryAlias __auto_generated_subquery_name\n:     +- Project 
[(cast((outer(c1#2) + outer(c2#3)) as double) + rand(0)) AS c3#4]\n:        +- 
OneRowRelation\n+- SubqueryAlias spark_catalog.default.t1\n   +- View 
(`spark_catalog`.`default`.`t1`, [c1#2,c2#3])\n      +- Project [cast(col1#0 as 
int) AS c1#2, cast(col2#1 as int) AS c2#3]\n         +- LocalRelation [col1#0, 
col2#1]\n"

Review Comment:
   Yes we did discuss this already in the PR threads :) I suggested eliding the 
plan strings given that we have the query context now, but some folks opined 
that the strings are helpful for debugging. In the end I struck a compromise by 
including the strings but covered by a new SQLConf to toggle their presence. 
This new config can remain enabled by default for now in Apache Spark so folks 
who are used to the strings for debugging may continue to use them.



-- 
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]

Reply via email to