Skip to content
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

[C++] Implementation (like R) rely on implicit numeric assignment of enum Type entries #37148

Closed
felipecrv opened this issue Aug 14, 2023 · 0 comments · Fixed by #37149
Closed
Assignees
Milestone

Comments

@felipecrv
Copy link
Contributor

felipecrv commented Aug 14, 2023

Describe the bug, including details regarding any error messages, version, and platform.

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

Component(s)

C++

@felipecrv felipecrv self-assigned this Aug 14, 2023
bkietz pushed a commit that referenced this issue Aug 16, 2023
…enum (#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] #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: #37148

Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Signed-off-by: Benjamin Kietzman <bengilgit@gmail.com>
@bkietz bkietz added this to the 14.0.0 milestone Aug 16, 2023
loicalleyne pushed a commit to loicalleyne/arrow that referenced this issue Nov 13, 2023
…: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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants