eatoncys commented on a change in pull request #23010: [SPARK-26012][SQL]Null 
and '' values should not cause dynamic partition failure of string types
URL: https://github.com/apache/spark/pull/23010#discussion_r247748156
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/FileFormatDataWriter.scala
 ##########
 @@ -169,7 +182,13 @@ class DynamicPartitionDataWriter(
 
   /** Extracts the partition values out of an input row. */
   private lazy val getPartitionValues: InternalRow => UnsafeRow = {
-    val proj = UnsafeProjection.create(description.partitionColumns, 
description.allColumns)
+    val partitionExpression =
+      toBoundExprs(description.partitionColumns, description.allColumns).map {
+        case e: Expression if e.dataType == StringType =>
+          Empty2Null(e)
 
 Review comment:
   @cloud-fan Thanks for review, I have moved it before sort, 
`PartitionColumns` isretained because it is used to calculate `getPartitionPath`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to