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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1049,6 +1049,18 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
         "operation" -> operation))
   }
 
+  def functionAndOrderExpressionMismatchError(
+      functionName: String,
+      functionExpr: Expression,
+      orderExpr: Seq[SortOrder]): Throwable = {
+    new AnalysisException(
+      errorClass = "FUNCTION_AND_ORDER_EXPRESSION_MISMATCH",
+      messageParameters = Map(
+        "functionName" -> toSQLId(functionName),
+        "functionExpr" -> toSQLExpr(functionExpr),
+        "orderExpr" -> orderExpr.map(order => 
toSQLExpr(order.child)).mkString(",")))

Review Comment:
   ```suggestion
           "orderExpr" -> orderExpr.map(order => 
toSQLExpr(order.child)).mkString(", ")))
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -1563,6 +1563,12 @@
     ],
     "sqlState" : "42710"
   },
+  "FUNCTION_AND_ORDER_EXPRESSION_MISMATCH" : {
+    "message" : [
+      "The function <functionName> arguments <functionExpr> should match the 
order by expression <orderExpr> when use DISTINCT."

Review Comment:
   ```suggestion
         "The arguments <functionArgs> of the function <functionName> do not 
match to ordering within group <orderExpr> when use DISTINCT."
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1049,6 +1049,18 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
         "operation" -> operation))
   }
 
+  def functionAndOrderExpressionMismatchError(
+      functionName: String,
+      functionExpr: Expression,

Review Comment:
   ```suggestion
         functionArgs: Expression,
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/collect.scala:
##########
@@ -265,3 +271,239 @@ private[aggregate] object CollectTopK {
     case _ => throw QueryCompilationErrors.invalidNumParameter(e)
   }
 }
+
+@ExpressionDescription(
+  usage = "_FUNC_(expr) - Returns the concatenation of non-null input values," 
+

Review Comment:
   Could you describe arg: what the expression accepts and what returns. 
Please, add `arguments`



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