Package io.substrait.relation
Class ImmutableExtensionWrite
java.lang.Object
io.substrait.relation.AbstractRel
io.substrait.relation.SingleInputRel
io.substrait.relation.AbstractWriteRel
io.substrait.relation.ExtensionWrite
io.substrait.relation.ImmutableExtensionWrite
- All Implemented Interfaces:
HasExtension,Rel
Immutable implementation of
ExtensionWrite.
Use the builder to create immutable instances:
ImmutableExtensionWrite.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableExtensionWrite.Nested classes/interfaces inherited from class io.substrait.relation.AbstractWriteRel
AbstractWriteRel.CreateMode, AbstractWriteRel.OutputMode, AbstractWriteRel.WriteOp -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableExtensionWrite.static ImmutableExtensionWritecopyOf(ExtensionWrite instance) Creates an immutable copy of aExtensionWritevalue.booleanThis instance is equal to all instances ofImmutableExtensionWritethat have equal attribute values.Returns the table creation behavior when the target exists.getHint()getInput()Returns the write operation (insert/delete/update/ctas).Returns the output behavior of the write (e.g., rows returned).getRemap()Returns the target table schema (names + types).inthashCode()Computes a hash code from attributes:extension,remap,commonExtension,hint,input,tableSchema,operation,createMode,outputMode,detail.toString()Prints the immutable valueExtensionWritewith attribute values.final ImmutableExtensionWriteCopy the current immutable object by setting a present value for the optionalcommonExtensionattribute.final ImmutableExtensionWritewithCommonExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for thecommonExtensionattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a value for thecreateModeattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a value for thedetailattribute.final ImmutableExtensionWritewithExtension(AdvancedExtension value) Copy the current immutable object by setting a present value for the optionalextensionattribute.final ImmutableExtensionWritewithExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theextensionattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a present value for the optionalhintattribute.final ImmutableExtensionWriteCopy the current immutable object by setting an optional value for thehintattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a value for theinputattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a value for theoperationattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a value for theoutputModeattribute.final ImmutableExtensionWriteCopy the current immutable object by setting a present value for the optionalremapattribute.final ImmutableExtensionWriteCopy the current immutable object by setting an optional value for theremapattribute.final ImmutableExtensionWritewithTableSchema(NamedStruct value) Copy the current immutable object by setting a value for thetableSchemaattribute.Methods inherited from class io.substrait.relation.ExtensionWrite
acceptMethods inherited from class io.substrait.relation.AbstractWriteRel
deriveRecordTypeMethods inherited from class io.substrait.relation.SingleInputRel
getInputsMethods inherited from class io.substrait.relation.AbstractRel
getRecordType
-
Method Details
-
getExtension
- Returns:
- the
AdvancedExtensionassociated directly with the class
-
getRemap
- Returns:
- The value of the
remapattribute
-
getCommonExtension
- Returns:
- the
AdvancedExtensionassociated with aRelCommonmessage, if present
-
getHint
- Returns:
- The value of the
hintattribute
-
getInput
- Specified by:
getInputin classSingleInputRel- Returns:
- The value of the
inputattribute
-
getTableSchema
Returns the target table schema (names + types).- Specified by:
getTableSchemain classAbstractWriteRel- Returns:
- target table
NamedStruct
-
getOperation
Returns the write operation (insert/delete/update/ctas).- Specified by:
getOperationin classAbstractWriteRel- Returns:
- write operation
-
getCreateMode
Returns the table creation behavior when the target exists.- Specified by:
getCreateModein classAbstractWriteRel- Returns:
- create mode
-
getOutputMode
Returns the output behavior of the write (e.g., rows returned).- Specified by:
getOutputModein classAbstractWriteRel- Returns:
- output mode
-
getDetail
- Specified by:
getDetailin classExtensionWrite- Returns:
- The value of the
detailattribute
-
withExtension
Copy the current immutable object by setting a present value for the optionalextensionattribute.- Parameters:
value- The value for extension- Returns:
- A modified copy or
thisif not changed
-
withExtension
Copy the current immutable object by setting an optional value for theextensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for extension- Returns:
- A modified copy or
thisif not changed
-
withRemap
Copy the current immutable object by setting a present value for the optionalremapattribute.- Parameters:
value- The value for remap- Returns:
- A modified copy or
thisif not changed
-
withRemap
Copy the current immutable object by setting an optional value for theremapattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for remap- Returns:
- A modified copy or
thisif not changed
-
withCommonExtension
Copy the current immutable object by setting a present value for the optionalcommonExtensionattribute.- Parameters:
value- The value for commonExtension- Returns:
- A modified copy or
thisif not changed
-
withCommonExtension
public final ImmutableExtensionWrite withCommonExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for thecommonExtensionattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for commonExtension- Returns:
- A modified copy or
thisif not changed
-
withHint
Copy the current immutable object by setting a present value for the optionalhintattribute.- Parameters:
value- The value for hint- Returns:
- A modified copy or
thisif not changed
-
withHint
Copy the current immutable object by setting an optional value for thehintattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- An optional value for hint- Returns:
- A modified copy or
thisif not changed
-
withInput
Copy the current immutable object by setting a value for theinputattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for input- Returns:
- A modified copy or the
thisobject
-
withTableSchema
Copy the current immutable object by setting a value for thetableSchemaattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tableSchema- Returns:
- A modified copy or the
thisobject
-
withOperation
Copy the current immutable object by setting a value for theoperationattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for operation- Returns:
- A modified copy or the
thisobject
-
withCreateMode
Copy the current immutable object by setting a value for thecreateModeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for createMode- Returns:
- A modified copy or the
thisobject
-
withOutputMode
Copy the current immutable object by setting a value for theoutputModeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for outputMode- Returns:
- A modified copy or the
thisobject
-
withDetail
Copy the current immutable object by setting a value for thedetailattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for detail- Returns:
- A modified copy or the
thisobject
-
equals
This instance is equal to all instances ofImmutableExtensionWritethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:extension,remap,commonExtension,hint,input,tableSchema,operation,createMode,outputMode,detail. -
toString
Prints the immutable valueExtensionWritewith attribute values. -
copyOf
Creates an immutable copy of aExtensionWritevalue. 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 ExtensionWrite instance
-
builder
Creates a builder forImmutableExtensionWrite.ImmutableExtensionWrite.builder() .extension(Optional<io.substrait.extension.AdvancedExtension>) // optionalextension.remap(Optional<io.substrait.relation.Rel.Remap>) // optionalremap.commonExtension(Optional<io.substrait.extension.AdvancedExtension>) // optionalcommonExtension.hint(Optional<io.substrait.hint.Hint>) // optionalhint.input(io.substrait.relation.Rel) // requiredinput.tableSchema(io.substrait.type.NamedStruct) // requiredtableSchema.operation(io.substrait.relation.AbstractWriteRel.WriteOp) // requiredoperation.createMode(io.substrait.relation.AbstractWriteRel.CreateMode) // requiredcreateMode.outputMode(io.substrait.relation.AbstractWriteRel.OutputMode) // requiredoutputMode.detail(io.substrait.relation.Extension.WriteExtensionObject) // requireddetail.build();- Returns:
- A new ImmutableExtensionWrite builder
-