fix(isthmus)!: keep a struct's declared field nullability in Calcite - #1317
alexandrefimov wants to merge 1 commit into
Conversation
A Substrait struct declares its own nullability and its fields' separately. TypeConverter applied the struct's with createTypeWithNullability, which Calcite documents as widening a record's fields along with the record, so struct?<i32, fp64> came back as struct?<i32?, fp64?>. Apply it with enforceTypeWithNullability, which the factory canonizes the same way but which leaves each field as declared. A computed field inside a nullable struct now converts back instead of reporting that the row type cannot say what the schema said. Closes substrait-io#1154
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change uses Calcite’s ChangesStruct nullability conversion
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable issue remains; this change is mergeable after normal checks. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
A Substrait struct declares its own nullability and its fields' separately.
TypeConverterapplied the struct's withcreateTypeWithNullability, which Calcite documents as widening a record's fields along with the record, sostruct?<i32, fp64>came back asstruct?<i32?, fp64?>.enforceTypeWithNullabilitycanonizes the result the same way and leaves each field as declared. A computed field inside a nullable struct now converts back instead of reporting that the row type cannot say what the schema said.Closes #1154
BREAKING CHANGE: Substrait-to-Calcite conversion keeps a struct field's declared nullability, so a required field inside a nullable struct stays NOT NULL.
Summary by CodeRabbit