Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/20999#discussion_r216307940 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala --- @@ -293,6 +293,28 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging } } + /** + * Create a partition specification map with filters. + */ + override def visitDropPartitionSpec( + ctx: DropPartitionSpecContext): Seq[Expression] = { + withOrigin(ctx) { + ctx.dropPartitionVal().asScala.map { pFilter => + if (pFilter.identifier() == null || pFilter.constant() == null || + pFilter.comparisonOperator() == null) { + throw new ParseException(s"Invalid partition spec: ${pFilter.getText}", ctx) + } + // We cannot use UnresolvedAttribute because resolution is performed after Analysis, when + // running the command. The type is not relevant, it is replaced during the real resolution + val partition = + AttributeReference(pFilter.identifier().getText, StringType)() + val value = Literal(visitStringConstant(pFilter.constant())) --- End diff -- ok, thanks for the check. It's ok to keep the current one.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org