Github user mbasmanova commented on a diff in the pull request: https://github.com/apache/spark/pull/18421#discussion_r124448971 --- 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 -- I see. Thanks for pointing that out. Currently, this PR supports only exact partition spec. It doesn't support partial partition specs describing the document above. My preference would be to keep it simple for this PR and support only exact spec and add support for partial specs in a follow up PR. What do you think?
--- 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