Package io.substrait.relation
Class ImmutableTransformExpression
java.lang.Object
io.substrait.relation.AbstractUpdate.TransformExpression
io.substrait.relation.ImmutableTransformExpression
Immutable implementation of
AbstractUpdate.TransformExpression.
Use the builder to create immutable instances:
ImmutableTransformExpression.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableTransformExpression. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableTransformExpression.static ImmutableTransformExpressioncopyOf(AbstractUpdate.TransformExpression instance) Creates an immutable copy of aAbstractUpdate.TransformExpressionvalue.booleanThis instance is equal to all instances ofImmutableTransformExpressionthat have equal attribute values.intReturns the index of the target column to update.Returns the expression that computes the new value for the column.inthashCode()Computes a hash code from attributes:transformation,columnTarget.toString()Prints the immutable valueTransformExpressionwith attribute values.withColumnTarget(int value) Copy the current immutable object by setting a value for thecolumnTargetattribute.withTransformation(Expression value) Copy the current immutable object by setting a value for thetransformationattribute.
-
Method Details
-
getTransformation
Returns the expression that computes the new value for the column.- Specified by:
getTransformationin classAbstractUpdate.TransformExpression- Returns:
- transformation expression
-
getColumnTarget
public int getColumnTarget()Returns the index of the target column to update.- Specified by:
getColumnTargetin classAbstractUpdate.TransformExpression- Returns:
- column index
-
withTransformation
Copy the current immutable object by setting a value for thetransformationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for transformation- Returns:
- A modified copy or the
thisobject
-
withColumnTarget
Copy the current immutable object by setting a value for thecolumnTargetattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for columnTarget- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableTransformExpressionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:transformation,columnTarget. -
toString
Prints the immutable valueTransformExpressionwith attribute values. -
copyOf
Creates an immutable copy of aAbstractUpdate.TransformExpressionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable TransformExpression instance
-
builder
Creates a builder forImmutableTransformExpression.ImmutableTransformExpression.builder() .transformation(io.substrait.expression.Expression) // requiredtransformation.columnTarget(int) // requiredcolumnTarget.build();- Returns:
- A new ImmutableTransformExpression builder
-