-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Change group key delimiter from '\t' to '\0' #5858
Conversation
4525626
to
4d0cee9
Compare
4d0cee9
to
1d6266c
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.
LGTM
for (int i = 0; i < numGroupByExpressions; i++) { | ||
converterFunctions[i] = getConverterFunction(_dataSchema.getColumnDataType(i)); | ||
} | ||
if (numGroupByExpressions == 1) { |
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 we separate single groupby ? for performance ?
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. For single group-by, we don't need to split the string for each group key
public AggregationGroupByTrimmingService(QueryContext queryContext) { | ||
_aggregationFunctions = queryContext.getAggregationFunctions(); | ||
List<ExpressionContext> groupByExpressions = queryContext.getGroupByExpressions(); | ||
assert groupByExpressions != null; |
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.
shall we stick to Preconditions.checkArgument
?
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.
I usually use assert
to indicate that it is not possible to be null for readability, which will be ignored in production environment.
Preconditions
are used for catching the illegal user input and throw exceptions
Description
Using '\t' as the group key delimiter will cause unexpected behavior when grouping on string value with '\t' inside. To solve it, we can use '\0' as the delimiter which is not allowed in the string values.
Upgrade Notes
In order to achieve zero down-time upgrade, Brokers must be upgraded before Servers.