Package io.trino.sql.analyzer
Class Analysis
java.lang.Object
io.trino.sql.analyzer.Analysis
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final classstatic classstatic final classstatic final classstatic final recordstatic classstatic classAnalysis for predicates such asx IN (subquery)orx = SOME (subquery)static classstatic final classstatic classstatic final classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAliased(Relation relation) voidaddCheckConstraints(Table table, Expression constraint) voidaddCoercion(Expression expression, Type type, boolean isTypeOnlyCoercion) voidaddCoercions(Map<NodeRef<Expression>, Type> coercions, Set<NodeRef<Expression>> typeOnlyCoercions, Map<NodeRef<Expression>, Type> sortKeyCoercionsForFrameBoundCalculation, Map<NodeRef<Expression>, Type> sortKeyCoercionsForFrameBoundComparison) voidaddColumnMask(Table table, String column, Expression mask) voidaddColumnReferences(Map<NodeRef<Expression>, ResolvedField> columnReferences) voidaddEmptyColumnReferencesForTable(AccessControl accessControl, Identity identity, QualifiedObjectName table) voidaddExpressionFields(Expression expression, Collection<Field> fields) voidaddFrameBoundCalculations(Map<NodeRef<Expression>, ResolvedFunction> frameBoundCalculations) voidaddJsonTableAnalysis(JsonTable jsonTable, Analysis.JsonTableAnalysis analysis) voidaddLabelDereferences(Map<NodeRef<DereferenceExpression>, ExpressionAnalyzer.LabelPrefixedReference> dereferences) voidaddLambdaArgumentReferences(Map<NodeRef<Identifier>, LambdaArgumentDeclaration> lambdaArgumentReferences) voidaddPatternRecognitionFunctions(Set<NodeRef<FunctionCall>> functions) voidaddPolymorphicTableFunction(TableFunctionInvocation invocation) voidaddPredicateCoercions(Map<NodeRef<Expression>, Analysis.PredicateCoercions> coercions) voidaddRelationCoercion(Relation relation, Type[] types) voidaddResolvedFunction(Node node, ResolvedFunction function, String authorization) voidaddRowFilter(Table table, Expression filter) voidaddSourceColumns(Field field, Set<Analysis.SourceColumn> sourceColumn) voidaddTableColumnReferences(AccessControl accessControl, Identity identity, com.google.common.collect.Multimap<QualifiedObjectName, String> tableColumnMap) voidaddType(Expression expression, Type type) voidaddTypes(Map<NodeRef<Expression>, Type> types) voidaddWindowDefinition(QuerySpecification query, CanonicalizationAware<Identifier> name, Analysis.ResolvedWindow window) getAccessControlScope(Table node) getAggregates(QuerySpecification query) getCheckConstraints(Table node) getCoercion(Expression expression) getColumnMasks(Table table) getExpandableBaseScope(Node node) getExpressionSourceColumns(Expression expression) getFrameBoundCalculation(Expression frameOffset) getGroupingOperations(QuerySpecification querySpecification) getHaving(QuerySpecification query) getJoinCriteria(Join join) getJoinUsing(Join node) getJsonInputFunction(Expression expression) getJsonOutputFunction(Node node) getJsonPathAnalysis(Node node) getJsonTableAnalysis(JsonTable jsonTable) getLabelDereference(DereferenceExpression expression) getLambdaArgumentReference(Identifier identifier) getMeasureDefinition(WindowOperation measure) getNamedQuery(Table table) longgetOrderByAggregates(OrderBy node) getOrderByExpressions(Node node) getOrderByWindowFunctions(OrderBy query) getOutputDescriptor(Node node) getPredicateCoercions(Expression expression) getRange(RangeQuantifier quantifier) getRecursiveReference(Query query) getRelationCoercion(Relation relation) getRelationName(Relation relation) getResolvedField(Expression expression) getResolvedFunction(Node node) getRowFilters(Table node) getRowIdField(Table table) doublegetSampleRatio(SampledRelation relation) getSelectExpressions(Node node) getSortKeyCoercionForFrameBoundCalculation(Expression frameOffset) getSortKeyCoercionForFrameBoundComparison(Expression frameOffset) getSourceColumns(Field field) getSubqueries(Node node) getTableHandle(Table table) getType(Expression expression) getTypes()getUndefinedLabels(RowPattern pattern) getWhere(QuerySpecification node) getWindowDefinition(QuerySpecification query, CanonicalizationAware<Identifier> name) booleanhasColumnMask(QualifiedObjectName table, String column, String identity) booleanhasRowFilter(QualifiedObjectName table, String identity) booleanhasTableInView(Table tableReference) booleanbooleanbooleanisColumnReference(Expression expression) booleanbooleanisExpandableQuery(Query query) booleanisOrderByRedundant(OrderBy orderBy) booleanisPatternAggregation(FunctionCall function) booleanisPatternRecognitionFunction(FunctionCall functionCall) booleanisPolymorphicTableFunction(TableFunctionInvocation invocation) booleanbooleanbooleanisTypeOnlyCoercion(Expression expression) booleanisUpdateTarget(Table table) voidmarkRedundantOrderBy(OrderBy orderBy) voidrecordSubqueries(Node node, ExpressionAnalysis expressionAnalysis) voidregisterExpandableQuery(Query query, Node recursiveReference) voidregisterNamedQuery(Table tableReference, Query query) voidregisterTable(Table table, Optional<TableHandle> handle, QualifiedObjectName name, String authorization, Scope accessControlScope) voidregisterTableForColumnMasking(QualifiedObjectName table, String column, String identity) voidregisterTableForRowFiltering(QualifiedObjectName table, String identity) voidregisterTableForView(Table tableReference) voidsetAggregates(QuerySpecification node, List<FunctionCall> aggregates) voidsetAnalyzeMetadata(AnalyzeMetadata analyzeMetadata) voidsetColumn(Field field, ColumnHandle handle) voidsetCreate(Analysis.Create create) voidvoidsetExpandableBaseScope(Node node, Scope scope) voidsetGroupingOperations(QuerySpecification querySpecification, List<GroupingOperation> groupingOperations) voidsetGroupingSets(QuerySpecification node, Analysis.GroupingSetAnalysis groupingSets) voidsetHaving(QuerySpecification node, Expression expression) voidsetImplicitFromScope(QuerySpecification node, Scope scope) voidsetInsert(Analysis.Insert insert) voidsetJoinCriteria(Join node, Expression criteria) voidsetJoinUsing(Join node, Analysis.JoinUsingAnalysis analysis) voidsetJsonInputFunctions(Map<NodeRef<Expression>, ResolvedFunction> functions) voidsetJsonOutputFunctions(Map<NodeRef<Node>, ResolvedFunction> functions) voidsetJsonPathAnalyses(Map<NodeRef<Node>, JsonPathAnalyzer.JsonPathAnalysis> pathAnalyses) voidsetJsonPathAnalysis(Node node, JsonPathAnalyzer.JsonPathAnalysis pathAnalysis) voidvoidsetLimit(Node node, OptionalLong rowCount) voidsetMeasureDefinitions(Map<NodeRef<WindowOperation>, MeasureDefinition> definitions) voidsetMergeAnalysis(Analysis.MergeAnalysis mergeAnalysis) voidvoidsetOrderByAggregates(OrderBy node, List<Expression> aggregates) voidsetOrderByExpressions(Node node, List<Expression> items) voidsetOrderByWindowFunctions(OrderBy node, List<FunctionCall> functions) voidsetOrderByWindowMeasures(OrderBy node, List<WindowOperation> measures) voidsetPatternAggregations(Set<NodeRef<FunctionCall>> aggregations) voidsetRanges(Map<NodeRef<RangeQuantifier>, Analysis.Range> quantifierRanges) voidsetRefreshMaterializedView(Analysis.RefreshMaterializedViewAnalysis refreshMaterializedView) voidsetRelationName(Relation relation, QualifiedName name) voidsetRowIdField(Table table, FieldReference field) voidsetSampleRatio(SampledRelation relation, double ratio) voidvoidsetSelectAllResultFields(AllColumns node, List<Field> expressions) voidsetSelectExpressions(Node node, List<Analysis.SelectExpression> expressions) voidsetSkipMaterializedViewRefresh(boolean skipMaterializedViewRefresh) voidsetTableExecuteHandle(TableExecuteHandle tableExecuteHandle) voidsetTableExecuteReadsData(boolean readsData) voidsetTableFunctionAnalysis(TableFunctionInvocation node, Analysis.TableFunctionInvocationAnalysis analysis) voidsetUndefinedLabels(RowPattern pattern, Set<String> labels) voidsetUndefinedLabels(Map<NodeRef<RowPattern>, Set<String>> labels) voidsetUnnest(Unnest node, Analysis.UnnestAnalysis analysis) voidsetUpdatedColumns(List<ColumnSchema> updatedColumns) voidsetUpdateTarget(CatalogHandle.CatalogVersion catalogVersion, QualifiedObjectName targetName, Optional<Table> targetTable, Optional<List<OutputColumn>> targetColumns) voidsetUpdateType(String updateType) voidsetWhere(Node node, Expression expression) voidsetWindow(Node node, Analysis.ResolvedWindow window) voidsetWindowFunctions(QuerySpecification node, List<FunctionCall> functions) voidsetWindowMeasures(QuerySpecification node, List<WindowOperation> measures) tryGetScope(Node node) voidunregisterTableForColumnMasking(QualifiedObjectName table, String column, String identity) voidunregisterTableForRowFiltering(QualifiedObjectName table, String identity) void
-
Constructor Details
-
Analysis
-
-
Method Details
-
getStatement
-
getUpdateType
-
getTarget
-
setUpdateType
-
setUpdateTarget
public void setUpdateTarget(CatalogHandle.CatalogVersion catalogVersion, QualifiedObjectName targetName, Optional<Table> targetTable, Optional<List<OutputColumn>> targetColumns) -
isUpdateTarget
-
isSkipMaterializedViewRefresh
public boolean isSkipMaterializedViewRefresh() -
setSkipMaterializedViewRefresh
public void setSkipMaterializedViewRefresh(boolean skipMaterializedViewRefresh) -
isTableExecuteReadsData
public boolean isTableExecuteReadsData() -
setTableExecuteReadsData
public void setTableExecuteReadsData(boolean readsData) -
setAggregates
-
getAggregates
-
setOrderByAggregates
-
getOrderByAggregates
-
getTypes
-
getType
-
getRelationCoercion
-
addRelationCoercion
-
getCoercions
-
getTypeOnlyCoercions
-
getCoercion
-
addLambdaArgumentReferences
public void addLambdaArgumentReferences(Map<NodeRef<Identifier>, LambdaArgumentDeclaration> lambdaArgumentReferences) -
getLambdaArgumentReference
-
getLambdaArgumentReferences
-
setGroupingSets
-
isAggregation
-
isTypeOnlyCoercion
-
getGroupingSets
-
setWhere
-
getWhere
-
setOrderByExpressions
-
getOrderByExpressions
-
setOffset
-
getOffset
-
setLimit
-
setLimit
-
getLimit
-
setSelectAllResultFields
-
getSelectAllResultFields
-
setSelectExpressions
-
getSelectExpressions
-
setHaving
-
setJoinCriteria
-
getJoinCriteria
-
recordSubqueries
-
getSubqueries
-
addWindowDefinition
public void addWindowDefinition(QuerySpecification query, CanonicalizationAware<Identifier> name, Analysis.ResolvedWindow window) -
getWindowDefinition
public Analysis.ResolvedWindow getWindowDefinition(QuerySpecification query, CanonicalizationAware<Identifier> name) -
setWindow
-
getWindow
-
setWindowFunctions
-
getWindowFunctions
-
setOrderByWindowFunctions
-
getOrderByWindowFunctions
-
setWindowMeasures
-
getWindowMeasures
-
setOrderByWindowMeasures
-
getOrderByWindowMeasures
-
addColumnReferences
-
getScope
-
tryGetScope
-
getRootScope
-
setScope
-
getOutputDescriptor
-
getOutputDescriptor
-
getTableHandle
-
getTables
-
registerTable
public void registerTable(Table table, Optional<TableHandle> handle, QualifiedObjectName name, String authorization, Scope accessControlScope) -
getResolvedFunctions
-
getResolvedFunction
-
addResolvedFunction
-
getColumnReferences
-
getColumnReferenceFields
-
getResolvedField
-
isColumnReference
-
addType
-
addTypes
-
addCoercion
-
addCoercions
public void addCoercions(Map<NodeRef<Expression>, Type> coercions, Set<NodeRef<Expression>> typeOnlyCoercions, Map<NodeRef<Expression>, Type> sortKeyCoercionsForFrameBoundCalculation, Map<NodeRef<Expression>, Type> sortKeyCoercionsForFrameBoundComparison) -
getSortKeyCoercionForFrameBoundCalculation
-
getSortKeyCoercionForFrameBoundComparison
-
addFrameBoundCalculations
public void addFrameBoundCalculations(Map<NodeRef<Expression>, ResolvedFunction> frameBoundCalculations) -
getFrameBoundCalculation
-
getHaving
-
setColumn
-
getColumn
-
getAnalyzeMetadata
-
setAnalyzeMetadata
-
setCreate
-
getCreate
-
setInsert
-
getInsert
-
setUpdatedColumns
-
getUpdatedColumns
-
getMergeAnalysis
-
setMergeAnalysis
-
setRefreshMaterializedView
public void setRefreshMaterializedView(Analysis.RefreshMaterializedViewAnalysis refreshMaterializedView) -
getRefreshMaterializedView
-
setDelegatedRefreshMaterializedView
-
getDelegatedRefreshMaterializedView
-
getNamedQuery
-
registerNamedQuery
-
registerExpandableQuery
-
isExpandableQuery
-
getRecursiveReference
-
setExpandableBaseScope
-
getExpandableBaseScope
-
registerTableForView
-
unregisterTableForView
public void unregisterTableForView() -
hasTableInView
-
setSampleRatio
-
getSampleRatio
-
setGroupingOperations
public void setGroupingOperations(QuerySpecification querySpecification, List<GroupingOperation> groupingOperations) -
getGroupingOperations
-
getParameters
-
getQueryType
-
isDescribe
public boolean isDescribe() -
setJoinUsing
-
getJoinUsing
-
setUnnest
-
getUnnest
-
addTableColumnReferences
public void addTableColumnReferences(AccessControl accessControl, Identity identity, com.google.common.collect.Multimap<QualifiedObjectName, String> tableColumnMap) -
addEmptyColumnReferencesForTable
public void addEmptyColumnReferencesForTable(AccessControl accessControl, Identity identity, QualifiedObjectName table) -
addLabelDereferences
public void addLabelDereferences(Map<NodeRef<DereferenceExpression>, ExpressionAnalyzer.LabelPrefixedReference> dereferences) -
getLabelDereference
public ExpressionAnalyzer.LabelPrefixedReference getLabelDereference(DereferenceExpression expression) -
addPatternRecognitionFunctions
-
isPatternRecognitionFunction
-
setRanges
-
getRange
-
setUndefinedLabels
-
setUndefinedLabels
-
getUndefinedLabels
-
setMeasureDefinitions
-
getMeasureDefinition
-
setPatternAggregations
-
isPatternAggregation
-
setJsonPathAnalyses
-
setJsonPathAnalysis
-
getJsonPathAnalysis
-
setJsonInputFunctions
-
getJsonInputFunction
-
setJsonOutputFunctions
-
getJsonOutputFunction
-
addJsonTableAnalysis
-
getJsonTableAnalysis
-
getTableColumnReferences
public Map<Analysis.AccessControlInfo,Map<QualifiedObjectName, getTableColumnReferences()Set<String>>> -
markRedundantOrderBy
-
isOrderByRedundant
-
hasRowFilter
-
registerTableForRowFiltering
-
unregisterTableForRowFiltering
-
addRowFilter
-
addCheckConstraints
-
getRowFilters
-
getCheckConstraints
-
hasColumnMask
-
registerTableForColumnMasking
public void registerTableForColumnMasking(QualifiedObjectName table, String column, String identity) -
unregisterTableForColumnMasking
public void unregisterTableForColumnMasking(QualifiedObjectName table, String column, String identity) -
addColumnMask
-
getColumnMasks
-
getReferencedTables
-
getRoutines
-
addSourceColumns
-
getSourceColumns
-
addExpressionFields
-
getExpressionSourceColumns
-
setRowIdField
-
getRowIdField
-
getAccessControlScope
-
setImplicitFromScope
-
getImplicitFromScope
-
addPredicateCoercions
-
getPredicateCoercions
-
setTableExecuteHandle
-
getTableExecuteHandle
-
setTableFunctionAnalysis
public void setTableFunctionAnalysis(TableFunctionInvocation node, Analysis.TableFunctionInvocationAnalysis analysis) -
getTableFunctionAnalysis
public Analysis.TableFunctionInvocationAnalysis getTableFunctionAnalysis(TableFunctionInvocation node) -
setRelationName
-
getRelationName
-
addAliased
-
isAliased
-
addPolymorphicTableFunction
-
isPolymorphicTableFunction
-