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
"$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
ConstructorsConstructorDescriptionBindExpression(NodeLocation location, List<Expression> values, Expression function) BindExpression(List<Expression> values, Expression function) -
Method Summary
Modifier and TypeMethodDescription<R,C> R accept(AstVisitor<R, C> visitor, C context) Accessible forAstVisitor, useAstVisitor.process(Node, Object)instead.booleaninthashCode()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
-
BindExpression
-
BindExpression
-
-
Method Details
-
getValues
-
getFunction
-
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
-