|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lens.driver.jdbc.ColumnarSQLRewriter
public class ColumnarSQLRewriter
The Class ColumnarSQLRewriter.
| Constructor Summary | |
|---|---|
ColumnarSQLRewriter()
Instantiates a new columnar sql rewriter. |
|
| Method Summary | |
|---|---|
void |
analyzeInternal()
Analyze internal. |
void |
buildQuery()
Builds the query. |
void |
buildSubqueries(org.apache.hadoop.hive.ql.parse.ASTNode node)
Builds the subqueries. |
StringBuilder |
constructJoinChain()
Construct join chain |
void |
factFilterPushDown(org.apache.hadoop.hive.ql.parse.ASTNode node)
Get fact filters for pushdown |
ArrayList<String> |
getAggregateColumns(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the aggregate columns. |
void |
getAllFactKeys()
Get all fact keys used in all ASTs |
void |
getAllFilters(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the all filters. |
String |
getClause()
|
String |
getFactAlias()
Get the fact alias |
void |
getFactKeysFromNode(org.apache.hadoop.hive.ql.parse.ASTNode node)
Get fact keys used in the AST |
String |
getFactNameAlias(org.apache.hadoop.hive.ql.parse.ASTNode fromAST)
Gets the fact name alias. |
void |
getFilterInJoinCond(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the filter in join cond. |
void |
getJoinCond(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the join cond. |
String |
getLimitClause(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the limit clause. |
String |
getTableFromTabRefNode(org.apache.hadoop.hive.ql.parse.ASTNode tree)
Gets the table from tab ref node. |
String |
getTableOrAlias(String keyString,
String type)
Get the table or alias from the given key string |
ArrayList<String> |
getTablesAndColumns(org.apache.hadoop.hive.ql.parse.ASTNode node)
Gets the tables and columns. |
void |
init(org.apache.hadoop.conf.Configuration conf)
Set conf for the rewriter |
void |
replaceAliasInAST()
Replace alias in AST trees |
String |
replaceUDFForDB(String query)
Replace udf for db. |
void |
reset()
Reset. |
String |
rewrite(String query,
org.apache.hadoop.conf.Configuration conf)
Rewrite. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColumnarSQLRewriter()
| Method Detail |
|---|
public void init(org.apache.hadoop.conf.Configuration conf)
QueryRewriter
init in interface QueryRewriterconf - Configuration required for rewriter initpublic String getClause()
public void analyzeInternal()
throws org.apache.hadoop.hive.ql.parse.SemanticException
org.apache.hadoop.hive.ql.parse.SemanticException - the semantic exceptionpublic String getTableFromTabRefNode(org.apache.hadoop.hive.ql.parse.ASTNode tree)
tree - the tree
public void getJoinCond(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the nodepublic StringBuilder constructJoinChain()
public void getFilterInJoinCond(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the nodepublic String getFactAlias()
public void factFilterPushDown(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - public void getFactKeysFromNode(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - public void getAllFactKeys()
public void buildSubqueries(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the node
public String getTableOrAlias(String keyString,
String type)
keyString - type -
public ArrayList<String> getAggregateColumns(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the node
public ArrayList<String> getTablesAndColumns(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the node
public String getLimitClause(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the node
public void getAllFilters(org.apache.hadoop.hive.ql.parse.ASTNode node)
node - the nodepublic String getFactNameAlias(org.apache.hadoop.hive.ql.parse.ASTNode fromAST)
fromAST - the from ast
public void reset()
public String replaceUDFForDB(String query)
query - the query
public void replaceAliasInAST()
throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveException
public void buildQuery()
throws org.apache.hadoop.hive.ql.metadata.HiveException
org.apache.hadoop.hive.ql.metadata.HiveException - the hive exception
public String rewrite(String query,
org.apache.hadoop.conf.Configuration conf)
throws LensException
QueryRewriter
rewrite in interface QueryRewriterquery - the queryconf - the query configuration
LensException - the lens exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||