Github user liancheng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7331#discussion_r34402814
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala ---
    @@ -507,23 +506,36 @@ private[sql] class DynamicPartitionWriterContainer(
         outputWriters = new java.util.HashMap[String, OutputWriter]
       }
     
    -  override def outputWriterForRow(row: Row): OutputWriter = {
    -    // TODO (SPARK-8888): zip and all the stuff happening here is very 
inefficient.
    -    val partitionPath = partitionColumns.zip(row.toSeq).map { case (col, 
rawValue) =>
    -      val string = if (rawValue == null) null else String.valueOf(rawValue)
    -      val valueString = if (string == null || string.isEmpty) {
    -        defaultPartitionName
    -      } else {
    -        PartitioningUtils.escapePathName(string)
    +  // The `row` argument is supposed to only contain partition column 
values which have been casted
    +  // to strings.
    +  override def outputWriterForRow(row: InternalRow): OutputWriter = {
    +    val partitionPath = {
    +      val partitionPathBuilder = new StringBuilder
    +      var i = 0
    +
    +      while (i < partitionColumns.length) {
    +        val col = partitionColumns(i)
    +        val partitionValueString = {
    +          val string = row.getString(i)
    --- End diff --
    
    It's already casted to string [here] [1].
    
    [1]: 
https://github.com/apache/spark/pull/7331/files#diff-5c7d283b2f533b6f491dd1845dd86797R244


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to