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

    https://github.com/apache/spark/pull/11509#discussion_r55252685
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/InsertIntoHadoopFsRelation.scala
 ---
    @@ -101,45 +111,28 @@ private[sql] case class InsertIntoHadoopFsRelation(
           job.setOutputValueClass(classOf[InternalRow])
           FileOutputFormat.setOutputPath(job, qualifiedOutputPath)
     
    -      // A partitioned relation schema's can be different from the input 
logicalPlan, since
    -      // partition columns are all moved after data column. We Project to 
adjust the ordering.
    -      // TODO: this belongs in the analyzer.
    -      val project = Project(
    -        relation.schema.map(field => 
UnresolvedAttribute.quoted(field.name)), query)
    -      val queryExecution = DataFrame(sqlContext, project).queryExecution
    +      val partitionSet = AttributeSet(partitionColumns)
    +      val dataColumns = query.output.filterNot(partitionSet.contains)
     
    +      val queryExecution = DataFrame(sqlContext, query).queryExecution
    --- End diff --
    
    Hmm yeah we should probably consolidate this code path.  Today we create a 
`DataFrame`, call `sqlContext.executePlan` and call `new QueryExecution 
Manually`.
    
    I'm going to leave this as it was, but it would be nice to have one way to 
do this.


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