-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Merging #23843 #25394
Merging #23843 #25394
Conversation
auto & vec_from = col_from->getData(); | ||
size_t size = vec_from.size(); | ||
result_array_offsets_data.resize(size); | ||
result_array_values_data.reserve(size * 2); |
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.
Why size * 2
?
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.
Seems like heuristic from original author, make sense to reserve additional size for positions before push back. There is no optimal solution probably. It will be most efficient if number has 2 bits set to 1.
src/Functions/FunctionsCoding.h
Outdated
|| (result_column = executeType<Int8>(in_column)) | ||
|| (result_column = executeType<Int16>(in_column)) | ||
|| (result_column = executeType<Int32>(in_column)) | ||
|| (result_column = executeType<Int64>(in_column)))) |
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.
128, 256?
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.
Fixed.
src/Functions/FunctionsCoding.h
Outdated
|
||
DataTypePtr getReturnTypeImpl(const DataTypes & arguments) const override | ||
{ | ||
if (!isNativeInteger(arguments[0])) |
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.
Not native may be also ok?
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.
We can also extend bitmask functions for 128, 256 bits.
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.
Fixed.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Original pull request #23843.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Added function
bitPositionsToArray
. Closes #23792. Author [Kevin Wan] (@MaxWk).