spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhuai <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-8079] [SQL] Makes InsertIntoHadoopFsRel...
Date Wed, 03 Jun 2015 16:48:32 GMT
Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6612#discussion_r31643600
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/sources/commands.scala ---
    @@ -203,32 +204,38 @@ private[sql] case class InsertIntoHadoopFsRelation(
         }
     
         def writeRows(taskContext: TaskContext, iterator: Iterator[Row]): Unit = {
    -      writerContainer.executorSideSetup(taskContext)
    -
    -      val partitionProj = newProjection(codegenEnabled, partitionOutput, output)
    -      val dataProj = newProjection(codegenEnabled, dataOutput, output)
    -
    -      if (needsConversion) {
    -        val converter = CatalystTypeConverters.createToScalaConverter(dataSchema)
    -        while (iterator.hasNext) {
    -          val row = iterator.next()
    -          val partitionPart = partitionProj(row)
    -          val dataPart = dataProj(row)
    -          val convertedDataPart = converter(dataPart).asInstanceOf[Row]
    -          writerContainer.outputWriterForRow(partitionPart).write(convertedDataPart)
    -        }
    -      } else {
    -        val partitionSchema = StructType.fromAttributes(partitionOutput)
    -        val converter = CatalystTypeConverters.createToScalaConverter(partitionSchema)
    -        while (iterator.hasNext) {
    -          val row = iterator.next()
    -          val partitionPart = converter(partitionProj(row)).asInstanceOf[Row]
    -          val dataPart = dataProj(row)
    -          writerContainer.outputWriterForRow(partitionPart).write(dataPart)
    +      try {
    --- End diff --
    
    Comment in the code.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message