viirya commented on a change in pull request #32179:
URL: https://github.com/apache/spark/pull/32179#discussion_r613718644



##########
File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala
##########
@@ -767,4 +767,19 @@ class AnalysisErrorSuite extends AnalysisTest {
       "using ordinal position or wrap it in first() (or first_value) if you 
don't care " +
       "which value you get." :: Nil)
   }
+
+  test("SPARK-35080: Unsupported correlated equality predicates in subquery") {
+    val a = AttributeReference("a", IntegerType)()
+    val b = AttributeReference("b", IntegerType)()
+    val c = AttributeReference("c", IntegerType)()
+    val t1 = LocalRelation(a, b)
+    val t2 = LocalRelation(c)
+    val plan = Project(
+      ScalarSubquery(
+        Aggregate(Nil, count(Literal(1)).as("cnt") :: Nil,
+          Filter($"a" + $"b" === $"c", t1))
+      ).as("sub") :: Nil,
+      t2)
+    assertAnalysisError(plan, "Correlated column is not allowed in a 
non-equality predicate" :: Nil)

Review comment:
       do we also need to update the error message?




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

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