Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/20999#discussion_r225101681
--- 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 --
Probably I should improve the comment then. it's misleading: this is
actually needed because otherwise we may hit exceptions since the `dataType` is
checked when running `checkInputDataTypes` of the comparison operator
containing it. I'll improve the comment.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]