Search in sources :

Example 6 with PatternRecognitionNode

use of io.trino.sql.planner.plan.PatternRecognitionNode in project trino by trinodb.

the class MeasureMatcher method getAssignedSymbol.

@Override
public Optional<Symbol> getAssignedSymbol(PlanNode node, Session session, Metadata metadata, SymbolAliases symbolAliases) {
    Optional<Symbol> result = Optional.empty();
    if (!(node instanceof PatternRecognitionNode)) {
        return result;
    }
    PatternRecognitionNode patternRecognitionNode = (PatternRecognitionNode) node;
    Measure expectedMeasure = new Measure(rewrite(expression, subsets), type);
    for (Map.Entry<Symbol, Measure> assignment : patternRecognitionNode.getMeasures().entrySet()) {
        Measure actualMeasure = assignment.getValue();
        if (measuresEquivalent(actualMeasure, expectedMeasure, symbolAliases)) {
            checkState(result.isEmpty(), "Ambiguous measures in %s", patternRecognitionNode);
            result = Optional.of(assignment.getKey());
        }
    }
    return result;
}
Also used : PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) Symbol(io.trino.sql.planner.Symbol) Measure(io.trino.sql.planner.plan.PatternRecognitionNode.Measure) Map(java.util.Map)

Example 7 with PatternRecognitionNode

use of io.trino.sql.planner.plan.PatternRecognitionNode in project trino by trinodb.

the class PatternRecognitionMatcher method detailMatches.

@Override
public MatchResult detailMatches(PlanNode node, StatsProvider stats, Session session, Metadata metadata, SymbolAliases symbolAliases) {
    checkState(shapeMatches(node), "Plan testing framework error: shapeMatches returned false in detailMatches in %s", this.getClass().getName());
    PatternRecognitionNode patternRecognitionNode = (PatternRecognitionNode) node;
    boolean specificationMatches = specification.map(expected -> expected.getExpectedValue(symbolAliases).equals(patternRecognitionNode.getSpecification())).orElse(true);
    if (!specificationMatches) {
        return NO_MATCH;
    }
    if (frame.isPresent()) {
        if (patternRecognitionNode.getCommonBaseFrame().isEmpty()) {
            return NO_MATCH;
        }
        if (!frame.get().getExpectedValue(symbolAliases).equals(patternRecognitionNode.getCommonBaseFrame().get())) {
            return NO_MATCH;
        }
    }
    if (rowsPerMatch != patternRecognitionNode.getRowsPerMatch()) {
        return NO_MATCH;
    }
    if (!skipToLabel.equals(patternRecognitionNode.getSkipToLabel())) {
        return NO_MATCH;
    }
    if (skipToPosition != patternRecognitionNode.getSkipToPosition()) {
        return NO_MATCH;
    }
    if (initial != patternRecognitionNode.isInitial()) {
        return NO_MATCH;
    }
    if (!pattern.equals(patternRecognitionNode.getPattern())) {
        return NO_MATCH;
    }
    if (!subsets.equals(patternRecognitionNode.getSubsets())) {
        return NO_MATCH;
    }
    if (variableDefinitions.size() != patternRecognitionNode.getVariableDefinitions().size()) {
        return NO_MATCH;
    }
    for (Map.Entry<IrLabel, ExpressionAndValuePointers> entry : variableDefinitions.entrySet()) {
        IrLabel name = entry.getKey();
        ExpressionAndValuePointers actual = patternRecognitionNode.getVariableDefinitions().get(name);
        if (actual == null) {
            return NO_MATCH;
        }
        ExpressionAndValuePointers expected = entry.getValue();
        ExpressionVerifier verifier = new ExpressionVerifier(symbolAliases);
        if (!ExpressionAndValuePointersEquivalence.equivalent(actual, expected, (actualSymbol, expectedSymbol) -> verifier.process(actualSymbol.toSymbolReference(), expectedSymbol.toSymbolReference()))) {
            return NO_MATCH;
        }
    }
    return match();
}
Also used : SkipTo(io.trino.sql.tree.SkipTo) Type(io.trino.spi.type.Type) HashMap(java.util.HashMap) PlanNode(io.trino.sql.planner.plan.PlanNode) ONE(io.trino.sql.tree.PatternRecognitionRelation.RowsPerMatch.ONE) Map(java.util.Map) Objects.requireNonNull(java.util.Objects.requireNonNull) LinkedList(java.util.LinkedList) FunctionCall(io.trino.sql.tree.FunctionCall) ExpressionAndValuePointers(io.trino.sql.planner.rowpattern.LogicalIndexExtractor.ExpressionAndValuePointers) PatternRecognitionExpressionRewriter.rewrite(io.trino.sql.planner.assertions.PatternRecognitionExpressionRewriter.rewrite) RowsPerMatch(io.trino.sql.tree.PatternRecognitionRelation.RowsPerMatch) MatchResult.match(io.trino.sql.planner.assertions.MatchResult.match) ImmutableMap(com.google.common.collect.ImmutableMap) IrLabel(io.trino.sql.planner.rowpattern.ir.IrLabel) ExpressionAndValuePointersEquivalence(io.trino.sql.planner.rowpattern.ExpressionAndValuePointersEquivalence) Set(java.util.Set) PAST_LAST(io.trino.sql.tree.SkipTo.Position.PAST_LAST) StatsProvider(io.trino.cost.StatsProvider) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) Preconditions.checkState(com.google.common.base.Preconditions.checkState) PlanMatchPattern.node(io.trino.sql.planner.assertions.PlanMatchPattern.node) AbstractMap(java.util.AbstractMap) List(java.util.List) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) Metadata(io.trino.metadata.Metadata) IrRowPattern(io.trino.sql.planner.rowpattern.ir.IrRowPattern) Optional(java.util.Optional) NO_MATCH(io.trino.sql.planner.assertions.MatchResult.NO_MATCH) Expression(io.trino.sql.tree.Expression) WindowNode(io.trino.sql.planner.plan.WindowNode) Session(io.trino.Session) MoreObjects.toStringHelper(com.google.common.base.MoreObjects.toStringHelper) IrLabel(io.trino.sql.planner.rowpattern.ir.IrLabel) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) ExpressionAndValuePointers(io.trino.sql.planner.rowpattern.LogicalIndexExtractor.ExpressionAndValuePointers) HashMap(java.util.HashMap) Map(java.util.Map) ImmutableMap(com.google.common.collect.ImmutableMap) AbstractMap(java.util.AbstractMap) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap)

