-
Notifications
You must be signed in to change notification settings - Fork 4.7k
SoA Schema evolution #50691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
SoA Schema evolution #50691
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b3c0b61
Extend SoA read streamer to support schema evolution
fwyzard 7b461ab
Start working on test
Electricks94 52f70df
Added check for Eigen type evolution
Electricks94 dcb5321
Store enum as integer in SoA backend
Electricks94 6ab4cdc
Added test case
Electricks94 2b7efa3
Added test cases and documentation to SoA schema evolution
Electricks94 833334f
Extended Schema Evolution with custom io rules
Electricks94 f04bc90
Extended Documentation
Electricks94 3b58f93
Move Schemaevolution tests to HeterogeniousCore
Electricks94 49d05a0
made README in DataFormats Portable clearer
Electricks94 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -916,6 +916,20 @@ namespace cms::soa::detail { | |
| } | ||
| }; | ||
|
|
||
| // Helper type trait for obtaining the underlying type of an enum, or the type itself if it's not an enum | ||
| template <typename T> | ||
| struct EnumTraits { | ||
| using type = T; | ||
| using value_type = T; | ||
| }; | ||
|
|
||
| template <typename T> | ||
| requires std::is_enum_v<T> | ||
| struct EnumTraits<T> { | ||
| using type = T; | ||
| using value_type = std::underlying_type_t<T>; | ||
| }; | ||
|
|
||
|
Comment on lines
+919
to
+932
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it work to use a concept instead of SFINAE ? |
||
| // Helper type trait for obtaining a span type for a column | ||
| template <typename ColumnType> | ||
| struct GetSpanType; | ||
|
|
||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is
typeused ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
typeis used to defineParametersTypeOf_. This has the effect that for the user the integer pointer is represented as an enum. This means that the access of the view also returns an enum like beforeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehm, what ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a column of an enum type is created, the internal ptr to the column is of type
EnumTraits::value_typeaka the underlying integer type of the enum, but when a view is created then the ptr to the column is of typeEnumTraits::typeaka the actual enum. In this way ROOT sees the enum as an integer and treats it like so while when accessing the column data users will get the enum typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