-
Notifications
You must be signed in to change notification settings - Fork 410
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
overwrite addBatchSinglePlace
and addBatchSinglePlaceNotNull
in AggregateFunctionCountNotNullUnary
#9563
overwrite addBatchSinglePlace
and addBatchSinglePlaceNotNull
in AggregateFunctionCountNotNullUnary
#9563
Conversation
/test pull-unit-test |
b836940
to
86c0dc5
Compare
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.
What're the differences between these two functions? Only the way that the nullmap is passed?
|
if (if_argument_pos >= 0) | ||
{ | ||
const auto & flags = assert_cast<const ColumnUInt8 &>(*columns[if_argument_pos]).getData(); | ||
data(place).count | ||
+= countBytesInFilterWithNull(flags, nc.getNullMapData().data(), start_offset, batch_size); | ||
} | ||
else | ||
{ | ||
data(place).count += batch_size - countBytesInFilter(nc.getNullMapData().data(), start_offset, batch_size); | ||
} |
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.
How about calling addBatchSinglePlaceNotNull
here directly?
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.
Good idea.
Signed-off-by: xufei <xufeixw@mail.ustc.edu.cn>
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.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gengliqi, yibin87 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #9146
Problem Summary:
What is changed and how it works?
AggregateFunctionCountNotNullUnary
does not overwriteaddBatchSinglePlace
andaddBatchSinglePlaceNotNull
, so the code path will betiflash/dbms/src/AggregateFunctions/IAggregateFunction.h
Lines 267 to 289 in 0853523
In fact,
AggregateFunctionCountNotNullUnary
can be optimized by count the element number in batch likeAggregateFunctionCount
by overwriteaddBatchSinglePlace
andaddBatchSinglePlaceNotNull
Check List
Tests
Side effects
Documentation
Release note