public class SharedWorkOptimizer extends Transform
Originally, this rule would find scan operators over the same table in the query plan and merge them if they met some preconditions.
TS TS TS | | -> / \ Op Op Op Op
Now the rule has been extended to find opportunities to other operators downstream, not only a single table scan. TS1 TS2 TS1 TS2 TS1 TS2 | | | | | | | RS | RS | RS \ / \ / -> \ / MapJoin MapJoin MapJoin | | / \ Op Op Op Op
If the extended version of the optimizer is enabled, it can go beyond a work boundary to find reutilization opportunities.
The optimization only works with the Tez execution engine.
| Modifier and Type | Class and Description |
|---|---|
static class |
SharedWorkOptimizer.Mode
SharedWorkOptimization strategy modes
|
| Constructor and Description |
|---|
SharedWorkOptimizer() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areMergeable(ParseContext pctx,
TableScanOperator tsOp1,
TableScanOperator tsOp2) |
protected void |
mergeSchema(TableScanOperator discardableTsOp,
TableScanOperator retainableTsOp) |
boolean |
sharedWorkOptimization(ParseContext pctx,
org.apache.hadoop.hive.ql.optimizer.SharedWorkOptimizer.SharedWorkOptimizerCache optimizerCache,
List<TableScanOperator> tableScans,
SharedWorkOptimizer.Mode mode,
boolean schemaMerge)
Class wrapping shared work optimizer.
|
ParseContext |
transform(ParseContext pctx)
All transformation steps implement this interface.
|
beginPerfLogging, endPerfLogging, endPerfLoggingpublic ParseContext transform(ParseContext pctx) throws SemanticException
Transformtransform in class Transformpctx - input parse contextSemanticExceptionpublic boolean sharedWorkOptimization(ParseContext pctx, org.apache.hadoop.hive.ql.optimizer.SharedWorkOptimizer.SharedWorkOptimizerCache optimizerCache, List<TableScanOperator> tableScans, SharedWorkOptimizer.Mode mode, boolean schemaMerge) throws SemanticException
TableScanDesc.getNeededColumns() and TableScanDesc.getNeededColumnIDs()
from both TableScanOperators.SemanticExceptionprotected boolean areMergeable(ParseContext pctx, TableScanOperator tsOp1, TableScanOperator tsOp2) throws SemanticException
SemanticExceptionprotected void mergeSchema(TableScanOperator discardableTsOp, TableScanOperator retainableTsOp)
Copyright © 2022 The Apache Software Foundation. All rights reserved.