Github user wzhfy commented on a diff in the pull request: https://github.com/apache/spark/pull/18421#discussion_r124703434 --- 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 -- If we first supports only exact partition spec, in the near future we will change (replace) the syntax and also the related implementation. I mean we are not doing it incrementally, so I prefer support the right syntax in this single pr. Would support that syntax require lots of work?
--- 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