Package io.substrait.relation
Class ImmutableNamedWrite
java.lang.Object
io.substrait.relation.AbstractRel
io.substrait.relation.SingleInputRel
io.substrait.relation.AbstractWriteRel
io.substrait.relation.NamedWrite
io.substrait.relation.ImmutableNamedWrite
- All Implemented Interfaces:
HasExtension,Rel
Immutable implementation of
NamedWrite.
Use the builder to create immutable instances:
ImmutableNamedWrite.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableNamedWrite.Nested classes/interfaces inherited from class io.substrait.relation.AbstractWriteRel
AbstractWriteRel.CreateMode, AbstractWriteRel.OutputMode, AbstractWriteRel.WriteOp -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNamedWrite.Builderbuilder()Creates a builder forImmutableNamedWrite.static ImmutableNamedWritecopyOf(NamedWrite instance) Creates an immutable copy of aNamedWritevalue.booleanThis instance is equal to all instances ofImmutableNamedWritethat have equal attribute values.Returns the table creation behavior when the target exists.getHint()getInput()getNames()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,names.toString()Prints the immutable valueNamedWritewith attribute values.final ImmutableNamedWriteCopy the current immutable object by setting a present value for the optionalcommonExtensionattribute.final ImmutableNamedWritewithCommonExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for thecommonExtensionattribute.final ImmutableNamedWriteCopy the current immutable object by setting a value for thecreateModeattribute.final ImmutableNamedWritewithExtension(AdvancedExtension value) Copy the current immutable object by setting a present value for the optionalextensionattribute.final ImmutableNamedWritewithExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theextensionattribute.final ImmutableNamedWriteCopy the current immutable object by setting a present value for the optionalhintattribute.final ImmutableNamedWriteCopy the current immutable object by setting an optional value for thehintattribute.final ImmutableNamedWriteCopy the current immutable object by setting a value for theinputattribute.final ImmutableNamedWriteCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedWriteCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedWriteCopy the current immutable object by setting a value for theoperationattribute.final ImmutableNamedWriteCopy the current immutable object by setting a value for theoutputModeattribute.final ImmutableNamedWriteCopy the current immutable object by setting a present value for the optionalremapattribute.final ImmutableNamedWriteCopy the current immutable object by setting an optional value for theremapattribute.final ImmutableNamedWritewithTableSchema(NamedStruct value) Copy the current immutable object by setting a value for thetableSchemaattribute.Methods inherited from class io.substrait.relation.NamedWrite
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
-
getNames
- Specified by:
getNamesin classNamedWrite- Returns:
- The value of the
namesattribute
-
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 ImmutableNamedWrite 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
-
withNames
Copy the current immutable object with elements that replace the content ofnames.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withNames
Copy the current immutable object with elements that replace the content ofnames. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of names elements to set- Returns:
- A modified copy or
thisif not changed
-
equals
This instance is equal to all instances ofImmutableNamedWritethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:extension,remap,commonExtension,hint,input,tableSchema,operation,createMode,outputMode,names. -
toString
Prints the immutable valueNamedWritewith attribute values. -
copyOf
Creates an immutable copy of aNamedWritevalue. 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 NamedWrite instance
-
builder
Creates a builder forImmutableNamedWrite.ImmutableNamedWrite.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.addNames|addAllNames(String) //nameselements .build();- Returns:
- A new ImmutableNamedWrite builder
-