Package io.trino.sql.planner.rowpattern
Class LogicalIndexExtractor
- java.lang.Object
-
- io.trino.sql.planner.rowpattern.LogicalIndexExtractor
-
public class LogicalIndexExtractor extends Object
Rewriter for expressions specific to row pattern recognition. Removes label-prefixed symbol references from the expression and replaces them with symbols. Removes row pattern navigation functions (PREV, NEXT, FIRST and LAST) from the expression. Removes pattern special functions CLASSIFIER() and MATCH_NUMBER() and replaces them with symbols. Reallocates all symbols in the expression to avoid unwanted optimizations when the expression is compiled. For each of the symbols creates a value accessor (ValuePointer). Returns new symbols as expected "input descriptor", upon which the rewritten expression will be compiled, along with value accessors. Value accessors are ordered the same way as the corresponding symbols so that they can be used to provide actual values to the compiled expression. Each time the compiled expression will be executed, a single-row input will be prepared with the use of the value accessors, following the symbols layout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLogicalIndexExtractor.ExpressionAndValuePointersstatic classLogicalIndexExtractor.ValuePointer
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static LogicalIndexExtractor.ExpressionAndValuePointersrewrite(Expression expression, Map<IrLabel,Set<IrLabel>> subsets, SymbolAllocator symbolAllocator)
-
-
-
Method Detail
-
rewrite
public static LogicalIndexExtractor.ExpressionAndValuePointers rewrite(Expression expression, Map<IrLabel,Set<IrLabel>> subsets, SymbolAllocator symbolAllocator)
-
-