MaxGekk commented on code in PR #48188:
URL: https://github.com/apache/spark/pull/48188#discussion_r1769073332
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -2752,6 +2752,11 @@
"message" : [
"A type of keys and values in `map()` must be string, but got
<mapType>."
]
+ },
+ "NULL_VALUE" : {
+ "message" : [
+ "Values of keys and values in `map()` must be string, but got null
in value."
Review Comment:
Users can build values dynamically, and could be not clear which one is
`null`. Let's help them in troubleshooting, and provide `key` which has the
`null` value.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommand.scala:
##########
@@ -46,6 +46,10 @@ case class SaveIntoDataSourceCommand(
override def innerChildren: Seq[QueryPlan[_]] = Seq(query)
override def run(sparkSession: SparkSession): Seq[Row] = {
+ if (options.values.exists(_ == null)) {
Review Comment:
How about `keys`? Should we check them too?
##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -2752,6 +2752,11 @@
"message" : [
"A type of keys and values in `map()` must be string, but got
<mapType>."
]
+ },
+ "NULL_VALUE" : {
Review Comment:
How about to re-use the existing error condition: `NULL_DATA_SOURCE_OPTION`?
--
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]