Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package org.apache.hadoop.hive.ql.parse;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
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.
 
 
 public class ParseContext {
   private QB qb;
   private ASTNode ast;
   private HashMap<StringOperator<? extends Serializable>> topOps;
   private HashMap<StringOperator<? extends Serializable>> topSelOps;
   private List<LoadFileDescloadFileWork;
   private Context ctx;
   private HiveConf conf;
   private int destTableId;
   private UnionProcContext uCtx;
   private List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer// list of map join
   // operators with no
   // reducer
The lineage information.
 
   private LineageInfo lInfo;
 
   // is set to true if the expression only contains partitioning columns and not
   // any other column reference.
   // This is used to optimize select * from table where ... scenario, when the
   // where condition only references
   // partitioning columns - the partitions are identified and streamed directly
   // to the client without requiring
   // a map-reduce job
   private boolean hasNonPartCols;
 
   public ParseContext() {
   }

  

Parameters:
qb current QB
ast current parse tree
opToPartPruner map from table scan operator to partition pruner
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
fopToTable the table schemas that are being inserted into
loadTableWork list of destination tables being loaded
loadFileWork list of destination files being loaded
ctx parse context
idToTableNameMap
destTableId
uCtx
listMapJoinOpsNoReducer list of map join operators with no reducer
opToSamplePruner operator to sample pruner map
  public ParseContext(
      HiveConf conf,
      QB qb,
      ASTNode ast,
      HashMap<TableScanOperatorExprNodeDescopToPartPruner,
      HashMap<TableScanOperatorPrunedPartitionListopToPartList,
      HashMap<StringOperator<? extends Serializable>> topOps,
      HashMap<StringOperator<? extends Serializable>> topSelOps,
      LinkedHashMap<Operator<? extends Serializable>, OpParseContextopParseCtx,
      Map<JoinOperatorQBJoinTreejoinContext,
      HashMap<TableScanOperatorTabletopToTable,
      List<LoadTableDescloadTableWorkList<LoadFileDescloadFileWork,
      Context ctxHashMap<StringStringidToTableNameMapint destTableId,
      UnionProcContext uCtxList<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer,
      Map<GroupByOperatorSet<String>> groupOpToInputTables,
      Map<StringPrunedPartitionListprunedPartitions,
      HashMap<TableScanOperatorsampleDescopToSamplePruner) {
    this. = conf;
    this. = qb;
    this. = ast;
    this. = opToPartPruner;
    this. = opToPartList;
    this. = joinContext;
    this. = topToTable;
    this. = loadFileWork;
    this. = loadTableWork;
    this. = opParseCtx;
    this. = topOps;
    this. = topSelOps;
    this. = ctx;
    this. = idToTableNameMap;
    this. = destTableId;
    this. = uCtx;
    this. = listMapJoinOpsNoReducer;
     = false;
    this. = groupOpToInputTables;
    this. = prunedPartitions;
    this. = opToSamplePruner;
  }

  

Returns:
the qb
  public QB getQB() {
    return ;
  }

  

Parameters:
qb the qb to set
  public void setQB(QB qb) {
    this. = qb;
  }

  

Returns:
the context
  public Context getContext() {
    return ;
  }

  

Parameters:
ctx the context to set
  public void setContext(Context ctx) {
    this. = ctx;
  }

  

Returns:
the hive conf
  public HiveConf getConf() {
    return ;
  }

  

Parameters:
conf the conf to set
  public void setConf(HiveConf conf) {
    this. = conf;
  }

  

Returns:
the ast
  public ASTNode getParseTree() {
    return ;
  }

  

Parameters:
ast the parsetree to set
  public void setParseTree(ASTNode ast) {
    this. = ast;
  }

  

Returns:
the opToPartPruner
    return ;
  }

  

Parameters:
opToPartPruner the opToPartPruner to set
  public void setOpToPartPruner(
      HashMap<TableScanOperatorExprNodeDescopToPartPruner) {
    this. = opToPartPruner;
  }
    return ;
  }
  public void setOpToPartList(HashMap<TableScanOperatorPrunedPartitionListopToPartList) {
    this. = opToPartList;
  }

  

