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

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

public class QBParseInfo
extends Object

Implementation of the parse information related to a query block.


Constructor Summary
QBParseInfo(String alias, boolean isSubQ)
           
 
Method Summary
 void addAggregationExprsForClause(String clause, LinkedHashMap<String,ASTNode> aggregationTrees)
           
 void addInsertIntoTable(String fullName)
           
 void addLateralViewForAlias(String alias, ASTNode lateralView)
           
 void addTableSpec(String tName, BaseSemanticAnalyzer.tableSpec tSpec)
           
 void addWindowingExprToClause(String clause, ASTNode windowingExprNode)
           
 void clearAggregationExprsForClause(String clause)
           
 void clearDistinctFuncExprsForClause(String clause)
           
 HashMap<String,ASTNode> getAggregationExprsForClause(String clause)
           
 String getAlias()
           
 Map<String,ArrayList<ASTNode>> getAliasToLateralViews()
           
 Map<ASTNode,String> getAllExprToColumnAlias()
           
 Set<String> getClauseNames()
           
 Set<String> getClauseNamesForDest()
           
 ASTNode getClusterByForClause(String clause)
          Get the Cluster By AST for the clause.
 List<String> getColName()
           
 List<String> getColType()
           
 Set<String> getDestCubes()
           
 ASTNode getDestForClause(String clause)
           
 Set<String> getDestGroupingSets()
           
 Integer getDestLimit(String dest)
           
 Set<String> getDestRollups()
           
 LinkedHashMap<String,LinkedHashMap<String,ASTNode>> getDestToAggregationExprs()
           
 HashMap<String,ASTNode> getDestToClusterBy()
           
 HashMap<String,List<ASTNode>> getDestToDistinctFuncExprs()
           
 HashMap<String,ASTNode> getDestToDistributeBy()
           
 HashMap<String,ASTNode> getDestToGroupBy()
           
 Map<String,ASTNode> getDestToHaving()
           
 HashMap<String,ASTNode> getDestToLateralView()
           
 HashMap<String,Integer> getDestToLimit()
           
 HashMap<String,ASTNode> getDestToOrderBy()
           
 HashMap<String,ASTNode> getDestToSortBy()
           
 HashMap<String,ASTNode> getDestToWhereExpr()
           
 List<ASTNode> getDistinctFuncExprsForClause(String clause)
           
 ASTNode getDistributeByForClause(String clause)
          Get the Distribute By AST for the clause.
 String getExprToColumnAlias(ASTNode expr)
           
 ASTNode getGroupByForClause(String clause)
           
 ASTNode getHavingForClause(String clause)
           
 ASTNode getHints()
           
 boolean getIsSubQ()
           
 ASTNode getJoinExpr()
           
 List<ASTNode> getLateralViewsForAlias(String alias)
           
 HashMap<String,TableSample> getNameToSample()
           
 ASTNode getOrderByForClause(String clause)
           
 int getOuterQueryLimit()
           
 String getPartName()
           
 ASTNode getSelForClause(String clause)
           
 ASTNode getSortByForClause(String clause)
          Get the Sort By AST for the clause.
 ASTNode getSrcForAlias(String alias)
           
 String getTableName()
           
 BaseSemanticAnalyzer.tableSpec getTableSpec()
          This method is used only for the anlayze command to get the partition specs
 BaseSemanticAnalyzer.tableSpec getTableSpec(String tName)
           
 TableSample getTabSample(String alias)
           
 ASTNode getWhrForClause(String clause)
           
 HashMap<String,ASTNode> getWindowingExprsForClause(String clause)
           
 boolean hasExprToColumnAlias(ASTNode expr)
           
 boolean isAnalyzeCommand()
           
 boolean isInsertIntoTable(String dbName, String table)
           
 boolean isInsertToTable()
           
 boolean isNoScanAnalyzeCommand()
           
 boolean isPartialScanAnalyzeCommand()
           
 boolean isSimpleSelectQuery()
           
 boolean isTblLvl()
           
 void setAggregationExprsForClause(String clause, LinkedHashMap<String,ASTNode> aggregationTrees)
           
 void setClusterByExprForClause(String clause, ASTNode ast)
          Set the Cluster By AST for the clause.
 void setColName(List<String> colName)
           
 void setColType(List<String> colType)
           
 void setDestForClause(String clause, ASTNode ast)
           
 void setDestLimit(String dest, Integer limit)
           
 void setDistinctFuncExprsForClause(String clause, List<ASTNode> ast)
           
 void setDistributeByExprForClause(String clause, ASTNode ast)
          Set the Distribute By AST for the clause.
 void setExprToColumnAlias(ASTNode expr, String alias)
           
 void setGroupByExprForClause(String clause, ASTNode ast)
           
 void setHavingExprForClause(String clause, ASTNode ast)
           
 void setHints(ASTNode hint)
           
 void setIsAnalyzeCommand(boolean isAnalyzeCommand)
           
 void setIsInsertToTable(boolean isInsertToTable)
           
 void setJoinExpr(ASTNode joinExpr)
           
 void setNoScanAnalyzeCommand(boolean isNoScanAnalyzeCommand)
           
 void setOrderByExprForClause(String clause, ASTNode ast)
           
 void setOuterQueryLimit(int outerQueryLimit)
           
 void setPartialScanAnalyzeCommand(boolean isPartialScanAnalyzeCommand)
           
 void setPartName(String partName)
           
 void setSelExprForClause(String clause, ASTNode ast)
           
 void setSortByExprForClause(String clause, ASTNode ast)
          Set the Sort By AST for the clause.
 void setSrcForAlias(String alias, ASTNode ast)
           
 void setTableName(String tableName)
           
 void setTabSample(String alias, TableSample tableSample)
           
 void setTblLvl(boolean isTblLvl)
           
 void setWhrExprForClause(String clause, ASTNode ast)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QBParseInfo

