|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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
|
Fields inherited from class org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer |
---|
HIVE_COLUMN_ORDER_ASC, HIVE_COLUMN_ORDER_DESC |
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<org.apache.hadoop.hive.metastore.api.FieldSchema> |
getResultSchema()
|
|
RowResolver |
getRowResolver(Operator opt)
Get the row resolver given an operator. |
|
Table |
getTable(TableScanOperator ts)
|
|
void |
init()
|
|
void |
initParseCtx(ParseContext pctx)
|
|
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.Phase1Ctx |
initPhase1Ctx()
|
|
static ArrayList<WindowingSpec.WindowExpressionSpec> |
parseSelect(String selectExprStr)
|
|
|
putOpInsertMap(Operator<T> op,
RowResolver rr)
|
|
void |
setQB(QB qb)
|
|
void |
validate()
|
Methods inherited from class org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer |
---|
analyze, charSetString, getColumnAccessInfo, getColumnNames, getColumns, getDb, getFetchTask, getIdToTableNameMap, getInputs, getLineageInfo, getOutputs, getQueryProperties, getRootTasks, getTableAccessInfo, getUnescapedName, getUnescapedName, getUnescapedUnqualifiedTableName, initCtx, isValidPrefixSpec, readProps, setColumnAccessInfo, setFetchTask, setLineageInfo, setTableAccessInfo, stripIdentifierQuotes, stripQuotes, unescapeIdentifier, unescapeSQLString, validatePartSpec |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DUMMY_DATABASE
public static final String DUMMY_TABLE
Constructor Detail |
---|
public SemanticAnalyzer(HiveConf conf) throws SemanticException
SemanticException
Method Detail |
---|
public 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 Table getTable(TableScanOperator ts)
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
SemanticException
public 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 BaseSemanticAnalyzer
SemanticException
public List<org.apache.hadoop.hive.metastore.api.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 expressionpublic void validate() throws SemanticException
validate
in class BaseSemanticAnalyzer
SemanticException
public RowResolver getRowResolver(Operator opt)
public 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 |