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

    https://github.com/apache/spark/pull/15995#discussion_r92099484
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ---
    @@ -128,61 +128,69 @@ case class DataSourceAnalysis(conf: CatalystConf) 
extends Rule[LogicalPlan] {
         projectList
       }
     
    +  private def hasBeenPreprocessed(
    +      tableOutput: Seq[Attribute],
    +      partSchema: StructType,
    +      partSpec: Map[String, Option[String]],
    +      query: LogicalPlan): Boolean = {
    +    val partColNames = partSchema.map(_.name).toSet
    +    query.resolved && partSpec.keys.forall(partColNames.contains) && {
    +      val staticPartCols = partSpec.filter(_._2.isDefined).keySet
    +      val expectedColumns = tableOutput.filterNot(a => 
staticPartCols.contains(a.name))
    +      expectedColumns.toStructType.sameType(query.schema)
    --- End diff --
    
    this is to follow the previous condition: 
https://github.com/apache/spark/pull/15995/files#diff-d99813bd5bbc18277e4090475e4944cfL166
    
    This can be caused if users issue an invalid command, e.g. `INSERT INTO src 
SELECT 1,2` while table `src` has 3 columns.


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

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

Reply via email to