Package io.trino.sql.tree
Class BindExpression
- java.lang.Object
-
- io.trino.sql.tree.Node
-
- io.trino.sql.tree.Expression
-
- io.trino.sql.tree.BindExpression
-
public class BindExpression extends Expression
"$INTERNAL$BIND"(value, targetFunction)When invoked, the returned function inserts the given value as the leading argument to the targetFunction. The other arguments are passed unchanged.
Bind is fundamentally first class, just like function applications. It requires special treatment from the type system. There is no way to write out the type of `bind`. The return type of `bind` is function. Its type looks somewhat like:
- X, (X) -> Y => () -> Y
- X1, (X1, X2) -> Y => (X2) -> Y
- X1, (X1, X2, X3) -> Y => (X2, X3) -> Y
- X1, (X1, X2, X3, X4) -> Y => (X2, X3, X4) -> Y
- ...
Lambda capturing is implemented through desugaring in Trino. This expression facilitates desugaring.
-
-
Constructor Summary
Constructors Constructor Description BindExpression(NodeLocation location, List<Expression> values, Expression function)BindExpression(List<Expression> values, Expression function)
-
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()ExpressiongetFunction()List<Expression>getValues()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
toString
-
Methods inherited from class io.trino.sql.tree.Node
getLocation
-
-
-
-
Constructor Detail
-
BindExpression
public BindExpression(List<Expression> values, Expression function)
-
BindExpression
public BindExpression(NodeLocation location, List<Expression> values, Expression function)
-
-
Method Detail
-
getValues
public List<Expression> getValues()
-
getFunction
public Expression getFunction()
-
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
-
shallowEquals
public boolean shallowEquals(Node other)
Description copied from class:NodeCompare with another node by considering internal state excluding any Node returned by getChildren()- Overrides:
shallowEqualsin classNode
-
-