public QBParseInfo(String alias,
                   boolean isSubQ)
Method Detail

clearAggregationExprsForClause

public void clearAggregationExprsForClause(String clause)

setAggregationExprsForClause

public void setAggregationExprsForClause(String clause,
                                         LinkedHashMap<String,ASTNode> aggregationTrees)

addAggregationExprsForClause

public void addAggregationExprsForClause(String clause,
                                         LinkedHashMap<String,ASTNode> aggregationTrees)

addInsertIntoTable

public void addInsertIntoTable(String fullName)

isInsertIntoTable

public boolean isInsertIntoTable(String dbName,
                                 String table)

getAggregationExprsForClause

public HashMap<String,ASTNode> getAggregationExprsForClause(String clause)

addWindowingExprToClause

public void addWindowingExprToClause(String clause,
                                     ASTNode windowingExprNode)

getWindowingExprsForClause

public HashMap<String,ASTNode> getWindowingExprsForClause(String clause)

clearDistinctFuncExprsForClause

public void clearDistinctFuncExprsForClause(String clause)

setDistinctFuncExprsForClause

public void setDistinctFuncExprsForClause(String clause,
                                          List<ASTNode> ast)

getDistinctFuncExprsForClause

public List<ASTNode> getDistinctFuncExprsForClause(String clause)

setSelExprForClause

public void setSelExprForClause(String clause,
                                ASTNode ast)

setWhrExprForClause

public void setWhrExprForClause(String clause,
                                ASTNode ast)

setHavingExprForClause

public void setHavingExprForClause(String clause,
                                   ASTNode ast)

setGroupByExprForClause

public void setGroupByExprForClause(String clause,
                                    ASTNode ast)

setDestForClause

public void setDestForClause(String clause,
                             ASTNode ast)

setClusterByExprForClause

public void setClusterByExprForClause(String clause,
                                      ASTNode ast)
Set the Cluster By AST for the clause.

Parameters:
clause - the name of the clause
ast - the abstract syntax tree

setDistributeByExprForClause

public void setDistributeByExprForClause(String clause,
                                         ASTNode ast)
Set the Distribute By AST for the clause.

Parameters:
clause - the name of the clause
ast - the abstract syntax tree

setSortByExprForClause

public void setSortByExprForClause(String clause,
                                   ASTNode ast)
Set the Sort By AST for the clause.

Parameters:
clause - the name of the clause
ast - the abstract syntax tree

setOrderByExprForClause

public void setOrderByExprForClause(String clause,
                                    ASTNode ast)

setSrcForAlias

public void setSrcForAlias(String alias,
                           ASTNode ast)

getClauseNames

public Set<String> getClauseNames()

getClauseNamesForDest

public Set<String> getClauseNamesForDest()

getDestForClause

public ASTNode getDestForClause(String clause)

getWhrForClause

public ASTNode getWhrForClause(String clause)

getDestToWhereExpr

public HashMap<String,ASTNode> getDestToWhereExpr()

getGroupByForClause

public ASTNode getGroupByForClause(String clause)

getDestRollups

public Set<String> getDestRollups()

getDestCubes

public Set<String> getDestCubes()

getDestGroupingSets

public Set<String> getDestGroupingSets()

getDestToGroupBy

public HashMap<String,ASTNode> getDestToGroupBy()

getHavingForClause

public ASTNode getHavingForClause(String clause)

getDestToHaving

public Map<String,ASTNode> getDestToHaving()

getSelForClause

public ASTNode getSelForClause(String clause)

getClusterByForClause

public ASTNode getClusterByForClause(String clause)
Get the Cluster By AST for the clause.

Parameters:
clause - the name of the clause
Returns:
the abstract syntax tree

getDestToClusterBy

public HashMap<String,ASTNode> getDestToClusterBy()

