Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23262#discussion_r240180713
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ---
    @@ -416,7 +416,12 @@ case class DataSourceStrategy(conf: SQLConf) extends 
Strategy with Logging with
           output: Seq[Attribute],
           rdd: RDD[Row]): RDD[InternalRow] = {
         if (relation.relation.needConversion) {
    -      execution.RDDConversions.rowToRowRdd(rdd, output.map(_.dataType))
    +      val converters = RowEncoder(StructType.fromAttributes(output))
    +      rdd.mapPartitions { iterator =>
    +        iterator.map { r =>
    --- End diff --
    
    nit: `iterator.map(converters.toRow)`


---

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

Reply via email to