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

    https://github.com/apache/spark/pull/16269#discussion_r99578597
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
 ---
    @@ -374,25 +375,24 @@ case class BroadcastHint(child: LogicalPlan) extends 
UnaryNode {
      *                  Map('a' -> Some('1'), 'b' -> Some('2')),
      *                  and `INSERT INTO tbl PARTITION (a=1, b) AS ...`
      *                  would have Map('a' -> Some('1'), 'b' -> None).
    - * @param child the logical plan representing data to write to.
    + * @param query the logical plan representing data to write to.
      * @param overwrite overwrite existing table or partitions.
      * @param ifNotExists If true, only write if the table or partition does 
not exist.
      */
     case class InsertIntoTable(
         table: LogicalPlan,
         partition: Map[String, Option[String]],
    -    child: LogicalPlan,
    +    query: LogicalPlan,
         overwrite: Boolean,
         ifNotExists: Boolean)
       extends LogicalPlan {
    -
    -  override def children: Seq[LogicalPlan] = child :: Nil
    -  override def output: Seq[Attribute] = Seq.empty
    -
       assert(overwrite || !ifNotExists)
       assert(partition.values.forall(_.nonEmpty) || !ifNotExists)
     
    -  override lazy val resolved: Boolean = childrenResolved && table.resolved
    +  // We don't want `table` in children as sometimes we don't want to 
transform it.
    +  override def children: Seq[LogicalPlan] = query :: Nil
    +  override def output: Seq[Attribute] = Seq.empty
    +  override lazy val resolved: Boolean = false
    --- End diff --
    
    now we will resolve `CreateTable`, `InsertIntoTable` to concrete commands, 
so the check can still work.


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