getDistributeByForClause

public ASTNode getDistributeByForClause(String clause)
Get the Distribute By AST for the clause.

Parameters:
clause - the name of the clause
Returns:
the abstract syntax tree

getDestToDistributeBy

public HashMap<String,ASTNode> getDestToDistributeBy()

getSortByForClause

public ASTNode getSortByForClause(String clause)
Get the Sort By AST for the clause.

Parameters:
clause - the name of the clause
Returns:
the abstract syntax tree

getOrderByForClause

public ASTNode getOrderByForClause(String clause)

getDestToSortBy

public HashMap<String,ASTNode> getDestToSortBy()

getDestToOrderBy

public HashMap<String,ASTNode> getDestToOrderBy()

getSrcForAlias

public ASTNode getSrcForAlias(String alias)

getAlias

public String getAlias()

getIsSubQ

public boolean getIsSubQ()

getJoinExpr

public ASTNode getJoinExpr()

setJoinExpr

public void setJoinExpr(ASTNode joinExpr)

getTabSample

public TableSample getTabSample(String alias)

setTabSample

public void setTabSample(String alias,
                         TableSample tableSample)

getExprToColumnAlias

public String getExprToColumnAlias(ASTNode expr)

getAllExprToColumnAlias

public Map<ASTNode,String> getAllExprToColumnAlias()

hasExprToColumnAlias

public boolean hasExprToColumnAlias(ASTNode expr)

setExprToColumnAlias

public void setExprToColumnAlias(ASTNode expr,
                                 String alias)

setDestLimit

public void setDestLimit(String dest,
                         Integer limit)

getDestLimit

public Integer getDestLimit(String dest)

getOuterQueryLimit

public int getOuterQueryLimit()
Returns:
the outerQueryLimit

setOuterQueryLimit

public void setOuterQueryLimit(int outerQueryLimit)
Parameters:
outerQueryLimit - the outerQueryLimit to set

isSimpleSelectQuery

public boolean isSimpleSelectQuery()

setHints

public void setHints(ASTNode hint)

getHints

public ASTNode getHints()

getAliasToLateralViews

public Map<String,ArrayList<ASTNode>> getAliasToLateralViews()

getLateralViewsForAlias

public List<ASTNode> getLateralViewsForAlias(String alias)

addLateralViewForAlias

public void addLateralViewForAlias(String alias,
                                   ASTNode lateralView)

setIsAnalyzeCommand

public void setIsAnalyzeCommand(boolean isAnalyzeCommand)

isAnalyzeCommand

public boolean isAnalyzeCommand()

setIsInsertToTable

public void setIsInsertToTable(boolean isInsertToTable)

isInsertToTable

public boolean isInsertToTable()

addTableSpec

public void addTableSpec(String tName,
                         BaseSemanticAnalyzer.tableSpec tSpec)

getTableSpec

public BaseSemanticAnalyzer.tableSpec getTableSpec(String tName)

getTableSpec

public BaseSemanticAnalyzer.tableSpec getTableSpec()
This method is used only for the anlayze command to get the partition specs


getDestToLimit

public HashMap<String,Integer> getDestToLimit()

getDestToAggregationExprs

public LinkedHashMap<String,LinkedHashMap<String,ASTNode>> getDestToAggregationExprs()

getDestToDistinctFuncExprs

public HashMap<String,List<ASTNode>> getDestToDistinctFuncExprs()

getNameToSample

public HashMap<String,TableSample> getNameToSample()

getDestToLateralView

public HashMap<String,ASTNode> getDestToLateralView()

getTableName

public String getTableName()

setTableName

public void setTableName(String tableName)

getColName

public List<String> getColName()

setColName

public void setColName(List<String> colName)

getPartName

public String getPartName()

setPartName

public void setPartName(String partName)

isTblLvl

public boolean isTblLvl()

setTblLvl

public void setTblLvl(boolean isTblLvl)

getColType

public List<String> getColType()

setColType

public void setColType(List<String> colType)

isNoScanAnalyzeCommand

public boolean isNoScanAnalyzeCommand()
Returns:
the isNoScanAnalyzeCommand

setNoScanAnalyzeCommand

public void setNoScanAnalyzeCommand(boolean isNoScanAnalyzeCommand)
Parameters:
isNoScanAnalyzeCommand - the isNoScanAnalyzeCommand to set

isPartialScanAnalyzeCommand

public boolean isPartialScanAnalyzeCommand()
Returns:
the isPartialScanAnalyzeCommand

setPartialScanAnalyzeCommand

public void setPartialScanAnalyzeCommand(boolean isPartialScanAnalyzeCommand)
Parameters:
isPartialScanAnalyzeCommand - the isPartialScanAnalyzeCommand to set


Copyright © 2014 The Apache Software Foundation. All rights reserved.