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


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala:
##########
@@ -897,10 +897,9 @@ abstract class SQLViewSuite extends QueryTest with 
SQLTestUtils {
             val e = intercept[AnalysisException] {
               sql("SELECT * FROM v3")
             }.getMessage
-            assert(e.contains(
-              "expression 'spark_catalog.default.t.c1' is neither present " +
-              "in the group by, nor is it an aggregate function. Add to group 
by or wrap in " +
-              "first() (or first_value) if you don't care which value you 
get."))
+            assert(
+              e.contains("COLUMN_NOT_IN_GROUP_BY_CLAUSE") &&
+                e.contains("\"c1\""))

Review Comment:
   Could you use `checkError()`, please. See the check above.



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -65,6 +65,12 @@
     ],
     "sqlState" : "22005"
   },
+  "COLUMN_NOT_IN_GROUP_BY_CLAUSE" : {
+    "message" : [
+      "expression <expression> is neither present in the group by, nor is it 
an aggregate function. Add to group by or wrap in `first()` (or 
`first_value()`) if you don't care which value you get."

Review Comment:
   Usually, the error messages starts from an upper case char (see messages 
around):
   ```suggestion
         "The expression <expression> is neither present in the group by, nor 
is it an aggregate function. Add to group by or wrap in `first()` (or 
`first_value()`) if you don't care which value you get."
   ```



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