org.apache.hadoop.hive.ql.parse
Class ParseContext

java.lang.Object
  extended by org.apache.hadoop.hive.ql.parse.ParseContext

public class ParseContext
extends Object

Parse Context: The current parse context. This is passed to the optimizer which then transforms the operator tree using the parse context. All the optimizations are performed sequentially and then the new parse context populated. Note that since the parse context contains the operator tree, it can be easily retrieved by the next optimization step or finally for task generation after the plan has been completely optimized.


Constructor Summary
ParseContext()
           
ParseContext(HiveConf conf, QB qb, ASTNode ast, HashMap<TableScanOperator,ExprNodeDesc> opToPartPruner, HashMap<TableScanOperator,PrunedPartitionList> opToPartList, HashMap<String,Operator<? extends OperatorDesc>> topOps, HashMap<String,Operator<? extends OperatorDesc>> topSelOps, LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx, Map<JoinOperator,QBJoinTree> joinContext, HashMap<TableScanOperator,Table> topToTable, List<LoadTableDesc> loadTableWork, List<LoadFileDesc> loadFileWork, Context ctx, HashMap<String,String> idToTableNameMap, int destTableId, UnionProcContext uCtx, List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer, Map<GroupByOperator,Set<String>> groupOpToInputTables, Map<String,PrunedPartitionList> prunedPartitions, HashMap<TableScanOperator,FilterDesc.sampleDesc> opToSamplePruner, GlobalLimitCtx globalLimitCtx, HashMap<String,SplitSample> nameToSplitSample, HashSet<ReadEntity> semanticInputs, List<Task<? extends Serializable>> rootTasks, Map<TableScanOperator,Map<String,ExprNodeDesc>> opToPartToSkewedPruner)
           
 
Method Summary
 HiveConf getConf()
           
 Context getContext()
           
 int getDestTableId()
           
 FetchTask getFetchTask()
           
 GlobalLimitCtx getGlobalLimitCtx()
           
 Map<GroupByOperator,Set<String>> getGroupOpToInputTables()
           
 boolean getHasNonPartCols()
          Gets the value of the hasNonPartCols flag.
 HashMap<String,String> getIdToTableNameMap()
           
 Map<JoinOperator,QBJoinTree> getJoinContext()
           
 LineageInfo getLineageInfo()
          Gets the associated lineage information.
 List<AbstractMapJoinOperator<? extends MapJoinDesc>> getListMapJoinOpsNoReducer()
           
 List<LoadFileDesc> getLoadFileWork()
           
 List<LoadTableDesc> getLoadTableWork()
           
 Map<MapJoinOperator,QBJoinTree> getMapJoinContext()
           
 HashMap<String,SplitSample> getNameToSplitSample()
           
 LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> getOpParseCtx()
           
 HashMap<TableScanOperator,PrunedPartitionList> getOpToPartList()
           
 HashMap<TableScanOperator,ExprNodeDesc> getOpToPartPruner()
           
 Map<TableScanOperator,Map<String,ExprNodeDesc>> getOpToPartToSkewedPruner()
           
 HashMap<TableScanOperator,FilterDesc.sampleDesc> getOpToSamplePruner()
           
 ASTNode getParseTree()
           
 Map<String,PrunedPartitionList> getPrunedPartitions()
           
 PrunedPartitionList getPrunedPartitions(String alias, TableScanOperator ts)
           
 QB getQB()
           
 HashSet<ReadEntity> getSemanticInputs()
           
 HashMap<String,Operator<? extends OperatorDesc>> getTopOps()
           
 HashMap<String,Operator<? extends OperatorDesc>> getTopSelOps()
           
 HashMap<TableScanOperator,Table> getTopToTable()
           
 UnionProcContext getUCtx()
           
 void replaceRootTask(Task<? extends Serializable> rootTask, List<? extends Task<? extends Serializable>> tasks)
           
 void setConf(HiveConf conf)
           
 void setContext(Context ctx)
           
 void setDestTableId(int destTableId)
           
 void setFetchTask(FetchTask fetchTask)
           
 void setGlobalLimitCtx(GlobalLimitCtx globalLimitCtx)
           
 void setGroupOpToInputTables(Map<GroupByOperator,Set<String>> groupOpToInputTables)
           
 void setHasNonPartCols(boolean val)
          Sets the hasNonPartCols flag.
 void setIdToTableNameMap(HashMap<String,String> idToTableNameMap)
           
 void setJoinContext(Map<JoinOperator,QBJoinTree> joinContext)
           
 void setLineageInfo(LineageInfo lInfo)
          Sets the lineage information.
 void setListMapJoinOpsNoReducer(List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer)
           
 void setLoadFileWork(List<LoadFileDesc> loadFileWork)
           
 void setLoadTableWork(List<LoadTableDesc> loadTableWork)
           
 void setMapJoinContext(Map<MapJoinOperator,QBJoinTree> mapJoinContext)
           
 void setNameToSplitSample(HashMap<String,SplitSample> nameToSplitSample)
           
 void setOpParseCtx(LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)
           
 void setOpPartToSkewedPruner(HashMap<TableScanOperator,Map<String,ExprNodeDesc>> opToPartToSkewedPruner)
           
 void setOpToPartList(HashMap<TableScanOperator,PrunedPartitionList> opToPartList)
           
 void setOpToPartPruner(HashMap<TableScanOperator,ExprNodeDesc> opToPartPruner)
           
 void setOpToSamplePruner(HashMap<TableScanOperator,FilterDesc.sampleDesc> opToSamplePruner)
           
 void setParseTree(ASTNode ast)
           
 void setPrunedPartitions(Map<String,PrunedPartitionList> prunedPartitions)
           
 void setQB(QB qb)
           
 void setTopOps(HashMap<String,Operator<? extends OperatorDesc>> topOps)
           
 void setTopSelOps(HashMap<String,Operator<? extends OperatorDesc>> topSelOps)
           
 void setTopToTable(HashMap<TableScanOperator,Table> topToTable)
           
 void setUCtx(UnionProcContext uCtx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseContext

public ParseContext()

ParseContext

public ParseContext(HiveConf conf,
                    QB qb,
                    ASTNode ast,
                    HashMap<TableScanOperator,ExprNodeDesc> opToPartPruner,
                    HashMap<TableScanOperator,PrunedPartitionList> opToPartList,
                    HashMap<String,Operator<? extends OperatorDesc>> topOps,
                    HashMap<String,Operator<? extends OperatorDesc>> topSelOps,
                    LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx,
                    Map<JoinOperator,QBJoinTree> joinContext,
                    HashMap<TableScanOperator,Table> topToTable,
                    List<LoadTableDesc> loadTableWork,
                    List<LoadFileDesc> loadFileWork,
                    Context ctx,
                    HashMap<String,String> idToTableNameMap,
                    int destTableId,
                    UnionProcContext uCtx,
                    List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer,
                    Map<GroupByOperator,Set<String>> groupOpToInputTables,
                    Map<String,PrunedPartitionList> prunedPartitions,
                    HashMap<TableScanOperator,FilterDesc.sampleDesc> opToSamplePruner,
                    GlobalLimitCtx globalLimitCtx,
                    HashMap<String,SplitSample> nameToSplitSample,
                    HashSet<ReadEntity> semanticInputs,
                    List<Task<? extends Serializable>> rootTasks,
                    Map<TableScanOperator,Map<String,ExprNodeDesc>> opToPartToSkewedPruner)
Parameters:
conf -
qb - current QB
ast - current parse tree
opToPartPruner - map from table scan operator to partition pruner
opToPartList -
topOps - list of operators for the top query
topSelOps - list of operators for the selects introduced for column pruning
opParseCtx - operator parse context - contains a mapping from operator to operator parse state (row resolver etc.)
joinContext - context needed join processing (map join specifically)
topToTable - the top tables being processed
loadTableWork - list of destination tables being loaded
loadFileWork - list of destination files being loaded
ctx - parse context
idToTableNameMap -
uCtx -
destTableId -
listMapJoinOpsNoReducer - list of map join operators with no reducer
groupOpToInputTables -
prunedPartitions -
opToSamplePruner - operator to sample pruner map
globalLimitCtx -
nameToSplitSample -
rootTasks -
Method Detail

getQB

public QB getQB()
Returns:
the qb

setQB

public void setQB(QB qb)
Parameters:
qb - the qb to set

getContext

public Context getContext()
Returns:
the context

setContext

public void setContext(Context ctx)
Parameters:
ctx - the context to set

getConf

public HiveConf getConf()
Returns:
the hive conf

setConf

public void setConf(HiveConf conf)
Parameters:
conf - the conf to set

getParseTree

public ASTNode getParseTree()
Returns:
the ast

setParseTree

public void setParseTree(ASTNode ast)
Parameters:
ast - the parsetree to set

getOpToPartPruner

public HashMap<TableScanOperator,ExprNodeDesc> getOpToPartPruner()
Returns:
the opToPartPruner

setOpToPartPruner

public void setOpToPartPruner(HashMap<TableScanOperator,ExprNodeDesc> opToPartPruner)
Parameters:
opToPartPruner - the opToPartPruner to set

getOpToPartList

public HashMap<TableScanOperator,PrunedPartitionList> getOpToPartList()

setOpToPartList

public void setOpToPartList(HashMap<TableScanOperator,PrunedPartitionList> opToPartList)

getTopToTable

public HashMap<TableScanOperator,Table> getTopToTable()
Returns:
the topToTable

setTopToTable

public void setTopToTable(HashMap<TableScanOperator,Table> topToTable)
Parameters:
topToTable - the topToTable to set

getTopOps

public HashMap<String,Operator<? extends OperatorDesc>> getTopOps()
Returns:
the topOps

setTopOps

public void setTopOps(HashMap<String,Operator<? extends OperatorDesc>> topOps)
Parameters:
topOps - the topOps to set

getTopSelOps

public HashMap<String,Operator<? extends OperatorDesc>> getTopSelOps()
Returns:
the topSelOps

setTopSelOps

public void setTopSelOps(HashMap<String,Operator<? extends OperatorDesc>> topSelOps)
Parameters:
topSelOps - the topSelOps to set

getOpParseCtx

public LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> getOpParseCtx()
Returns:
the opParseCtx

setOpParseCtx

public void setOpParseCtx(LinkedHashMap<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx)
Parameters:
opParseCtx - the opParseCtx to set

getNameToSplitSample

public HashMap<String,SplitSample> getNameToSplitSample()

setNameToSplitSample

public void setNameToSplitSample(HashMap<String,SplitSample> nameToSplitSample)

getLoadTableWork

public List<LoadTableDesc> getLoadTableWork()
Returns:
the loadTableWork

setLoadTableWork

public void setLoadTableWork(List<LoadTableDesc> loadTableWork)
Parameters:
loadTableWork - the loadTableWork to set

getLoadFileWork

public List<LoadFileDesc> getLoadFileWork()
Returns:
the loadFileWork

setLoadFileWork

public void setLoadFileWork(List<LoadFileDesc> loadFileWork)
Parameters:
loadFileWork - the loadFileWork to set

getIdToTableNameMap

public HashMap<String,String> getIdToTableNameMap()

setIdToTableNameMap

public void setIdToTableNameMap(HashMap<String,String> idToTableNameMap)

getDestTableId

public int getDestTableId()

setDestTableId

public void setDestTableId(int destTableId)

getUCtx

public UnionProcContext getUCtx()

setUCtx

public void setUCtx(UnionProcContext uCtx)

getJoinContext

public Map<JoinOperator,QBJoinTree> getJoinContext()
Returns:
the joinContext

setJoinContext

public void setJoinContext(Map<JoinOperator,QBJoinTree> joinContext)
Parameters:
joinContext - the joinContext to set

getListMapJoinOpsNoReducer

public List<AbstractMapJoinOperator<? extends MapJoinDesc>> getListMapJoinOpsNoReducer()
Returns:
the listMapJoinOpsNoReducer

setListMapJoinOpsNoReducer

public void setListMapJoinOpsNoReducer(List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer)
Parameters:
listMapJoinOpsNoReducer - the listMapJoinOpsNoReducer to set

setHasNonPartCols

public void setHasNonPartCols(boolean val)
Sets the hasNonPartCols flag.

Parameters:
val -

getHasNonPartCols

public boolean getHasNonPartCols()
Gets the value of the hasNonPartCols flag.


getOpToSamplePruner

public HashMap<TableScanOperator,FilterDesc.sampleDesc> getOpToSamplePruner()
Returns:
the opToSamplePruner

setOpToSamplePruner

public void setOpToSamplePruner(HashMap<TableScanOperator,FilterDesc.sampleDesc> opToSamplePruner)
Parameters:
opToSamplePruner - the opToSamplePruner to set

getGroupOpToInputTables

public Map<GroupByOperator,Set<String>> getGroupOpToInputTables()
Returns:
the groupOpToInputTables

setGroupOpToInputTables

public void setGroupOpToInputTables(Map<GroupByOperator,Set<String>> groupOpToInputTables)
Parameters:
groupOpToInputTables -

getPrunedPartitions

public Map<String,PrunedPartitionList> getPrunedPartitions()
Returns:
pruned partition map

setPrunedPartitions

public void setPrunedPartitions(Map<String,PrunedPartitionList> prunedPartitions)
Parameters:
prunedPartitions -

setLineageInfo

public void setLineageInfo(LineageInfo lInfo)
Sets the lineage information.

Parameters:
lInfo - The lineage information.

getLineageInfo

public LineageInfo getLineageInfo()
Gets the associated lineage information.

Returns:
LineageInfo

getMapJoinContext

public Map<MapJoinOperator,QBJoinTree> getMapJoinContext()

setMapJoinContext

public void setMapJoinContext(Map<MapJoinOperator,QBJoinTree> mapJoinContext)

getGlobalLimitCtx

public GlobalLimitCtx getGlobalLimitCtx()

setGlobalLimitCtx

public void setGlobalLimitCtx(GlobalLimitCtx globalLimitCtx)

getSemanticInputs

public HashSet<ReadEntity> getSemanticInputs()

replaceRootTask

public void replaceRootTask(Task<? extends Serializable> rootTask,
                            List<? extends Task<? extends Serializable>> tasks)

getFetchTask

public FetchTask getFetchTask()

setFetchTask

public void setFetchTask(FetchTask fetchTask)

getPrunedPartitions

public PrunedPartitionList getPrunedPartitions(String alias,
                                               TableScanOperator ts)
                                        throws HiveException
Throws:
HiveException

getOpToPartToSkewedPruner

public Map<TableScanOperator,Map<String,ExprNodeDesc>> getOpToPartToSkewedPruner()
Returns:
the opToPartToSkewedPruner

setOpPartToSkewedPruner

public void setOpPartToSkewedPruner(HashMap<TableScanOperator,Map<String,ExprNodeDesc>> opToPartToSkewedPruner)
Parameters:
opToPartToSkewedPruner - the opToSkewedPruner to set


Copyright © 2013 The Apache Software Foundation