Skip to content

feat(core): add DdlRel#410

Merged
vbarua merged 1 commit intosubstrait-io:mainfrom
andrew-coleman:ddl_rel
Jun 17, 2025
Merged

feat(core): add DdlRel#410
vbarua merged 1 commit intosubstrait-io:mainfrom
andrew-coleman:ddl_rel

Conversation

@andrew-coleman
Copy link
Copy Markdown
Member

Add the POJOs for the DdlRel proto message
Similar pattern to the previous WriteRel bindings.

Copy link
Copy Markdown
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments. Some of them are related to ambiguities in the spec around the DdlRel definition, which I don't consider blockers for this work.


public abstract DdlOp getOperation();

public abstract Optional<Rel> getViewDefinition();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the core spec, this is intended as the definition for a view for CREATE VIEW style statements.

There's nothing indicating that it is optional, or that it should only be set when object DDL_OBJECT_VIEW, but I think that's consistent with the current definition.

Comment thread core/src/main/java/io/substrait/relation/AbstractDdlRel.java
/**
* @return the table schema for the associated {@link ExtensionWrite} relation
*/
NamedStruct deriveSchema();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this, I don't think we actually need a deriveSchema method here, because the schema is given directly as the table_schema.

The same applies to the WriteExtensionObject as well.

What do you think about removing these?

.tableDefaults(defaults)
.detail(detail)
.operation(ExtensionDdl.DdlOp.ALTER)
.object(ExtensionDdl.DdlObject.VIEW)
Copy link
Copy Markdown
Member

@vbarua vbarua Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we use VIEW do we need to set the viewDefinition as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docs we do (https://substrait.io/relations/logical_relations/#ddl-properties).
I set it on line 64.

Add the POJOs for the DdlRel proto message
Similar pattern to the previous WriteRel bindings.

Signed-off-by: Andrew Coleman <andrew_coleman@uk.ibm.com>
@vbarua vbarua merged commit 18a12d5 into substrait-io:main Jun 17, 2025
12 checks passed
@andrew-coleman andrew-coleman deleted the ddl_rel branch June 18, 2025 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants