-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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-41114: [C++] Add is_validity_defined_by_bitmap() predicate #41115
Conversation
…alid() The constexpr is_validity_defined_by_bitmap() predicate guarantees statically that it's enough to look only at the bitmap for the types these templates are used with.
|
Is this conceptually different from |
The definition is the same, but the naming is unclear and ambiguous:
This reads as if the static_assert(internal::HasValidityBitmap(ArrayType::type_id));
const uint8_t* validity = array.HasValidityBitmap() ? array.buffers[0].data : NULLPTR; vs static_assert(internal::is_validity_defined_by_bitmap(ArrayType::type_id));
const uint8_t* validity = array.HasValidityBitmap() ? array.buffers[0].data : NULLPTR; |
+1 for this, so it replace |
In that case, it's better to call |
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.
+1 for me
Regardless of the name, we shouldn't have two functions doing the same thing. So at least this should be renaming the existing function (but I find your proposition rather wordy). |
They could evolve in different ways in the future with the addition of new types. It's a coincidence that the intention of both matches today's implementations.
I also think it's a long name, but I couldn't come up with a shorter one, do you have a name suggestion? |
How come? Nobody has ever suggested a different validity representation than the validity bitmap.
I would suggest |
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.
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit a78760f. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 31 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…pache#41115) ### Rationale for this change To make it easier to find bugs that are very likely to be silent in the codebas because users rarely use unions and REE types. ### What changes are included in this PR? Adding the type predicate and two usages in `builder_nested.h`. ### Are these changes tested? By the compilation process, since they are both `static_asserts`. * GitHub Issue: apache#41114 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
…pache#41115) ### Rationale for this change To make it easier to find bugs that are very likely to be silent in the codebas because users rarely use unions and REE types. ### What changes are included in this PR? Adding the type predicate and two usages in `builder_nested.h`. ### Are these changes tested? By the compilation process, since they are both `static_asserts`. * GitHub Issue: apache#41114 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
…pache#41115) ### Rationale for this change To make it easier to find bugs that are very likely to be silent in the codebas because users rarely use unions and REE types. ### What changes are included in this PR? Adding the type predicate and two usages in `builder_nested.h`. ### Are these changes tested? By the compilation process, since they are both `static_asserts`. * GitHub Issue: apache#41114 Authored-by: Felipe Oliveira Carvalho <felipekde@gmail.com> Signed-off-by: Felipe Oliveira Carvalho <felipekde@gmail.com>
Rationale for this change
To make it easier to find bugs that are very likely to be silent in the codebas because users rarely use unions and REE types.
What changes are included in this PR?
Adding the type predicate and two usages in
builder_nested.h
.Are these changes tested?
By the compilation process, since they are both
static_asserts
.