Package io.trino.sql.tree
Class LabelDereference
java.lang.Object
io.trino.sql.tree.Node
io.trino.sql.tree.Expression
io.trino.sql.tree.LabelDereference
A temporary IR representation of a label-prefixed column reference
in the context of row pattern recognition.
It is created from a DereferenceExpression when the MEASURES or DEFINE expressions are rewritten using the TranslationMap: A.price -> DereferenceExpression("A", "price") -> LabelDereference("A", price_symbol). Next, the LabelDereference is processed by the LogicalIndexExtractor, and it is removed from the expression.
LabelDereference is a synthetic AST node. It had to be introduced in order to carry the rewritten symbol (`price_symbol` in the example). The DereferenceExpression cannot be used for that purpose, because it only contains identifiers, and a Symbol cannot be safely converted to an Identifier.
-
Constructor Summary
ConstructorsConstructorDescriptionLabelDereference(String label) LabelDereference(String label, SymbolReference reference) LabelDereference(String label, Optional<SymbolReference> reference) -
Method Summary
Modifier and TypeMethodDescription<R,C> R accept(AstVisitor<R, C> visitor, C context) Accessible forAstVisitor, useAstVisitor.process(Node, Object)instead.booleangetLabel()inthashCode()booleanshallowEquals(Node other) Compare with another node by considering internal state excluding any Node returned by getChildren()Methods inherited from class io.trino.sql.tree.Expression
toStringMethods inherited from class io.trino.sql.tree.Node
getLocation
-
Constructor Details
-
LabelDereference
-
LabelDereference
-
LabelDereference
-
-
Method Details
-
getLabel
-
getReference
-
accept
Description copied from class:ExpressionAccessible forAstVisitor, useAstVisitor.process(Node, Object)instead.- Overrides:
acceptin classExpression
-
getChildren
- Specified by:
getChildrenin classNode
-
equals
-
hashCode
public int hashCode() -
shallowEquals
Description copied from class:NodeCompare with another node by considering internal state excluding any Node returned by getChildren()- Overrides:
shallowEqualsin classNode
-