You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/02 17:34:08 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #37750: [SPARK-40296] Error class for DISTINCT function not found

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


##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -4473,6 +4473,16 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
       sql("select * from test_temp_view"),
       Row(1, 2, 3, 1, 2, 3, 1, 1))
   }
+
+  test("SPARK-40296: DISTINCT function not found") {
+    val e = intercept[AnalysisException] {
+      sql(
+        """
+          |SELECT SUM(c1), DISTINCT(c1, c2) FROM VALUES(1, 2), (2, 2), (1, 2) AS T(c1, c2);
+          |""".stripMargin)
+    }
+    assert(e.message.contains("The function `DISTINCT` does not exist in the current schema"))

Review Comment:
   Please, use `checkError()`.



##########
sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala:
##########
@@ -4473,6 +4473,16 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
       sql("select * from test_temp_view"),
       Row(1, 2, 3, 1, 2, 3, 1, 1))
   }
+
+  test("SPARK-40296: DISTINCT function not found") {

Review Comment:
   Could you move the test to QueryCompilationErrorsSuite, please.



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org