|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer
public class SemanticAnalyzer
Implementation of the semantic analyzer. It generates the query plan. There are other specific semantic analyzers for some hive operations such as DDLSemanticAnalyzer for ddl operations.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer |
|---|
BaseSemanticAnalyzer.tableSpec |
| Field Summary | |
|---|---|
static String |
DUMMY_DATABASE
|
static String |
DUMMY_TABLE
|
protected boolean |
noscan
|
protected boolean |
partialscan
|
| Fields inherited from class org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer |
|---|
columnAccessInfo, conf, console, ctx, db, fetchTask, HIVE_COLUMN_ORDER_ASC, HIVE_COLUMN_ORDER_DESC, idToTableNameMap, inputs, linfo, LOG, ORCFILE_INPUT, ORCFILE_OUTPUT, ORCFILE_SERDE, outputs, PARQUETFILE_INPUT, PARQUETFILE_OUTPUT, PARQUETFILE_SERDE, queryProperties, RCFILE_INPUT, RCFILE_OUTPUT, rootTasks, SEQUENCEFILE_INPUT, SEQUENCEFILE_OUTPUT, tableAccessInfo, TEXTFILE_INPUT, TEXTFILE_OUTPUT |
| Constructor Summary | |
|---|---|
SemanticAnalyzer(HiveConf conf)
|
|
| Method Summary | ||
|---|---|---|
void |
analyzeInternal(ASTNode ast)
|
|
boolean |
doPhase1(ASTNode ast,
QB qb,
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.Phase1Ctx ctx_1)
Phase 1: (including, but not limited to): 1. |
|
void |
doPhase1QBExpr(ASTNode ast,
QBExpr qbexpr,
String id,
String alias)
|
|
Map<ASTNode,ExprNodeDesc> |
genAllExprNodeDesc(ASTNode expr,
RowResolver input)
Generates an expression node descriptors for the expression and children of it with default TypeCheckCtx. |
|
Map<ASTNode,ExprNodeDesc> |
genAllExprNodeDesc(ASTNode expr,
RowResolver input,
TypeCheckCtx tcCtx)
Generates all of the expression node descriptors for the expression and children of it passed in the arguments. |
|
static String |
generateErrorMessage(ASTNode ast,
String message)
|
|
ExprNodeDesc |
genExprNodeDesc(ASTNode expr,
RowResolver input)
Generates an expression node descriptor for the expression with TypeCheckCtx. |
|
ExprNodeDesc |
genExprNodeDesc(ASTNode expr,
RowResolver input,
TypeCheckCtx tcCtx)
Returns expression node descriptor for the expression. |
|
Operator |
genPlan(QB qb)
|
|
static String |
getColumnInternalName(int pos)
|
|
void |
getMetaData(QB qb)
|
|
void |
getMetaData(QB qb,
ReadEntity parentInput)
|
|
ParseContext |
getParseContext()
|
|
QB |
getQB()
|
|
List<FieldSchema> |
getResultSchema()
|
|
RowResolver |
getRowResolver(Operator opt)
Get the row resolver given an operator. |
|
void |
init()
|
|
void |
initParseCtx(ParseContext pctx)
|
|
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.Phase1Ctx |
initPhase1Ctx()
|
|
static ArrayList<WindowingSpec.WindowExpressionSpec> |
parseSelect(String selectExprStr)
|
|
protected void |
processNoScanCommand(ASTNode tree)
process analyze ... |
|
protected void |
processPartialScanCommand(ASTNode tree)
process analyze ... |
|
|
putOpInsertMap(Operator<T> op,
RowResolver rr)
|
|
protected void |
reset()
|
|
void |
setQB(QB qb)
|
|
void |
validate()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DUMMY_DATABASE
public static final String DUMMY_TABLE
protected boolean noscan
protected boolean partialscan
| Constructor Detail |
|---|
public SemanticAnalyzer(HiveConf conf)
throws SemanticException
SemanticException| Method Detail |
|---|
protected void reset()
reset in class BaseSemanticAnalyzerpublic void initParseCtx(ParseContext pctx)
public ParseContext getParseContext()
public void doPhase1QBExpr(ASTNode ast,
QBExpr qbexpr,
String id,
String alias)
throws SemanticException
SemanticException
public static String generateErrorMessage(ASTNode ast,
String message)
public boolean doPhase1(ASTNode ast,
QB qb,
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.Phase1Ctx ctx_1)
throws SemanticException
ast - qb - ctx_1 -
SemanticException
public void getMetaData(QB qb)
throws SemanticException
SemanticException
public void getMetaData(QB qb,
ReadEntity parentInput)
throws SemanticException
SemanticException
public <T extends OperatorDesc> Operator<T> putOpInsertMap(Operator<T> op,
RowResolver rr)
public static String getColumnInternalName(int pos)
public Operator genPlan(QB qb)
throws SemanticException
SemanticExceptionpublic org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.Phase1Ctx initPhase1Ctx()
public void init()
init in class BaseSemanticAnalyzer
public void analyzeInternal(ASTNode ast)
throws SemanticException
analyzeInternal in class BaseSemanticAnalyzerSemanticExceptionpublic List<FieldSchema> getResultSchema()
getResultSchema in class BaseSemanticAnalyzer
public ExprNodeDesc genExprNodeDesc(ASTNode expr,
RowResolver input)
throws SemanticException
SemanticException
public Map<ASTNode,ExprNodeDesc> genAllExprNodeDesc(ASTNode expr,
RowResolver input)
throws SemanticException
SemanticException
public ExprNodeDesc genExprNodeDesc(ASTNode expr,
RowResolver input,
TypeCheckCtx tcCtx)
throws SemanticException
SemanticException
public Map<ASTNode,ExprNodeDesc> genAllExprNodeDesc(ASTNode expr,
RowResolver input,
TypeCheckCtx tcCtx)
throws SemanticException
expr - The expressioninput - The row resolvertcCtx - Customized type-checking context
SemanticException - Failed to evaluate expression
public void validate()
throws SemanticException
validate in class BaseSemanticAnalyzerSemanticExceptionpublic RowResolver getRowResolver(Operator opt)
protected void processPartialScanCommand(ASTNode tree)
throws SemanticException
tree -
SemanticException
protected void processNoScanCommand(ASTNode tree)
throws SemanticException
tree -
SemanticExceptionpublic QB getQB()
public void setQB(QB qb)
public static ArrayList<WindowingSpec.WindowExpressionSpec> parseSelect(String selectExprStr)
throws SemanticException
SemanticException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||