Skip to content

fix: respect nullability in nested struct accessors - #967

Open
advancedxy wants to merge 3 commits into
apache:mainfrom
advancedxy:codex/fix-nested-struct-accessor
Open

advancedxy wants to merge 3 commits into
apache:mainfrom
advancedxy:codex/fix-nested-struct-accessor

Conversation

@advancedxy

Copy link
Copy Markdown

Summary

  • Carry schema nullability alongside each nested accessor position, including the leaf field.
  • Return null when an optional parent struct is null, and report an error when a required parent or leaf field is null.
  • Preserve the direct access paths for shallow fields while handling deeper paths, non-struct parents, and field errors.
  • Extend accessor tests across one- to four-level paths and align the evaluator test schema with its null input.

Testing

  • pre-commit on all changed files: passed
  • schema_test, expression_test, arrow_test, and eval_expr_test: 4/4 passed

AI assistance

OpenAI Codex assisted with the implementation, refactoring, and test scaffolding. The changes were reviewed against the schema accessor behavior and validated with the tests above.

@advancedxy

Copy link
Copy Markdown
Author

@wgtmac would you mind to take a look at this? Agent found this problem during our internal integration of iceberg-cpp, which might return null for required field rather than checked or return an error. Java's accessor also has similar problem but it optimize nested access with Position/Position2/Position3 Accessors, which might mitigate this issue.

This branch has not been deployed

No deployments
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.

1 participant