Skip to content
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

Temporary work-around to bypass function arguments being treated as expressions with columns. #5382

Merged
merged 1 commit into from
May 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ public ServerQueryRequest(InstanceRequest instanceRequest, ServerMetrics serverM
if (aggregationsInfo != null) {
_aggregationExpressions = new HashSet<>();
for (AggregationInfo aggregationInfo : aggregationsInfo) {
if (!aggregationInfo.getAggregationType().equalsIgnoreCase(AggregationFunctionType.COUNT.getName())) {
String aggregationType = aggregationInfo.getAggregationType();
mayankshriv marked this conversation as resolved.
Show resolved Hide resolved

// TODO: Remove special casing of theta-sketch.
// This is needed as a work-around because only aggregation functions know how to interpret the expressions.
// The code below assumes that all expressions have columns in them, which may not be true. But only Aggregation
// functions have that knowledge, and have not been instantiated yet. A clean fix would be to instantiate
// aggregation functions upfront to interpret the expressions.
if (!aggregationType.equalsIgnoreCase(AggregationFunctionType.COUNT.getName()) && !aggregationType
.equalsIgnoreCase(AggregationFunctionType.DISTINCTCOUNTTHETASKETCH.getName())) {
for (String expressions : AggregationFunctionUtils.getArguments(aggregationInfo)) {
_aggregationExpressions.add(TransformExpressionTree.compileToExpressionTree(expressions));
}
Expand Down Expand Up @@ -131,7 +139,6 @@ public ServerQueryRequest(InstanceRequest instanceRequest, ServerMetrics serverM
}
_selectionColumns = RequestUtils.extractColumnsFromExpressions(_selectionExpressions);
_allColumns.addAll(_selectionColumns);

} else {
_selectionColumns = null;
_selectionExpressions = null;
Expand Down