You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/15 02:44:27 UTC

[GitHub] eatoncys commented on a change in pull request #23010: [SPARK-26012][SQL]Null and '' values should not cause dynamic partition failure of string types

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org