-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Fix possible error Invalid column type for ColumnUnique::insertRangeFrom ...
#39716
Fix possible error Invalid column type for ColumnUnique::insertRangeFrom ...
#39716
Conversation
src/Functions/IFunction.cpp
Outdated
@@ -285,6 +285,8 @@ ColumnPtr IExecutableFunction::executeWithoutSparseColumns(const ColumnsWithType | |||
? res->cloneResized(1)->convertToFullColumnIfConst() | |||
: res; | |||
|
|||
keys = keys->convertToFullColumnIfLowCardinality(); |
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.
A couple of lines above IFunction::executeWithoutLowCardinalityColumns
is called with columns_without_low_cardinality
. columns_without_low_cardinality
indeed contains unwrapped columns (as in not LC), but the value returned by IFunction::executeWithoutLowCardinalityColumns
is Const(ColumnLowCardinality), which begs the question if that's the expected behavior. Doesn't seem like.
res
is then used to create the keys, which is passed to res_mut_dictionary->uniqueInsertRangeFrom
that expects an unwrapped LC column.
Calling keys->convertToFullColumnIfLowCardinality
fixes the problem, but I wonder if that's the right way to fix it. My instinct tells me executeWithoutLowCardinalityColumns
is the actual problem, but unfortunately my debugger won't allow me to properly debug this file. Hence, I am posting this comment as a quesiton.
What is the expected behavior/ return value of executeWithoutLowCardinalityColumns
?
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.
Hi @Avogar, since you are an assignee, could you please clarify ^^ ?
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, you are right, it's not an expected behaviour of executeWithoutLowCardinalityColumns
. The problem is in function __getScalar
here it should not use default implementation for LC columns. So we should add
bool useDefaultImplementationForLowCardinalityColumns() const override { return false; }
There is no need to create an integration tests for such simple test case. It would be much better to create simple stateless test. See examples in |
Hi @Avogar. Is there anything missing for the merge? |
Everything is perfect, let's merge it |
Invalid column type for ColumnUnique::insertRangeFrom ...
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix possible error
Invalid column type for ColumnUnique::insertRangeFrom. Expected String, got ColumnLowCardinality
Fixes #38460