You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mgaido91 <gi...@git.apache.org> on 2018/05/23 10:54:05 UTC
[GitHub] spark pull request #19691: [SPARK-14922][SPARK-17732][SQL]ALTER TABLE DROP P...
Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19691#discussion_r190203697
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala ---
@@ -282,6 +282,27 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging
parts.toMap
}
+ /**
+ * Create a partition filter specification.
+ */
+ def visitPartitionFilterSpec(ctx: PartitionSpecContext): Expression = withOrigin(ctx) {
+ val parts = ctx.expression.asScala.map { pVal =>
+ expression(pVal) match {
+ case EqualNullSafe(_, _) =>
+ throw new ParseException("'<=>' operator is not allowed in partition specification.", ctx)
+ case cmp @ BinaryComparison(UnresolvedAttribute(name :: Nil), constant: Literal) =>
+ cmp.withNewChildren(Seq(AttributeReference(name, StringType)(), constant))
+ case _ =>
+ throw new ParseException("Invalid partition filter specification", ctx)
+ }
+ }
+ if(parts.isEmpty) {
--- End diff --
why aren't we returning `parts`? this if seems pretty useless
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org