forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-35544][SQL] Add tree pattern pruning to Analyzer rules
### What changes were proposed in this pull request? Added the following TreePattern enums: - AGGREGATE_EXPRESSION - ALIAS - GROUPING_ANALYTICS - GENERATOR - HIGH_ORDER_FUNCTION - LAMBDA_FUNCTION - NEW_INSTANCE - PIVOT - PYTHON_UDF - TIME_WINDOW - TIME_ZONE_AWARE_EXPRESSION - UP_CAST - COMMAND - EVENT_TIME_WATERMARK - UNRESOLVED_RELATION - WITH_WINDOW_DEFINITION - UNRESOLVED_ALIAS - UNRESOLVED_ATTRIBUTE - UNRESOLVED_DESERIALIZER - UNRESOLVED_ORDINAL - UNRESOLVED_FUNCTION - UNRESOLVED_HINT - UNRESOLVED_SUBQUERY_COLUMN_ALIAS - UNRESOLVED_FUNC Added tree pattern pruning to the following Analyzer rules: - ResolveBinaryArithmetic - WindowsSubstitution - ResolveAliases - ResolveGroupingAnalytics - ResolvePivot - ResolveOrdinalInOrderByAndGroupBy - LookupFunction - ResolveSubquery - ResolveSubqueryColumnAliases - ApplyCharTypePadding - UpdateOuterReferences - ResolveCreateNamedStruct - TimeWindowing - CleanupAliases - EliminateUnions - EliminateSubqueryAliases - HandleAnalysisOnlyCommand - ResolveNewInstances - ResolveUpCast - ResolveDeserializer - ResolveOutputRelation - ResolveEncodersInUDF - HandleNullInputsForUDF - ResolveGenerate - ExtractGenerator - GlobalAggregates - ResolveAggregateFunctions ### Why are the changes needed? Reduce the number of tree traversals and hence improve the query compilation latency. ### How was this patch tested? Existing tests. Performance diff: <google-sheets-html-origin><style type="text/css"></style> | Baseline | Experiment | Experiment/Baseline -- | -- | -- | -- ResolveBinaryArithmetic | 43264874 | 34707117 | 0.80 WindowsSubstitution | 3322996 | 2734192 | 0.82 ResolveAliases | 24859263 | 21359941 | 0.86 ResolveGroupingAnalytics | 39249143 | 25417569 | 0.80 ResolvePivot | 6393408 | 2843314 | 0.44 ResolveOrdinalInOrderByAndGroupBy | 10750806 | 3386715 | 0.32 LookupFunction | 22087384 | 15481294 | 0.70 ResolveSubquery | 1129139340 | 944402323 | 0.84 ResolveSubqueryColumnAliases | 5055038 | 2808210 | 0.56 ApplyCharTypePadding | 76285576 | 63785681 | 0.84 UpdateOuterReferences | 6548321 | 3092539 | 0.47 ResolveCreateNamedStruct | 38111477 | 17350249 | 0.46 TimeWindowing | 41694190 | 3739134 | 0.09 CleanupAliases | 48683506 | 39584921 | 0.81 EliminateUnions | 3405069 | 2372506 | 0.70 EliminateSubqueryAliases | 9626649 | 9518216 | 0.99 HandleAnalysisOnlyCommand | 2562123 | 2661432 | 1.04 ResolveNewInstances | 16208966 | 1982314 | 0.12 ResolveUpCast | 14067843 | 1868615 | 0.13 ResolveDeserializer | 17991103 | 2320308 | 0.13 ResolveOutputRelation | 5815277 | 2088787 | 0.36 ResolveEncodersInUDF | 14182892 | 1045113 | 0.07 HandleNullInputsForUDF | 19850838 | 1329528 | 0.07 ResolveGenerate | 5587345 | 1953192 | 0.35 ExtractGenerator | 120378046 | 3386286 | 0.03 GlobalAggregates | 16510455 | 13553155 | 0.82 ResolveAggregateFunctions | 1041848509 | 828049280 | 0.79 </google-sheets-html-origin> Closes apache#32686 from sigmod/analyzer. Authored-by: Yingyi Bu <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
- Loading branch information
1 parent
73d4f67
commit 1dd0ca2
Showing
30 changed files
with
188 additions
and
72 deletions.
There are no files selected for viewing
99 changes: 56 additions & 43 deletions
99
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.