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

    https://github.com/apache/spark/pull/758#discussion_r12598841
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveOperators.scala ---
    @@ -143,20 +185,35 @@ case class HiveTableScan(
       }
     
       def execute() = {
    -    inputRdd.map { row =>
    -      val values = row match {
    -        case Array(deserializedRow: AnyRef, partitionKeys: Array[String]) 
=>
    -          attributeFunctions.map(_(deserializedRow, partitionKeys))
    -        case deserializedRow: AnyRef =>
    -          attributeFunctions.map(_(deserializedRow, Array.empty))
    +    inputRdd.mapPartitions { iterator =>
    +      if (iterator.isEmpty) {
    +        Iterator.empty
    +      } else {
    +        val mutableRow = new GenericMutableRow(attributes.length)
    +        val buffered = iterator.buffered
    +        val rowsAndPartitionKeys = buffered.head match {
    +          case Array(_, _) =>
    +            buffered.map { case Array(deserializedRow, partitionKeys: 
Array[String]) =>
    +              (deserializedRow, partitionKeys)
    --- End diff --
    
    Can we use mutable pair instead?


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

Reply via email to