-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support nullable Arrow unions using virtual union arms (#2708)
**Commit by commit!** This PR implements support for top-level nullable Arrow unions using the "virtual arm" strategy. Specifically, all unions derived from Flatbuffers definitions now have an auto-generated arm at type index `0` of type `DataType::Null`. The data values in this arm are irrelevant: the deserialization code will treat the union as a whole as `null` any time the type buffer indicates a value of `0`. I've decided to make the auto-generated arm visible in the auto-generated `DataType` definition because... why wouldn't we? It makes it all much less magical and acts as a reminder that this thing is indeed here. The choice of using type index `0` rather than e.g. `nb_arms` is to make things A) more stable and B) forwards compatible. It cannot surprise end users in any way since user-defined types defined in Flatbuffers would just do the right thing, while user-defined types in raw Arrow don't even go through our (de)serialization logic but rather through theirs. In addition, this PR greatly improves error handling in the auto-generated code, giving the end-user very specific context and a context-correct backtrace when something goes wrong. Fixes #2684 ### What ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2708) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2708) - [Docs preview](https://rerun.io/preview/pr%3Acmc%2Frust_virtual_union_arms/docs) - [Examples preview](https://rerun.io/preview/pr%3Acmc%2Frust_virtual_union_arms/examples)
- Loading branch information
Showing
53 changed files
with
4,079 additions
and
2,596 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script. | ||
# It can be safely removed at anytime to force the build script to run again. | ||
# Check out build.rs to see how it's computed. | ||
289571cd5bcef516a43ead1678f39054c300890396d13933dc26d9294a07dffe | ||
ba58a7d123c5fa81f04a58a6325ef65029d93f330d571176101db87596a9c0cf |
Oops, something went wrong.