-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-21213][SQL] Support collecting partition-level statistics: rowCount and sizeInBytes #18421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5384f7a
3ee5ebf
d17aa4b
e0e351e
8dad9bc
4fdefd5
1d696c3
89c0767
7210568
9aa2a1e
fa21860
f76f49f
8f31f53
fae6d49
8880fbd
1053991
41ab30d
dc488e5
c839855
72e2cd5
87594d6
3353afa
8ffb140
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,30 +95,26 @@ class SparkSqlAstBuilder(conf: SQLConf) extends AstBuilder(conf) { | |
| * {{{ | ||
| * ANALYZE TABLE table COMPUTE STATISTICS [NOSCAN]; | ||
| * }}} | ||
| * Example SQL for analyzing a single partition : | ||
| * {{{ | ||
| * ANALYZE TABLE table PARTITION (key=value,..) COMPUTE STATISTICS [NOSCAN]; | ||
|
||
| * }}} | ||
| * Example SQL for analyzing columns : | ||
| * {{{ | ||
| * ANALYZE TABLE table COMPUTE STATISTICS FOR COLUMNS column1, column2; | ||
| * }}} | ||
| */ | ||
| override def visitAnalyze(ctx: AnalyzeContext): LogicalPlan = withOrigin(ctx) { | ||
| val noscan = if (ctx.identifier != null) { | ||
| if (ctx.identifier.getText.toLowerCase(Locale.ROOT) != "noscan") { | ||
| throw new ParseException(s"Expected `NOSCAN` instead of `${ctx.identifier.getText}`", ctx) | ||
| } | ||
| true | ||
| } else { | ||
| false | ||
| if (ctx.identifier != null && | ||
| ctx.identifier.getText.toLowerCase(Locale.ROOT) != "noscan") { | ||
| throw new ParseException(s"Expected `NOSCAN` instead of `${ctx.identifier.getText}`", ctx) | ||
| } | ||
|
||
|
|
||
| val partitionSpec = if (ctx.partitionSpec != null) { | ||
| Option(ctx.partitionSpec).map(visitNonOptionalPartitionSpec) | ||
| } else { | ||
| None | ||
| } | ||
| val partitionSpec = Option(ctx.partitionSpec).map(visitNonOptionalPartitionSpec) | ||
|
|
||
| val table = visitTableIdentifier(ctx.tableIdentifier) | ||
| if (ctx.identifierSeq() == null) { | ||
| AnalyzeTableCommand(table, noscan, partitionSpec) | ||
| AnalyzeTableCommand(table, noscan = ctx.identifier != null, partitionSpec) | ||
| } else { | ||
| if (partitionSpec.isDefined) { | ||
| logWarning(s"Partition specification is ignored: ${ctx.partitionSpec.getText}") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here.