public class SemanticAnalyzer extends BaseSemanticAnalyzer
| Modifier and Type | Class and Description |
|---|---|
static class |
SemanticAnalyzer.GenericUDAFInfo
Class to store GenericUDAF related information.
|
protected static class |
SemanticAnalyzer.MaterializationRebuildMode |
BaseSemanticAnalyzer.AnalyzeRewriteContext, BaseSemanticAnalyzer.TableSpecacidFileSinks, cacheUsage, cContext, columnAccessInfo, conf, console, ctx, db, fetchTask, idToTableNameMap, inputs, linfo, LOG, outputs, prepareQuery, queryProperties, queryState, rootTasks, STATIC_LOG, tableAccessInfo, transactionalInQuery, txnManager, updateColumnAccessInfo, userSuppliedFunctions| Constructor and Description |
|---|
SemanticAnalyzer(QueryState queryState) |
addPropertyReadEntry, analyze, analyzeStoredAdDirs, charSetString, checkColumnName, constructListBucketingCtx, createFetchTask, createHiveDB, endAnalysis, escapeSQLString, findTabRefIdxs, getAcidDdlDesc, getAcidFileSinks, getAutoCommitValue, getCacheUsage, getCboInfo, getColumnAccessInfo, getColumnNames, getColumnNamesOrder, getColumns, getColumns, getColumns, getCtx, getDatabase, getDatabase, getDataConnector, getDataConnector, getDb, getDbTableNamePair, getFetchTask, getFullTableNameForSQL, getIdToTableNameMap, getInputs, getLineageInfo, getOutputs, getPartitionSpecs, getPartSpec, getProps, getQualifiedTableName, getQualifiedTableName, getQueryProperties, getQueryState, getRootTasks, getSimpleTableNameBase, getTable, getTable, getTable, getTable, getTable, getTable, getTableAccessInfo, getTableAlias, getTxnMgr, getTypeStringFromAST, getUnescapedName, getUnescapedName, getUnescapedUnqualifiedTableName, getUpdateColumnAccessInfo, getUserSuppliedFunctions, getValidatedPartSpec, hasTransactionalInQuery, initCtx, isPrepareQuery, isValidPrefixSpec, processOrderSpec, raiseWrongType, readProps, setAutoCommitValue, setCacheUsage, setColumnAccessInfo, setFetchTask, setLineageInfo, setTableAccessInfo, setUpdateColumnAccessInfo, skipAuthorization, stripQuotes, toReadEntity, toReadEntity, toReadEntity, toWriteEntity, toWriteEntity, toWriteEntity, tryQualifyPath, unescapeIdentifier, unescapeSQLString, validatePartColumnType, validatePartSpec, validateUnsupportedPartitionClausepublic static final String DUMMY_DATABASE
public static final String DUMMY_TABLE
public static final String SUBQUERY_TAG_1
public static final String SUBQUERY_TAG_2
public static final String VALUES_TMP_TABLE_NAME_PREFIX
protected Map<String,TableScanOperator> topOps
protected Map<Operator<? extends OperatorDesc>,OpParseContext> opParseCtx
protected ASTNode ast
protected Map<String,PrunedPartitionList> prunedPartitions
protected List<org.apache.hadoop.hive.metastore.api.FieldSchema> resultSchema
protected List<org.apache.hadoop.hive.metastore.api.FieldSchema> originalResultSchema
protected CreateMaterializedViewDesc createVwDesc
protected ASTNode viewSelect
protected final UnparseTranslator unparseTranslator
protected final String autogenColAliasPrfxLbl
protected boolean forViewCreation
protected SemanticAnalyzer.MaterializationRebuildMode mvRebuildMode
protected volatile boolean disableJoinMerge
protected final boolean defaultJoinMerge
protected Map<String,TableScanOperator> topOpsCopy
protected final Map<String,org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.CTEClause> aliasToCTEs
protected BaseSemanticAnalyzer.AnalyzeRewriteContext analyzeRewrite
public SemanticAnalyzer(QueryState queryState) throws SemanticException
SemanticExceptionprotected void reset(boolean clearCache)
reset in class BaseSemanticAnalyzerpublic ParseContext getParseContext()
getParseContext in class BaseSemanticAnalyzerpublic CompilationOpContext getOpContext()
protected boolean isInsertInto(QBParseInfo qbp, String dest)
qbp - qbParseInfodest - destination clauseprotected List<String> getDefaultConstraints(Table tbl, List<String> targetSchema) throws SemanticException
tbl - targetSchema - SemanticExceptionprotected Map<String,String> getColNameToDefaultValueMap(Table tbl) throws SemanticException
SemanticExceptionprotected void setAST(ASTNode newAST)
public List<Task<?>> getAllRootTasks()
getAllRootTasks in class BaseSemanticAnalyzerpublic Set<ReadEntity> getAllInputs()
getAllInputs in class BaseSemanticAnalyzerpublic Set<WriteEntity> getAllOutputs()
getAllOutputs in class BaseSemanticAnalyzerprotected List<String> processTableColumnNames(ASTNode tabColName, String tableName) throws SemanticException
SemanticExceptionprotected ASTNode rewriteGroupingFunctionAST(List<ASTNode> grpByAstExprs, ASTNode targetNode, boolean noneSet)
public static String getColumnInternalName(int pos)
public static long setBit(long bitmap,
int bitIdx)
protected boolean hasGroupBySibling(ASTNode selectExpr)
protected boolean isSelectDistinct(ASTNode expr)
public static GenericUDAFEvaluator getGenericUDAFEvaluator(String aggName, List<ExprNodeDesc> aggParameters, ASTNode aggTree, boolean isDistinct, boolean isAllColumns) throws SemanticException
SemanticExceptionpublic static GenericUDAFEvaluator getGenericUDAFEvaluator2(String aggName, List<ObjectInspector> aggParameterOIs, ASTNode aggTree, boolean isDistinct, boolean isAllColumns) throws SemanticException
SemanticExceptionpublic static SemanticAnalyzer.GenericUDAFInfo getGenericUDAFInfo(GenericUDAFEvaluator evaluator, GenericUDAFEvaluator.Mode emode, List<ExprNodeDesc> aggParameters) throws SemanticException
evaluator - emode - aggParameters - The exprNodeDesc of the original parametersSemanticException - when the UDAF is not found or has problems.public static SemanticAnalyzer.GenericUDAFInfo getGenericUDAFInfo2(GenericUDAFEvaluator evaluator, GenericUDAFEvaluator.Mode emode, List<ObjectInspector> aggOIs) throws SemanticException
SemanticExceptionpublic static GenericUDAFEvaluator.Mode groupByDescModeToUDAFMode(GroupByDesc.Mode mode, boolean isDistinct)
public static ExprNodeDesc isConstantParameterInAggregationParameters(String internalName, List<ExprNodeDesc> reduceValues)
reduceValues - value columns of the corresponding ReduceSinkOperatorinternalName - the internal name of this parameterprotected Table getTargetTable(QB qb, String dest) throws SemanticException
SemanticExceptionprotected Operator genFileSinkPlan(String dest, QB qb, Operator input) throws SemanticException
SemanticExceptionprotected boolean enableColumnStatsCollecting()
protected boolean allowOutputMultipleTimes()
public Table getDummyTable() throws SemanticException
SemanticExceptionpublic void init(boolean clearPartsCache)
init in class BaseSemanticAnalyzerpublic void analyzeInternal(ASTNode ast) throws SemanticException
analyzeInternal in class BaseSemanticAnalyzerSemanticExceptionprotected Table getTableObjectByName(String tableName, boolean throwException) throws HiveException
HiveExceptionpublic Table getTableObjectByName(String tableName) throws HiveException
HiveExceptionprotected void compilePlan(ParseContext pCtx) throws SemanticException
SemanticExceptionpublic List<org.apache.hadoop.hive.metastore.api.FieldSchema> getResultSchema()
getResultSchema in class BaseSemanticAnalyzerpublic List<org.apache.hadoop.hive.metastore.api.FieldSchema> getOriginalResultSchema()
protected void saveViewDefinition()
throws SemanticException
SemanticExceptionpublic ExprNodeDesc genExprNodeDesc(ASTNode expr, RowResolver input) throws SemanticException
SemanticExceptionpublic static final Map<ASTNode,String> translateFieldDesc(ASTNode node, HiveConf conf)
public void validate()
throws SemanticException
validate in class BaseSemanticAnalyzerSemanticExceptionprotected ASTNode analyzeCreateView(ASTNode ast, QB qb, org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.PlannerContext plannerCtx) throws SemanticException
SemanticExceptionprotected void processNoScanCommand(ASTNode tree) throws SemanticException
tree - SemanticExceptionpublic QB getQB()
public static List<WindowingSpec.WindowExpressionSpec> parseSelect(String selectExprStr) throws SemanticException
SemanticExceptionprotected boolean updating(String destination)
public List<LoadFileDesc> getLoadFileWork()
public List<LoadTableDesc> getLoadTableWork()
public void setLoadFileWork(List<LoadFileDesc> loadFileWork)
public void setLoadTableWork(List<LoadTableDesc> tblWork)
public MaterializationValidationResult getMaterializationValidationResult()
public void setMaterializationValidationResult(MaterializationValidationResult materializationValidationResult)
public String getInvalidResultCacheReason()
public void setInvalidResultCacheReason(String invalidQueryMaterializationReason)
public boolean isValidQueryCaching()
public void forViewCreation(String fqViewName)
public Map<String,TableScanOperator> getTopOps()
public Map<String,ReadEntity> getViewAliasToInput()
public Operator getSinkOp()
protected void addPartitionColsToInsert(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols, StringBuilder rewrittenQueryStr)
protected void addPartitionColsToInsert(List<org.apache.hadoop.hive.metastore.api.FieldSchema> partCols, Map<String,String> partSpec, StringBuilder rewrittenQueryStr)
public WriteEntity getAcidAnalyzeTable()
getAcidAnalyzeTable in class BaseSemanticAnalyzerpublic void executeUnParseTranslations()
BaseSemanticAnalyzerexecuteUnParseTranslations in class BaseSemanticAnalyzerpublic void startAnalysis()
BaseSemanticAnalyzerstartAnalysis in class BaseSemanticAnalyzerCopyright © 2024 The Apache Software Foundation. All rights reserved.