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
-
public class LabelDereference extends Expression
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
Constructors Constructor Description LabelDereference(String label, SymbolReference reference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,C>
Raccept(AstVisitor<R,C> visitor, C context)Accessible forAstVisitor, useAstVisitor.process(Node, Object)instead.booleanequals(Object o)List<Node>getChildren()StringgetLabel()SymbolReferencegetReference()inthashCode()-
Methods inherited from class io.trino.sql.tree.Expression
toString
-
Methods inherited from class io.trino.sql.tree.Node
getLocation, shallowEquals
-
-
-
-
Constructor Detail
-
LabelDereference
public LabelDereference(String label, SymbolReference reference)
-
-
Method Detail
-
getLabel
public String getLabel()
-
getReference
public SymbolReference getReference()
-
accept
public <R,C> R accept(AstVisitor<R,C> visitor, C context)
Description copied from class:ExpressionAccessible forAstVisitor, useAstVisitor.process(Node, Object)instead.- Overrides:
acceptin classExpression
-
getChildren
public List<Node> getChildren()
- Specified by:
getChildrenin classNode
-
-