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


##########
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:
   Given there is already query context in the error message, are we sure about 
showing the logical plan as well? (This PR contains a lot of threads, I am not 
sure if this is discussed.)
   cc @srielau 



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