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

    https://github.com/apache/spark/pull/5864#discussion_r30832932
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala ---
    @@ -760,7 +762,14 @@ private[hive] case class InsertIntoHiveTable(
       override def children: Seq[LogicalPlan] = child :: Nil
       override def output: Seq[Attribute] = child.output
     
    -  override lazy val resolved: Boolean = childrenResolved && 
child.output.zip(table.output).forall {
    +  val numDynamicPartitions = partition.values.count(_.isEmpty)
    +  val tableOutput = {
    +    val hiveTable = table.asInstanceOf[MetastoreRelation]
    +    (hiveTable.attributes ++ 
hiveTable.partitionKeys.takeRight(numDynamicPartitions))
    +      .take(child.output.length)
    --- End diff --
    
    Why a take here?  I haven't worked through it, but it seems possible that 
we are going to silently ignore the case where the number of columns doesn't 
line up.


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