You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/06/30 09:38:41 UTC
[GitHub] [spark] MaxGekk commented on a diff in pull request #41788: [SPARK-44244][SQL] Assign names to the error class _LEGACY_ERROR_TEMP_[2305-2309]
MaxGekk commented on code in PR #41788:
URL: https://github.com/apache/spark/pull/41788#discussion_r1247661243
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -1787,11 +1787,11 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
e.references.filter(!_.resolved).foreach { a =>
// Note: This will throw error only on unresolved attribute issues,
// not other resolution errors like mismatched data types.
- val cols = p.inputSet.toSeq.map(_.sql).mkString(", ")
+ val cols = p.inputSet.toSeq.map(toSQLExpr(_)).mkString(", ")
Review Comment:
This is a set of ids, please, use `toSQLId()`
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala:
##########
@@ -2083,9 +2083,9 @@ class Analyzer(override val catalogManager: CatalogManager) extends RuleExecutor
// Checks if the number of the aliases is equal to expected one
if (u.outputNames.size != outputAttrs.size) {
u.failAnalysis(
- errorClass = "_LEGACY_ERROR_TEMP_2307",
+ errorClass = "NUM_TABLE_VALUE_ALIASES_MISMATCH",
messageParameters = Map(
- "funcName" -> u.name.quoted,
+ "funcName" -> toSQLId(u.name.quoted),
Review Comment:
toSQLId() does quoting already, why do you invoke `quoted`?
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -2250,6 +2265,11 @@
},
"sqlState" : "42703"
},
+ "UNRESOLVED_EXPRESSION_IN_MERGE_COMMAND_COLUMNS" : {
+ "message" : [
+ "Cannot resolve <expr> in MERGE command given columns [<cols>]."
Review Comment:
```suggestion
"Cannot resolve <expr> in the MERGE command. Did you mean one of the following? [<proposal>]."
```
BTW, cannot your re-use the existing error class? `UNRESOLVED_COLUMN.WITH_SUGGESTION`?
##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -1236,6 +1241,11 @@
"The lambda function has duplicate arguments <args>. Please, consider to rename the argument names or set <caseSensitiveConfig> to \"true\"."
]
},
+ "NON_HIGHER_ORDER_FUNCTION_UNSUPPORTED" : {
Review Comment:
Let's make it shorter: `NON_HIGHER_ORDER_FUNCTION`
--
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