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


##########
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);

Review Comment:
   I can add a test. I don't think that will be triggered. If 
`spark_catalog.default.DISTINCT(c1, c2)` is registered, the analyzer will pass 
the query.
   
   This error will only be triggered when `spark_catalog.default.DISTINCT(c1, 
c2)` is not found. Literally analyzer found no way to explain this usage.



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