15 package com.cloudera.impala.analysis;
17 import java.io.StringReader;
18 import java.util.List;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
27 import com.cloudera.impala.thrift.TAccessEvent;
28 import com.cloudera.impala.thrift.TQueryCtx;
29 import com.google.common.base.Preconditions;
35 private final static Logger
LOG = LoggerFactory.getLogger(AnalysisContext.class);
301 SqlScanner input =
new SqlScanner(
new StringReader(stmt));
302 SqlParser
parser =
new SqlParser(input);
305 analysisResult_.analyzer_ = analyzer;
309 analysisResult_.stmt_ = (
StatementBase) parser.parse().value;
315 analysisResult_.tmpCreateTableStmt_ =
319 analysisResult_.stmt_.analyze(analysisResult_.analyzer_);
320 boolean isExplain = analysisResult_.isExplainStmt();
326 Preconditions.checkNotNull(rewrittenStmt);
329 analysisResult_.stmt_ = rewrittenStmt;
330 analysisResult_.stmt_.analyze(analysisResult_.analyzer_);
331 LOG.trace(
"rewrittenStmt: " + rewrittenStmt.toSql());
332 if (isExplain) analysisResult_.stmt_.setIsExplain();
333 Preconditions.checkState(!analysisResult_.requiresRewrite());
338 }
catch (Exception e) {
AlterTableStmt getAlterTableStmt()
boolean isCreateDataSrcStmt()
boolean isShowCreateTableStmt()
boolean isCreateUdfStmt()
boolean isShowRolesStmt()
boolean isGrantRevokeRoleStmt()
boolean isResetMetadataStmt()
ShowCreateTableStmt getShowCreateTableStmt()
boolean isGrantRevokePrivStmt()
AlterViewStmt getAlterViewStmt()
ComputeStatsStmt getComputeStatsStmt()
CreateTableAsSelectStmt getCreateTableAsSelectStmt()
boolean isShowGrantRoleStmt()
CreateUdfStmt getCreateUdfStmt()
ShowDbsStmt getShowDbsStmt()
boolean isCreateTableStmt()
ShowDataSrcsStmt getShowDataSrcsStmt()
CreateUdaStmt getCreateUdaStmt()
boolean isComputeStatsStmt()
AnalysisResult getAnalysisResult()
DropTableOrViewStmt getDropTableOrViewStmt()
AnalysisResult analysisResult_
boolean isShowTablesStmt()
boolean isViewMetadataStmt()
boolean isCreateTableAsSelectStmt()
void analyze(String stmt, Analyzer analyzer)
boolean isShowStatsStmt()
AnalysisContext(ImpaladCatalog catalog, TQueryCtx queryCtx, AuthorizationConfig authzConfig)
final AuthorizationConfig authzConfig_
final ImpaladCatalog catalog_
Set< TAccessEvent > getAccessEvents()
CreateTableStmt tmpCreateTableStmt_
ShowTablesStmt getShowTablesStmt()
LoadDataStmt getLoadDataStmt()
ShowFunctionsStmt getShowFunctionsStmt()
DescribeStmt getDescribeStmt()
boolean isDropStatsStmt()
boolean requiresRewrite()
boolean isGrantRevokeStmt()
CreateTableStmt getCreateTableStmt()
ShowFilesStmt getShowFilesStmt()
boolean isAlterViewStmt()
CreateTableLikeStmt getCreateTableLikeStmt()
DropFunctionStmt getDropFunctionStmt()
CreateViewStmt getCreateViewStmt()
DropDbStmt getDropDbStmt()
boolean isCreateViewStmt()
boolean isShowDataSrcsStmt()
boolean isAlterTableStmt()
boolean isDropDataSrcStmt()
CreateDbStmt getCreateDbStmt()
CreateTableStmt getTmpCreateTableStmt()
boolean isCreateUdaStmt()
boolean isDropTableOrViewStmt()
InsertStmt getInsertStmt()
boolean isShowFilesStmt()
final TQueryCtx queryCtx_
void analyze(String stmt)
boolean isDropFunctionStmt()
String getJsonLineageGraph()
boolean isCreateTableLikeStmt()
boolean isCreateDropRoleStmt()
boolean isShowFunctionsStmt()
ShowStatsStmt getShowStatsStmt()