Example 8 with PatternRecognitionNode

use of io.trino.sql.planner.plan.PatternRecognitionNode in project trino by trinodb.

the class MergePatternRecognitionNodes method extractPrerequisites.

/**
 * Extract project assignments producing symbols used by the PatternRecognitionNode's
 * window functions and measures. Exclude identity assignments.
 */
private static Assignments extractPrerequisites(PatternRecognitionNode node, ProjectNode project) {
    Assignments assignments = project.getAssignments();
    ImmutableSet.Builder<Symbol> inputsBuilder = ImmutableSet.builder();
    node.getWindowFunctions().values().stream().map(SymbolsExtractor::extractAll).forEach(inputsBuilder::addAll);
    node.getMeasures().values().stream().map(Measure::getExpressionAndValuePointers).map(ExpressionAndValuePointers::getInputSymbols).forEach(inputsBuilder::addAll);
    Set<Symbol> inputs = inputsBuilder.build();
    return assignments.filter(symbol -> !assignments.isIdentity(symbol)).filter(inputs::contains);
}
Also used : Measure(io.trino.sql.planner.plan.PatternRecognitionNode.Measure) Capture.newCapture(io.trino.matching.Capture.newCapture) PlanNode(io.trino.sql.planner.plan.PlanNode) ImmutableList(com.google.common.collect.ImmutableList) Map(java.util.Map) Rule(io.trino.sql.planner.iterative.Rule) SymbolsExtractor(io.trino.sql.planner.SymbolsExtractor) ProjectNode(io.trino.sql.planner.plan.ProjectNode) ExpressionAndValuePointers(io.trino.sql.planner.rowpattern.LogicalIndexExtractor.ExpressionAndValuePointers) Symbol(io.trino.sql.planner.Symbol) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) IrLabel(io.trino.sql.planner.rowpattern.ir.IrLabel) ExpressionAndValuePointersEquivalence(io.trino.sql.planner.rowpattern.ExpressionAndValuePointersEquivalence) Collection(java.util.Collection) Assignments(io.trino.sql.planner.plan.Assignments) Function(io.trino.sql.planner.plan.WindowNode.Function) Set(java.util.Set) Streams(com.google.common.collect.Streams) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) Capture(io.trino.matching.Capture) Patterns.patternRecognition(io.trino.sql.planner.plan.Patterns.patternRecognition) Pattern(io.trino.matching.Pattern) Patterns.source(io.trino.sql.planner.plan.Patterns.source) Captures(io.trino.matching.Captures) Util.restrictOutputs(io.trino.sql.planner.iterative.rule.Util.restrictOutputs) Patterns.project(io.trino.sql.planner.plan.Patterns.project) ImmutableSet(com.google.common.collect.ImmutableSet) Symbol(io.trino.sql.planner.Symbol) Assignments(io.trino.sql.planner.plan.Assignments) Measure(io.trino.sql.planner.plan.PatternRecognitionNode.Measure)

