Skip to content

Commit

Permalink
[SPARK-20283][SQL] Add preOptimizationBatches
Browse files Browse the repository at this point in the history
## What changes were proposed in this pull request?
We currently have postHocOptimizationBatches, but not preOptimizationBatches. This patch adds preOptimizationBatches so the optimizer debugging extensions are symmetric.

## How was this patch tested?
N/A

Author: Reynold Xin <[email protected]>

Closes apache#17595 from rxin/SPARK-20283.
  • Loading branch information
rxin authored and Mingjie Tang committed Apr 18, 2017
1 parent 9849af0 commit a50a1f5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,19 @@ class SparkOptimizer(
experimentalMethods: ExperimentalMethods)
extends Optimizer(catalog, conf) {

override def batches: Seq[Batch] = (super.batches :+
override def batches: Seq[Batch] = (preOptimizationBatches ++ super.batches :+
Batch("Optimize Metadata Only Query", Once, OptimizeMetadataOnlyQuery(catalog, conf)) :+
Batch("Extract Python UDF from Aggregate", Once, ExtractPythonUDFFromAggregate) :+
Batch("Prune File Source Table Partitions", Once, PruneFileSourcePartitions)) ++
postHocOptimizationBatches :+
Batch("User Provided Optimizers", fixedPoint, experimentalMethods.extraOptimizations: _*)

/**
* Optimization batches that are executed before the regular optimization batches (also before
* the finish analysis batch).
*/
def preOptimizationBatches: Seq[Batch] = Nil

/**
* Optimization batches that are executed after the regular optimization batches, but before the
* batch executing the [[ExperimentalMethods]] optimizer rules. This hook can be used to add
Expand Down

0 comments on commit a50a1f5

Please sign in to comment.