Github user mgaido91 commented on a diff in the pull request:
https://github.com/apache/spark/pull/19691#discussion_r191205128
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala
---
@@ -282,6 +282,26 @@ class AstBuilder(conf: SQLConf) extends
SqlBaseBaseVisitor[AnyRef] with Logging
parts.toMap
}
+ /**
+ * Create a partition filter specification.
+ */
+ def visitPartitionFilterSpec(ctx: PartitionSpecContext): Seq[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
+ case bc @ BinaryComparison(constant: Literal, _) =>
+ throw new ParseException("Literal " + constant
+ + " is supported only on the rigth-side.", ctx)
+ case _ =>
+ throw new ParseException("Invalid partition filter
specification", ctx)
--- End diff --
it would be useful to output to the user which expression was invalid and wh
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]