allisonwang-db commented on code in PR #39759:
URL: https://github.com/apache/spark/pull/39759#discussion_r1110473587
##########
sql/core/src/test/resources/sql-tests/results/join-lateral.sql.out:
##########
@@ -1120,6 +1258,105 @@ struct<c1:int,c2:int,c2:int>
1 2 3
+-- !query
+SELECT * FROM t1 JOIN LATERAL
+ ((SELECT t2.c2
+ FROM t2
+ WHERE t2.c1 = t1.c1
+ EXCEPT DISTINCT
+ SELECT t4.c2
+ FROM t4
+ WHERE t4.c1 > t1.c2)
+ UNION DISTINCT
+ (SELECT t4.c1
+ FROM t4
+ WHERE t4.c1 <= t1.c2
+ INTERSECT ALL
+ SELECT t4.c2
+ FROM t4
+ WHERE t4.c1 <> t1.c1)
+)
+-- !query schema
+struct<c1:int,c2:int,c2:int>
+-- !query output
+0 1 1
+0 1 2
+0 1 3
+1 2 1
+
+
+-- !query
+SELECT * FROM t1 JOIN LATERAL
+ ((SELECT t2.c2
+ FROM t2
+ WHERE t2.c1 = t1.c1
+ UNION ALL
+ SELECT t4.c2
+ FROM t4
+ WHERE t4.c1 > t1.c2)
+ INTERSECT DISTINCT
+ (SELECT t4.c1
+ FROM t4
+ WHERE t4.c1 <= t1.c2
+ EXCEPT ALL
+ SELECT t4.c2
+ FROM t4
+ WHERE t4.c1 <> t1.c1)
+)
+-- !query schema
+struct<c1:int,c2:int,c2:int>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM t1 JOIN LATERAL (SELECT sum(c1) FROM
+ (SELECT *
+ FROM t2
+ WHERE t2.c1 <= t1.c1) lhs
+ LEFT SEMI JOIN
+ (SELECT *
+ FROM t4) rhs
+ ON lhs.c1 <=> rhs.c1 and lhs.c2 <=> rhs.c2
+)
+-- !query schema
+struct<c1:int,c2:int,sum(c1):bigint>
+-- !query output
+0 1 0
+1 2 0
+
+
+-- !query
+SELECT * FROM t1 JOIN LATERAL (SELECT sum(c1) FROM
+ (SELECT *
+ FROM t2
+ WHERE t2.c1 <= t1.c1) lhs
+ LEFT SEMI JOIN
+ (SELECT *
+ FROM t4
+ WHERE t4.c1 > t1.c2) rhs
+ ON lhs.c1 <=> rhs.c1 and lhs.c2 <=> rhs.c2
+)
+-- !query schema
+struct<>
+-- !query output
+org.apache.spark.sql.AnalysisException
+{
+ "errorClass" :
"UNSUPPORTED_SUBQUERY_EXPRESSION_CATEGORY.ACCESSING_OUTER_QUERY_COLUMN_IS_NOT_ALLOWED",
Review Comment:
Is this expected?
--
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]