MaxGekk commented on code in PR #41719:
URL: https://github.com/apache/spark/pull/41719#discussion_r1244917814
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1209,6 +1226,23 @@
],
"sqlState" : "22032"
},
+ "INVALID_LAMBDA_FUNCTION_CALL" : {
+ "message" : [
+ "Invalid lambda function call."
+ ],
+ "subClass" : {
+ "ARGUMENT_NAMES_EXISTS_SAME_SEMANTIC" : {
+ "message" : [
+ "Lambda function arguments should not have names that are
semantically the same."
Review Comment:
From my point of view, the message is overcomplicated. What does
`semantically` mean?
Let's make it more precise:
```suggestion
"The lambda function has duplicate arguments <args>. Please,
consider to rename the argument names or set <caseSensitiveConfig> to \"true\"."
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1209,6 +1226,23 @@
],
"sqlState" : "22032"
},
+ "INVALID_LAMBDA_FUNCTION_CALL" : {
+ "message" : [
+ "Invalid lambda function call."
+ ],
+ "subClass" : {
+ "ARGUMENT_NAMES_EXISTS_SAME_SEMANTIC" : {
Review Comment:
```suggestion
"DUPLICATE_ARG_NAMES" : {
```
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1197,6 +1192,28 @@
],
"sqlState" : "22003"
},
+ "INVALID_INLINE_TABLE" : {
+ "message" : [
+ "Invalid inline table."
+ ],
+ "subClass" : {
+ "CANNOT_EVALUATE_EXPRESSION_IN_INLINE_TABLE" : {
+ "message" : [
+ "Cannot evaluate the expression <expr> in inline table definition."
+ ]
+ },
+ "FAILED_SQL_EXPRESSION_EVALUATION" : {
+ "message" : [
+ "Failed to evaluate the SQL expression: <sqlExpr>. Please check your
syntax and ensure all required tables and columns are available."
+ ]
+ },
+ "INCOMPATIBLE_TYPES_IN_INLINE_TABLE" : {
+ "message" : [
+ "Incompatible types found in column <name> for inline table."
Review Comment:
```suggestion
"Found incompatible types in the column <colName> for inline
table."
```
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveInlineTables.scala:
##########
@@ -96,7 +96,7 @@ object ResolveInlineTables extends Rule[LogicalPlan] with
CastSupport with Alias
val inputTypes = column.map(_.dataType)
val tpe =
TypeCoercion.findWiderTypeWithoutStringPromotion(inputTypes).getOrElse {
table.failAnalysis(
- errorClass = "_LEGACY_ERROR_TEMP_2303",
+ errorClass =
"INVALID_INLINE_TABLE.INCOMPATIBLE_TYPES_IN_INLINE_TABLE",
messageParameters = Map("name" -> name))
Review Comment:
Is `name` an identifier? If so, wrap it by `toSQLId()`.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1197,6 +1192,28 @@
],
"sqlState" : "22003"
},
+ "INVALID_INLINE_TABLE" : {
+ "message" : [
+ "Invalid inline table."
+ ],
+ "subClass" : {
+ "CANNOT_EVALUATE_EXPRESSION_IN_INLINE_TABLE" : {
+ "message" : [
+ "Cannot evaluate the expression <expr> in inline table definition."
+ ]
+ },
+ "FAILED_SQL_EXPRESSION_EVALUATION" : {
+ "message" : [
+ "Failed to evaluate the SQL expression: <sqlExpr>. Please check your
syntax and ensure all required tables and columns are available."
Review Comment:
```suggestion
"Failed to evaluate the SQL expression <sqlExpr>. Please check
your syntax, and ensure all required tables and columns are available."
```
--
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]