fix: add nullability check for NamedStruct in builder - #104
Merged
Conversation
- if the struct is marked as NULLABLE raise an error - if the struct is defaulting to UNSPECIFIED, then make it REQUIRED Signed-off-by: MBWhite <whitemat@uk.ibm.com>
mbwhite
force-pushed
the
fix_namedstruct_schema
branch
from
October 16, 2025 14:55
f0dad5a to
26f4de0
Compare
Contributor
|
I think named_struct builder should have the same check also if we're adding it here. |
Contributor
Author
|
@tokoko yes - good idea.. thanks. Updated with a short test |
Signed-off-by: MBWhite <whitemat@uk.ibm.com>
Signed-off-by: MBWhite <whitemat@uk.ibm.com>
nielspardon
approved these changes
Oct 20, 2025
nielspardon
left a comment
Member
There was a problem hiding this comment.
LGTM
for the NamedStruct type the struct should always have NULLABILITY_REQUIRED when used for schemas and NamedStruct is currently only used for either the base schema (ReadRel) or the table schema (WriteRel, DdlRel, UpdateRel) within the Substrait specification:
// * When used to represent a relation schema, the outermost struct's
// nullability should be NULLABILITY_REQUIRED.
message NamedStruct {
// list of names in dfs order
repeated string names = 1;
Type.Struct struct = 2;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minor change, but useful to add defensive code where possible.
The NamedStruct for a ReadRel shouldn't be nullable. i.e. there must be some form of schema.
Adding in a simple check to the builders API.