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

    https://github.com/apache/spark/pull/20999#discussion_r225074108
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
 ---
    @@ -382,6 +382,30 @@ case class OuterReference(e: NamedExpression)
       override def newInstance(): NamedExpression = 
OuterReference(e.newInstance())
     }
     
    +/**
    + * A place holder used to hold the name of the partition attributes 
specified when running commands
    + * involving partitions, eg. ALTER TABLE ... DROP PARTITIONS.
    + */
    +case class PartitioningAttribute(name: String)
    +  extends Attribute with Unevaluable {
    +  override val exprId: ExprId = NamedExpression.newExprId
    +  // Not really needed and used. We just need a dataType to be used during 
analysis for resolving
    +  // the expressions. The String type is used because all the literals in 
PARTITION operations are
    +  // parsed as strings and eventually casted later.
    +  override def dataType: DataType = StringType
    --- End diff --
    
    If it's not needed, can we throw exception here? We may need to override 
`toString` though.


---

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

Reply via email to