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

    https://github.com/apache/spark/pull/4697#discussion_r25457171
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetTableOperations.scala
 ---
    @@ -144,19 +144,33 @@ case class ParquetTableScan(
             new Iterator[Row] {
               def hasNext = iter.hasNext
               def next() = {
    -            val row = iter.next()._2.asInstanceOf[SpecificMutableRow]
    +            iter.next()._2 match {
    +              case row: SpecificMutableRow => {
     
    -            // Parquet will leave partitioning columns empty, so we fill 
them in here.
    +              // Parquet will leave partitioning columns empty, so we fill 
them in here.
                 var i = 0
                 while (i < requestedPartitionOrdinals.size) {
    -              row(requestedPartitionOrdinals(i)._2) =
    -                partitionRowValues(requestedPartitionOrdinals(i)._1)
    +              row (requestedPartitionOrdinals (i)._2) =
    +              partitionRowValues (requestedPartitionOrdinals (i)._1)
                   i += 1
                 }
                 row
    +            }
    +              case row : Row => {
    +                val rVals = row.to[Array]
    +                var i = 0
    +                while (i < requestedPartitionOrdinals.size) {
    +                  rVals
    +                    .update(
    +                      requestedPartitionOrdinals (i)._2,
    +                      partitionRowValues (requestedPartitionOrdinals 
(i)._1))
    +                  i += 1
    +                }
    +                Row.fromSeq(rVals)
    +              }
               }
             }
    -      }
    +      }}
    --- End diff --
    
    For indentation and whitespace related styling, please refer to equivalent 
changes in #4792.


---
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