Package io.trino.sql.ir
Record Class Bind
java.lang.Object
java.lang.Record
io.trino.sql.ir.Bind
- All Implemented Interfaces:
Expression
Bind(values, targetFunction)
When invoked, the returned function inserts the given values as the leading arguments 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
ConstructorsConstructorDescriptionBind(List<Expression> values, Lambda function) Creates an instance of aBindrecord class. -
Method Summary
Modifier and TypeMethodDescription<R,C> R Accessible forIrVisitor, useIrVisitor.process(Expression, Object)instead.List<? extends Expression> children()final booleanIndicates whether some other object is "equal to" this one.function()Returns the value of thefunctionrecord component.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.type()values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
Bind
Creates an instance of aBindrecord class.- Parameters:
values- the value for thevaluesrecord componentfunction- the value for thefunctionrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceExpression
-
accept
Description copied from interface:ExpressionAccessible forIrVisitor, useIrVisitor.process(Expression, Object)instead.- Specified by:
acceptin interfaceExpression
-
children
- Specified by:
childrenin interfaceExpression
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-