Example 9 with PatternRecognitionNode

use of io.trino.sql.planner.plan.PatternRecognitionNode in project trino by trinodb.

the class PrunePattenRecognitionColumns method pushDownProjectOff.

@Override
protected Optional<PlanNode> pushDownProjectOff(Context context, PatternRecognitionNode patternRecognitionNode, Set<Symbol> referencedOutputs) {
    Map<Symbol, Function> referencedFunctions = filterKeys(patternRecognitionNode.getWindowFunctions(), referencedOutputs::contains);
    Map<Symbol, Measure> referencedMeasures = filterKeys(patternRecognitionNode.getMeasures(), referencedOutputs::contains);
    if (referencedFunctions.isEmpty() && referencedMeasures.isEmpty() && passesAllRows(patternRecognitionNode)) {
        return Optional.of(patternRecognitionNode.getSource());
    }
    // TODO prune unreferenced variable definitions when we have pattern transformations that delete parts of the pattern
    ImmutableSet.Builder<Symbol> referencedInputs = ImmutableSet.builder();
    patternRecognitionNode.getSource().getOutputSymbols().stream().filter(referencedOutputs::contains).forEach(referencedInputs::add);
    referencedInputs.addAll(patternRecognitionNode.getPartitionBy());
    patternRecognitionNode.getOrderingScheme().ifPresent(orderingScheme -> referencedInputs.addAll(orderingScheme.getOrderBy()));
    patternRecognitionNode.getHashSymbol().ifPresent(referencedInputs::add);
    referencedFunctions.values().stream().map(SymbolsExtractor::extractUnique).forEach(referencedInputs::addAll);
    referencedMeasures.values().stream().map(Measure::getExpressionAndValuePointers).map(ExpressionAndValuePointers::getInputSymbols).forEach(referencedInputs::addAll);
    patternRecognitionNode.getCommonBaseFrame().flatMap(Frame::getEndValue).ifPresent(referencedInputs::add);
    patternRecognitionNode.getVariableDefinitions().values().stream().map(ExpressionAndValuePointers::getInputSymbols).forEach(referencedInputs::addAll);
    Optional<PlanNode> prunedSource = restrictOutputs(context.getIdAllocator(), patternRecognitionNode.getSource(), referencedInputs.build());
    if (prunedSource.isEmpty() && referencedFunctions.size() == patternRecognitionNode.getWindowFunctions().size() && referencedMeasures.size() == patternRecognitionNode.getMeasures().size()) {
        return Optional.empty();
    }
    return Optional.of(new PatternRecognitionNode(patternRecognitionNode.getId(), prunedSource.orElse(patternRecognitionNode.getSource()), patternRecognitionNode.getSpecification(), patternRecognitionNode.getHashSymbol(), patternRecognitionNode.getPrePartitionedInputs(), patternRecognitionNode.getPreSortedOrderPrefix(), referencedFunctions, referencedMeasures, patternRecognitionNode.getCommonBaseFrame(), patternRecognitionNode.getRowsPerMatch(), patternRecognitionNode.getSkipToLabel(), patternRecognitionNode.getSkipToPosition(), patternRecognitionNode.isInitial(), patternRecognitionNode.getPattern(), patternRecognitionNode.getSubsets(), patternRecognitionNode.getVariableDefinitions()));
}
Also used : Function(io.trino.sql.planner.plan.WindowNode.Function) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) PlanNode(io.trino.sql.planner.plan.PlanNode) ImmutableSet(com.google.common.collect.ImmutableSet) Symbol(io.trino.sql.planner.Symbol) Measure(io.trino.sql.planner.plan.PatternRecognitionNode.Measure)

