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

    https://github.com/apache/spark/pull/19691#discussion_r191823358
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
 ---
    @@ -293,6 +313,15 @@ class AstBuilder(conf: SQLConf) extends 
SqlBaseBaseVisitor[AnyRef] with Logging
         }
       }
     
    +  /**
    +   * Create a partition specification map without optional values
    +   * and a partition filter specification.
    +   */
    +  protected def visitPartition(
    --- End diff --
    
    I tried to add a new parameter to `AlterTableDropPartitionCommand` earlier, 
but it was kind hard. 
    thinking about a sql below:
    
    `DROP PARTITION(partitionVal1, expression1), PARTITION(partitionVal2, 
expression2)`
    
    all of the partitions need to be dropped are:
    (`partitionVal1` <b>intersect</b> `expression1`) <b>union</b> 
(`partitionVal2` <b>intersect</b> `expression2`)
    
    using one tuple is to telling us that the `partitionVal1` and `expression1` 
are from the same `partitionSpec` and we should use `intersect`.
    Also, different tuples means (`partitionVal1 intersect expression1`) and 
(`partitionVal2 intersect expression2`) are from different `partitionSpec` and 
we should use `union`.
    
    if we don't use tuple, it's would be difficult to tell the different 
occasions and it would be difficult to decide between `intersect` and `union` 
when `partitionVal1` meet `expression1`/`expression2`
    
    Any ideas to replace this `tuple`?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to