Github user mbasmanova commented on a diff in the pull request: https://github.com/apache/spark/pull/18421#discussion_r124871491 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala --- @@ -239,18 +239,20 @@ class SparkSqlParserSuite extends AnalysisTest { AnalyzeTableCommand(TableIdentifier("t"), noscan = false)) assertEqual("analyze table t compute statistics noscan", AnalyzeTableCommand(TableIdentifier("t"), noscan = true)) - assertEqual("analyze table t partition (a) compute statistics nOscAn", + assertEqual("analyze table t compute statistics nOscAn", AnalyzeTableCommand(TableIdentifier("t"), noscan = true)) - // Partitions specified - we currently parse them but don't do anything with it + // Partitions specified assertEqual("ANALYZE TABLE t PARTITION(ds='2008-04-09', hr=11) COMPUTE STATISTICS", - AnalyzeTableCommand(TableIdentifier("t"), noscan = false)) + AnalyzeTableCommand(TableIdentifier("t"), noscan = false, + partitionSpec = Some(Map("ds" -> "2008-04-09", "hr" -> "11")))) assertEqual("ANALYZE TABLE t PARTITION(ds='2008-04-09', hr=11) COMPUTE STATISTICS noscan", - AnalyzeTableCommand(TableIdentifier("t"), noscan = true)) - assertEqual("ANALYZE TABLE t PARTITION(ds, hr) COMPUTE STATISTICS", - AnalyzeTableCommand(TableIdentifier("t"), noscan = false)) - assertEqual("ANALYZE TABLE t PARTITION(ds, hr) COMPUTE STATISTICS noscan", - AnalyzeTableCommand(TableIdentifier("t"), noscan = true)) + AnalyzeTableCommand(TableIdentifier("t"), noscan = true, + partitionSpec = Some(Map("ds" -> "2008-04-09", "hr" -> "11")))) + intercept("ANALYZE TABLE t PARTITION(ds, hr) COMPUTE STATISTICS", --- End diff -- @wzhfy, I expect syntax change to be quite small and incremental. Currently, it is necessary to specify all partition columns along with values. The change will be to allow only a subset of partition columns and allow partition columns without values. `PARTITION (partcol1=val1,...) -> PARTITION (partcol1[=val1],...)` That said, I want to try to allow partial partition specs in this PR. Let me spend some time on it and report back my findings.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org