Example 10 with PatternRecognitionNode

use of io.trino.sql.planner.plan.PatternRecognitionNode in project trino by trinodb.

the class RelationPlanner method visitPatternRecognitionRelation.

@Override
protected RelationPlan visitPatternRecognitionRelation(PatternRecognitionRelation node, Void context) {
    RelationPlan subPlan = process(node.getInput(), context);
    // Pre-project inputs for PARTITION BY and ORDER BY
    List<Expression> inputs = ImmutableList.<Expression>builder().addAll(node.getPartitionBy()).addAll(getSortItemsFromOrderBy(node.getOrderBy()).stream().map(SortItem::getSortKey).collect(toImmutableList())).build();
    PlanBuilder planBuilder = newPlanBuilder(subPlan, analysis, lambdaDeclarationToSymbolMap);
    // no handleSubqueries because subqueries are not allowed here
    planBuilder = planBuilder.appendProjections(inputs, symbolAllocator, idAllocator);
    ImmutableList.Builder<Symbol> outputLayout = ImmutableList.builder();
    boolean oneRowOutput = node.getRowsPerMatch().isEmpty() || node.getRowsPerMatch().get().isOneRow();
    WindowNode.Specification specification = planWindowSpecification(node.getPartitionBy(), node.getOrderBy(), planBuilder::translate);
    outputLayout.addAll(specification.getPartitionBy());
    if (!oneRowOutput) {
        getSortItemsFromOrderBy(node.getOrderBy()).stream().map(SortItem::getSortKey).map(planBuilder::translate).forEach(outputLayout::add);
    }
    planBuilder = subqueryPlanner.handleSubqueries(planBuilder, extractPatternRecognitionExpressions(node.getVariableDefinitions(), node.getMeasures()), analysis.getSubqueries(node));
    PatternRecognitionComponents components = planPatternRecognitionComponents(planBuilder::rewrite, node.getSubsets(), node.getMeasures(), node.getAfterMatchSkipTo(), node.getPatternSearchMode(), node.getPattern(), node.getVariableDefinitions());
    outputLayout.addAll(components.getMeasureOutputs());
    if (!oneRowOutput) {
        Set<Symbol> inputSymbolsOnOutput = ImmutableSet.copyOf(outputLayout.build());
        subPlan.getFieldMappings().stream().filter(symbol -> !inputSymbolsOnOutput.contains(symbol)).forEach(outputLayout::add);
    }
    PatternRecognitionNode planNode = new PatternRecognitionNode(idAllocator.getNextId(), planBuilder.getRoot(), specification, Optional.empty(), ImmutableSet.of(), 0, ImmutableMap.of(), components.getMeasures(), Optional.empty(), node.getRowsPerMatch().orElse(ONE), components.getSkipToLabel(), components.getSkipToPosition(), components.isInitial(), components.getPattern(), components.getSubsets(), components.getVariableDefinitions());
    return new RelationPlan(planNode, analysis.getScope(node), outputLayout.build(), outerContext);
}
Also used : ListMultimap(com.google.common.collect.ListMultimap) SubsetDefinition(io.trino.sql.tree.SubsetDefinition) CorrelatedJoinNode(io.trino.sql.planner.plan.CorrelatedJoinNode) PlanNode(io.trino.sql.planner.plan.PlanNode) SetOperation(io.trino.sql.tree.SetOperation) Values(io.trino.sql.tree.Values) NOT_SUPPORTED(io.trino.spi.StandardErrorCode.NOT_SUPPORTED) AliasedRelation(io.trino.sql.tree.AliasedRelation) Node(io.trino.sql.tree.Node) ONE(io.trino.sql.tree.PatternRecognitionRelation.RowsPerMatch.ONE) Map(java.util.Map) RowPattern(io.trino.sql.tree.RowPattern) Union(io.trino.sql.tree.Union) SemanticExceptions.semanticException(io.trino.sql.analyzer.SemanticExceptions.semanticException) ENGLISH(java.util.Locale.ENGLISH) TableScanNode(io.trino.sql.planner.plan.TableScanNode) Identifier(io.trino.sql.tree.Identifier) Lateral(io.trino.sql.tree.Lateral) SampledRelation(io.trino.sql.tree.SampledRelation) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) Assignments(io.trino.sql.planner.plan.Assignments) Join(io.trino.sql.tree.Join) Set(java.util.Set) PAST_LAST(io.trino.sql.tree.SkipTo.Position.PAST_LAST) SortItem(io.trino.sql.tree.SortItem) NodeUtils.getSortItemsFromOrderBy(io.trino.sql.NodeUtils.getSortItemsFromOrderBy) RelationType(io.trino.sql.analyzer.RelationType) IntersectNode(io.trino.sql.planner.plan.IntersectNode) ImmutableMap.toImmutableMap(com.google.common.collect.ImmutableMap.toImmutableMap) QueryPlanner.pruneInvisibleFields(io.trino.sql.planner.QueryPlanner.pruneInvisibleFields) PlanBuilder.newPlanBuilder(io.trino.sql.planner.PlanBuilder.newPlanBuilder) ImmutableListMultimap(com.google.common.collect.ImmutableListMultimap) IrRowPattern(io.trino.sql.planner.rowpattern.ir.IrRowPattern) ValuesNode(io.trino.sql.planner.plan.ValuesNode) TRUE(java.lang.Boolean.TRUE) Session(io.trino.Session) SkipTo(io.trino.sql.tree.SkipTo) TypeCoercion(io.trino.type.TypeCoercion) ArrayList(java.util.ArrayList) LinkedHashMap(java.util.LinkedHashMap) NodeRef(io.trino.sql.tree.NodeRef) INNER(io.trino.sql.tree.Join.Type.INNER) ColumnHandle(io.trino.spi.connector.ColumnHandle) AggregationNode(io.trino.sql.planner.plan.AggregationNode) ImmutableSet.toImmutableSet(com.google.common.collect.ImmutableSet.toImmutableSet) Query(io.trino.sql.tree.Query) ExpressionUtils(io.trino.sql.ExpressionUtils) Relation(io.trino.sql.tree.Relation) IrLabel(io.trino.sql.planner.rowpattern.ir.IrLabel) PatternRecognitionRelation(io.trino.sql.tree.PatternRecognitionRelation) Iterables.getOnlyElement(com.google.common.collect.Iterables.getOnlyElement) UnnestNode(io.trino.sql.planner.plan.UnnestNode) AggregationNode.singleGroupingSet(io.trino.sql.planner.plan.AggregationNode.singleGroupingSet) TableHandle(io.trino.metadata.TableHandle) ExceptNode(io.trino.sql.planner.plan.ExceptNode) RowPatternToIrRewriter(io.trino.sql.planner.rowpattern.RowPatternToIrRewriter) Table(io.trino.sql.tree.Table) SampleNode(io.trino.sql.planner.plan.SampleNode) MeasureDefinition(io.trino.sql.tree.MeasureDefinition) Intersect(io.trino.sql.tree.Intersect) Scope(io.trino.sql.analyzer.Scope) FilterNode(io.trino.sql.planner.plan.FilterNode) LambdaArgumentDeclaration(io.trino.sql.tree.LambdaArgumentDeclaration) Preconditions.checkArgument(com.google.common.base.Preconditions.checkArgument) IMPLICIT(io.trino.sql.tree.Join.Type.IMPLICIT) UnnestAnalysis(io.trino.sql.analyzer.Analysis.UnnestAnalysis) QueryPlanner.coerce(io.trino.sql.planner.QueryPlanner.coerce) TableSubquery(io.trino.sql.tree.TableSubquery) JoinNode(io.trino.sql.planner.plan.JoinNode) QueryPlanner.planWindowSpecification(io.trino.sql.planner.QueryPlanner.planWindowSpecification) QuerySpecification(io.trino.sql.tree.QuerySpecification) RowType(io.trino.spi.type.RowType) ImmutableSet(com.google.common.collect.ImmutableSet) QueryPlanner.coerceIfNecessary(io.trino.sql.planner.QueryPlanner.coerceIfNecessary) ImmutableMap(com.google.common.collect.ImmutableMap) TypeSignatureTranslator.toSqlType(io.trino.sql.analyzer.TypeSignatureTranslator.toSqlType) VariableDefinition(io.trino.sql.tree.VariableDefinition) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) ComparisonExpression(io.trino.sql.tree.ComparisonExpression) CROSS(io.trino.sql.tree.Join.Type.CROSS) INITIAL(io.trino.sql.tree.PatternSearchMode.Mode.INITIAL) CoalesceExpression(io.trino.sql.tree.CoalesceExpression) List(java.util.List) PatternSearchMode(io.trino.sql.tree.PatternSearchMode) NaturalJoin(io.trino.sql.tree.NaturalJoin) Optional(java.util.Optional) Expression(io.trino.sql.tree.Expression) WindowNode(io.trino.sql.planner.plan.WindowNode) PlannerContext(io.trino.sql.PlannerContext) Analysis(io.trino.sql.analyzer.Analysis) UnionNode(io.trino.sql.planner.plan.UnionNode) SubqueryExpression(io.trino.sql.tree.SubqueryExpression) Type(io.trino.spi.type.Type) Measure(io.trino.sql.planner.plan.PatternRecognitionNode.Measure) HashMap(java.util.HashMap) Unnest(io.trino.sql.tree.Unnest) Function(java.util.function.Function) Cast(io.trino.sql.tree.Cast) ImmutableList(com.google.common.collect.ImmutableList) Objects.requireNonNull(java.util.Objects.requireNonNull) Field(io.trino.sql.analyzer.Field) ProjectNode(io.trino.sql.planner.plan.ProjectNode) ExpressionAndValuePointers(io.trino.sql.planner.rowpattern.LogicalIndexExtractor.ExpressionAndValuePointers) AstVisitor(io.trino.sql.tree.AstVisitor) JoinUsing(io.trino.sql.tree.JoinUsing) Except(io.trino.sql.tree.Except) LogicalIndexExtractor(io.trino.sql.planner.rowpattern.LogicalIndexExtractor) TRUE_LITERAL(io.trino.sql.tree.BooleanLiteral.TRUE_LITERAL) QualifiedName(io.trino.sql.tree.QualifiedName) QueryPlanner.extractPatternRecognitionExpressions(io.trino.sql.planner.QueryPlanner.extractPatternRecognitionExpressions) Row(io.trino.sql.tree.Row) JoinCriteria(io.trino.sql.tree.JoinCriteria) WindowNode(io.trino.sql.planner.plan.WindowNode) ImmutableList.toImmutableList(com.google.common.collect.ImmutableList.toImmutableList) ImmutableList(com.google.common.collect.ImmutableList) PlanBuilder.newPlanBuilder(io.trino.sql.planner.PlanBuilder.newPlanBuilder) SortItem(io.trino.sql.tree.SortItem) PatternRecognitionNode(io.trino.sql.planner.plan.PatternRecognitionNode) ComparisonExpression(io.trino.sql.tree.ComparisonExpression) CoalesceExpression(io.trino.sql.tree.CoalesceExpression) Expression(io.trino.sql.tree.Expression) SubqueryExpression(io.trino.sql.tree.SubqueryExpression)

