srielau commented on code in PR #39061:
URL: https://github.com/apache/spark/pull/39061#discussion_r1048617462


##########
core/src/main/resources/error/error-classes.json:
##########
@@ -496,6 +496,11 @@
     ],
     "sqlState" : "42000"
   },
+  "GROUPING_EXPRESSIONS_NOT_FOUND" : {
+    "message" : [
+      "Not found any GROUP BY expressions, and <sqlExpr> is not an aggregate 
function. Wrap <aggExprs> by windowing function(s) or wrap <sqlExpr> by 
`first()` (or `first_value()`) if you don't care which value you get."
+    ]
+  },

Review Comment:
   What is more likely? The user forgot the GROUP BY clause, the user forgot to 
aggregate the expression, or they meant to use window functions? My money is on 
forgetting the GROUP BY clause....
   How about:
   GROUPING_EXPRESSION_WITHOUT_GROUP_BY
   The query including grouping expression \<groupingExpr\> and aggregate 
expressions \<aggExprs\> does not include a GROUP BY clause. Add "GROUP BY 
\<groupingExpr\>", aggregate \<groupingExpr\>, or turn the \<aggExprs\> into 
window functions using OVER clauses.  



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