ashutosh-jindal commented on code in PR #55441:
URL: https://github.com/apache/spark/pull/55441#discussion_r3434649761
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkSqlParser.scala:
##########
@@ -1480,6 +1480,33 @@ class SparkSqlAstBuilder extends AstBuilder {
}
}
+ /**
+ * A command for users to list the partition names of a table. If partition
spec is specified,
+ * only partitions that match the spec are returned. Otherwise all
partitions are returned.
+ *
+ * Without `AS JSON`, this creates a [[ShowPartitions]] logical plan (one
row per partition).
+ * With `AS JSON`, this creates a [[ShowPartitionsJsonCommand]] that returns
a single JSON
+ * document.
+ *
+ * The syntax of using this command in SQL is:
+ * {{{
+ * SHOW PARTITIONS multi_part_name [partition_spec] [AS JSON];
+ * }}}
+ */
+ override def visitShowPartitions(ctx: ShowPartitionsContext): LogicalPlan =
withOrigin(ctx) {
+ val asJson = ctx.JSON != null
Review Comment:
@cloud-fan Agreed. `visitShowPartitions` is back in `AstBuilder` and i have
reverted other corresponding changes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]