Aggregations

PatternRecognitionNode (io.trino.sql.planner.plan.PatternRecognitionNode)10 Symbol (io.trino.sql.planner.Symbol)6 Measure (io.trino.sql.planner.plan.PatternRecognitionNode.Measure)6 WindowNode (io.trino.sql.planner.plan.WindowNode)5 ExpressionAndValuePointers (io.trino.sql.planner.rowpattern.LogicalIndexExtractor.ExpressionAndValuePointers)5 IrLabel (io.trino.sql.planner.rowpattern.ir.IrLabel)5 Map (java.util.Map)5 ImmutableMap (com.google.common.collect.ImmutableMap)4 PlanNode (io.trino.sql.planner.plan.PlanNode)4 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 Assignments (io.trino.sql.planner.plan.Assignments)3 ProjectNode (io.trino.sql.planner.plan.ProjectNode)3 Function (io.trino.sql.planner.plan.WindowNode.Function)3 ImmutableList (com.google.common.collect.ImmutableList)2 Session (io.trino.Session)2 ResolvedFunction (io.trino.metadata.ResolvedFunction)2 Type (io.trino.spi.type.Type)2 PlanBuilder.newPlanBuilder (io.trino.sql.planner.PlanBuilder.newPlanBuilder)2 PatternRecognitionComponents (io.trino.sql.planner.RelationPlanner.PatternRecognitionComponents)2