Package io.substrait.relation
Class ImmutableNamedDdl
java.lang.Object
io.substrait.relation.AbstractRel
io.substrait.relation.ZeroInputRel
io.substrait.relation.AbstractDdlRel
io.substrait.relation.NamedDdl
io.substrait.relation.ImmutableNamedDdl
- All Implemented Interfaces:
HasExtension,Rel
Immutable implementation of
NamedDdl.
Use the builder to create immutable instances:
ImmutableNamedDdl.builder().
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.substrait.relation.AbstractDdlRel
AbstractDdlRel.DdlObject, AbstractDdlRel.DdlOp -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableNamedDdl.Builderbuilder()Creates a builder forImmutableNamedDdl.static ImmutableNamedDdlCreates an immutable copy of aNamedDdlvalue.booleanThis instance is equal to all instances ofImmutableNamedDdlthat have equal attribute values.getHint()getNames()Returns the DDL object kind (table or view).Returns the DDL operation (create/alter/drop, etc.).getRemap()Returns default values for the table columns.Returns the target table/view schema (names + types).Returns the view definition when the object is a view.inthashCode()Computes a hash code from attributes:extension,remap,commonExtension,hint,tableSchema,tableDefaults,object,operation,viewDefinition,names.toString()Prints the immutable valueNamedDdlwith attribute values.final ImmutableNamedDdlCopy the current immutable object by setting a present value for the optionalcommonExtensionattribute.final ImmutableNamedDdlwithCommonExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for thecommonExtensionattribute.final ImmutableNamedDdlwithExtension(AdvancedExtension value) Copy the current immutable object by setting a present value for the optionalextensionattribute.final ImmutableNamedDdlwithExtension(Optional<? extends AdvancedExtension> optional) Copy the current immutable object by setting an optional value for theextensionattribute.final ImmutableNamedDdlCopy the current immutable object by setting a present value for the optionalhintattribute.final ImmutableNamedDdlCopy the current immutable object by setting an optional value for thehintattribute.final ImmutableNamedDdlCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedDdlCopy the current immutable object with elements that replace the content ofnames.final ImmutableNamedDdlCopy the current immutable object by setting a value for theobjectattribute.final ImmutableNamedDdlCopy the current immutable object by setting a value for theoperationattribute.final ImmutableNamedDdlCopy the current immutable object by setting a present value for the optionalremapattribute.final ImmutableNamedDdlCopy the current immutable object by setting an optional value for theremapattribute.final ImmutableNamedDdlCopy the current immutable object by setting a value for thetableDefaultsattribute.final ImmutableNamedDdlwithTableSchema(NamedStruct value) Copy the current immutable object by setting a value for thetableSchemaattribute.final ImmutableNamedDdlwithViewDefinition(Rel value) Copy the current immutable object by setting a present value for the optionalviewDefinitionattribute.final ImmutableNamedDdlwithViewDefinition(Optional<? extends Rel> optional) Copy the current immutable object by setting an optional value for theviewDefinitionattribute.Methods inherited from class io.substrait.relation.AbstractDdlRel
deriveRecordTypeMethods inherited from class io.substrait.relation.ZeroInputRel
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
-
getTableSchema
Returns the target table/view schema (names + types).- Specified by:
getTableSchemain classAbstractDdlRel- Returns:
- target
NamedStruct
-
getTableDefaults
Returns default values for the table columns.- Specified by:
getTableDefaultsin classAbstractDdlRel- Returns:
- defaults as
Expression.StructLiteral
-
getObject
Returns the DDL object kind (table or view).- Specified by:
getObjectin classAbstractDdlRel- Returns:
- DDL object
-
getOperation
Returns the DDL operation (create/alter/drop, etc.).- Specified by:
getOperationin classAbstractDdlRel- Returns:
- DDL operation
-
getViewDefinition
Returns the view definition when the object is a view.- Specified by:
getViewDefinitionin classAbstractDdlRel- Returns:
- optional view definition relation
-
getNames
-
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
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
-
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
-
withTableDefaults
Copy the current immutable object by setting a value for thetableDefaultsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tableDefaults- Returns:
- A modified copy or the
thisobject
-
withObject
Copy the current immutable object by setting a value for theobjectattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for object- 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
-
withViewDefinition
Copy the current immutable object by setting a present value for the optionalviewDefinitionattribute.- Parameters:
value- The value for viewDefinition- Returns:
- A modified copy or
thisif not changed
-
withViewDefinition
Copy the current immutable object by setting an optional value for theviewDefinitionattribute. 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 viewDefinition- Returns:
- A modified copy or
thisif not changed
-
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 ofImmutableNamedDdlthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:extension,remap,commonExtension,hint,tableSchema,tableDefaults,object,operation,viewDefinition,names. -
toString
Prints the immutable valueNamedDdlwith attribute values. -
copyOf
Creates an immutable copy of aNamedDdlvalue. 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 NamedDdl instance
-
builder
Creates a builder forImmutableNamedDdl.ImmutableNamedDdl.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.tableSchema(io.substrait.type.NamedStruct) // requiredtableSchema.tableDefaults(io.substrait.expression.Expression.StructLiteral) // requiredtableDefaults.object(io.substrait.relation.AbstractDdlRel.DdlObject) // requiredobject.operation(io.substrait.relation.AbstractDdlRel.DdlOp) // requiredoperation.viewDefinition(Optional<io.substrait.relation.Rel>) // optionalviewDefinition.addNames|addAllNames(String) //nameselements .build();- Returns:
- A new ImmutableNamedDdl builder
-