-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-37148: [C++] Explicitly list the integer values of the Type::type enum #37149
Conversation
As these are relied upon by code in R and Go implementations.
Would should we do about |
Leave it unset, so the compiler sets it to the maximum. |
@@ -79,6 +79,8 @@ Type <- enum("Type::type", | |||
LARGE_STRING = 34L, | |||
LARGE_BINARY = 35L, | |||
LARGE_LIST = 36L | |||
INTERVAL_MONTH_DAY_NANO = 37L, |
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.
Thanks for fixing this! Just missing a comma on the line above this one, and then hopefully tests should pass.
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.
Thank you! I fixed it and pushed again.
50d7e6b
to
3a751f6
Compare
CI failures look to be a timeout and something with the dev script - I've re-triggered them both, but I think we can probably merge this once we're happy that's all they are? |
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.
Explicit values for a large enumeration seems more readable to me, thanks!
@bkietz can you merge this? |
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 8bdfc8c. There were 9 benchmark results indicating a performance regression:
The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
…:type enum (apache#37149) ### Rationale for this change The enum type in C++ leaves the integer values implicitly defined and let the compiler assign the values to them automatically. This means an insertion of a new entry that is not at the end, causes implementations that rely on specific values (like R) to break with confusing error messages [1]. Assigning the values explicitly can communicate that these enum entry values are relied upon and can allow a more natural ordering of the list that is different from the numeric order the entries receive. [1] apache#37091 ### What changes are included in this PR? - Setting numeric values of the enum entries explicitly - Completing an equivalent enum on the R side ### Are these changes tested? N/A ### Are there any user-facing changes? No. * Closes: apache#37148 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
Rationale for this change
The enum type in C++ leaves the integer values implicitly defined and let the compiler assign the values to them automatically. This means an insertion of a new entry that is not at the end, causes implementations that rely on specific values (like R) to break with confusing error messages [1].
Assigning the values explicitly can communicate that these enum entry values are relied upon and can allow a more natural ordering of the list that is different from the numeric order the entries receive.
[1] #37091
What changes are included in this PR?
Are these changes tested?
N/A
Are there any user-facing changes?
No.