Returns:
the topToTable
    return ;
  }

  

Parameters:
topToTable the topToTable to set
  public void setTopToTable(HashMap<TableScanOperatorTabletopToTable) {
    this. = topToTable;
  }

  

Returns:
the topOps
  public HashMap<StringOperator<? extends Serializable>> getTopOps() {
    return ;
  }

  

Parameters:
topOps the topOps to set
  public void setTopOps(HashMap<StringOperator<? extends Serializable>> topOps) {
    this. = topOps;
  }

  

Returns:
the topSelOps
  public HashMap<StringOperator<? extends Serializable>> getTopSelOps() {
    return ;
  }

  

Parameters:
topSelOps the topSelOps to set
  public void setTopSelOps(
      HashMap<StringOperator<? extends Serializable>> topSelOps) {
    this. = topSelOps;
  }

  

Returns:
the opParseCtx
    return ;
  }

  

Parameters:
opParseCtx the opParseCtx to set
  public void setOpParseCtx(
      LinkedHashMap<Operator<? extends Serializable>, OpParseContextopParseCtx) {
    this. = opParseCtx;
  }

  

Returns:
the loadTableWork
    return ;
  }

  

Parameters:
loadTableWork the loadTableWork to set
  public void setLoadTableWork(List<LoadTableDescloadTableWork) {
    this. = loadTableWork;
  }

  

Returns:
the loadFileWork
    return ;
  }

  

Parameters:
loadFileWork the loadFileWork to set
  public void setLoadFileWork(List<LoadFileDescloadFileWork) {
    this. = loadFileWork;
  }
    return ;
  }
  public void setIdToTableNameMap(HashMap<StringStringidToTableNameMap) {
    this. = idToTableNameMap;
  }
  public int getDestTableId() {
    return ;
  }
  public void setDestTableId(int destTableId) {
    this. = destTableId;
  }
  public UnionProcContext getUCtx() {
    return ;
  }
  public void setUCtx(UnionProcContext uCtx) {
    this. = uCtx;
  }

  

Returns:
the joinContext
    return ;
  }

  

Parameters:
joinContext the joinContext to set
  public void setJoinContext(Map<JoinOperatorQBJoinTreejoinContext) {
    this. = joinContext;
  }

  

Returns:
the listMapJoinOpsNoReducer
  }

  

Parameters:
listMapJoinOpsNoReducer the listMapJoinOpsNoReducer to set
      List<AbstractMapJoinOperator<? extends MapJoinDesc>> listMapJoinOpsNoReducer) {
    this. = listMapJoinOpsNoReducer;
  }

  
Sets the hasNonPartCols flag.

Parameters:
val
  public void setHasNonPartCols(boolean val) {
     = val;
  }

  
Gets the value of the hasNonPartCols flag.
  public boolean getHasNonPartCols() {
    return ;
  }

  

Returns:
the opToSamplePruner
    return ;
  }

  

Parameters:
opToSamplePruner the opToSamplePruner to set
  public void setOpToSamplePruner(
      HashMap<TableScanOperatorsampleDescopToSamplePruner) {
    this. = opToSamplePruner;
  }

  

Returns:
the groupOpToInputTables
    return ;
  }

  

Parameters:
groupOpToInputTables
  public void setGroupOpToInputTables(
      Map<GroupByOperatorSet<String>> groupOpToInputTables) {
    this. = groupOpToInputTables;
  }

  

Returns:
pruned partition map
    return ;
  }

  

Parameters:
prunedPartitions
  public void setPrunedPartitions(
      Map<StringPrunedPartitionListprunedPartitions) {
    this. = prunedPartitions;
  }

  
Sets the lineage information.

Parameters:
lInfo The lineage information.
  public void setLineageInfo(LineageInfo lInfo) {
    this. = lInfo;
  }

  
Gets the associated lineage information.

Returns:
LineageInfo
  public LineageInfo getLineageInfo() {
    return ;
  }
    return ;
  }
  public void setMapJoinContext(Map<MapJoinOperatorQBJoinTreemapJoinContext) {
    this. = mapJoinContext;
  }
New to GrepCode? Check out our FAQ X