MaxGekk commented on code in PR #41429:
URL: https://github.com/apache/spark/pull/41429#discussion_r1243178821
##########
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/parser/ExpressionParserSuite.scala:
##########
@@ -329,6 +330,27 @@ class ExpressionParserSuite extends AnalysisTest {
parameters = Map("error" -> "'x'", "hint" -> ": extra input 'x'"))
}
+ test("function expressions with named arguments") {
+ assertEqual("encode(value => 'abc', charset => 'utf-8')",
+ $"encode".function(NamedArgumentExpression("value", Literal("abc")),
+ NamedArgumentExpression("charset", Literal("utf-8"))))
+ assertEqual("encode('abc', charset => 'utf-8')",
+ $"encode".function(Literal("abc"),
+ NamedArgumentExpression("charset", Literal("utf-8"))))
Review Comment:
Please, fix indentation here and below as you did above.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -1659,6 +1659,11 @@
"Not allowed to implement multiple UDF interfaces, UDF class
<className>."
]
},
+ "NAMED_ARGUMENTS_SUPPORT_DISABLED" : {
+ "message" : [
+ "Cannot call function <functionName> because named argument references
are not enabled here. In this case, the named argument reference was
<argument>. Set spark.sql.allowNamedFunctionArguments to true to turn on
feature."
Review Comment:
Could you quote the config name and its value at the functions
`toSQLConf()`/`toSQLConfVal` do.
```suggestion
"Cannot call function <functionName> because named argument references
are not enabled here. In this case, the named argument reference was
<argument>. Set \"spark.sql.allowNamedFunctionArguments\" to \"true\" to turn
on feature."
```
--
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]