MaxGekk commented on code in PR #41476:
URL: https://github.com/apache/spark/pull/41476#discussion_r1233250454


##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala:
##########
@@ -787,8 +787,70 @@ class AnalysisErrorSuite extends AnalysisTest {
     val error = intercept[AnalysisException] {
       SimpleAnalyzer.checkAnalysis(join)
     }
-    assert(error.message.contains("Failure when resolving conflicting 
references in Join"))
-    assert(error.message.contains("Conflicting attributes"))
+    checkError(
+      exception = error,
+      errorClass = "RESOLVED_PLAN_HAVE_CONFLICTING_ATTRS",
+      parameters = Map(
+        "nodeName" -> "Join",
+        "plan" -> "'Join Cross\n:- LocalRelation <empty>, [a#0]\n+- 
LocalRelation <empty>, [a#0]\n",
+        "conflictingAttributes" -> "\"a\""
+      )
+    )
+  }
+
+  test("error test for self-intersect") {
+    val intersect = Intersect(testRelation, testRelation, true)
+    val error = intercept[AnalysisException] {
+      SimpleAnalyzer.checkAnalysis(intersect)

Review Comment:
   I see but if you cannot trigger the error from user space, we should convert 
the error to an internal one.



##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/AnalysisErrorSuite.scala:
##########
@@ -787,8 +787,70 @@ class AnalysisErrorSuite extends AnalysisTest {
     val error = intercept[AnalysisException] {
       SimpleAnalyzer.checkAnalysis(join)
     }
-    assert(error.message.contains("Failure when resolving conflicting 
references in Join"))
-    assert(error.message.contains("Conflicting attributes"))
+    checkError(
+      exception = error,
+      errorClass = "RESOLVED_PLAN_HAVE_CONFLICTING_ATTRS",
+      parameters = Map(
+        "nodeName" -> "Join",
+        "plan" -> "'Join Cross\n:- LocalRelation <empty>, [a#0]\n+- 
LocalRelation <empty>, [a#0]\n",
+        "conflictingAttributes" -> "\"a\""
+      )
+    )
+  }
+
+  test("error test for self-intersect") {
+    val intersect = Intersect(testRelation, testRelation, true)
+    val error = intercept[AnalysisException] {
+      SimpleAnalyzer.checkAnalysis(intersect)

Review Comment:
   @beliefer Could you try to trigger it by from SQL.



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