-
Notifications
You must be signed in to change notification settings - Fork 3.8k
ExpressionPostAggregator: Automatically finalize inputs. #4406
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
Changes from all commits
f31ae84
14b3b7d
11a7399
56521f8
1c51d1f
90dbd8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1529,7 +1529,7 @@ public void testExpressionAggregations() throws Exception | |
| new DoubleSumAggregatorFactory("a2", "m1", null, macroTable) | ||
| )) | ||
| .postAggregators(ImmutableList.of( | ||
| new ExpressionPostAggregator("a3", "log((\"a1\" + \"a2\"))"), | ||
| EXPRESSION_POST_AGG("a3", "log((\"a1\" + \"a2\"))"), | ||
| new ArithmeticPostAggregator("a4", "quotient", ImmutableList.of( | ||
| new FieldAccessPostAggregator(null, "a1"), | ||
| new ConstantPostAggregator(null, 0.25) | ||
|
|
@@ -4416,4 +4416,9 @@ private static List<AggregatorFactory> AGGS(final AggregatorFactory... aggregato | |
| { | ||
| return Arrays.asList(aggregators); | ||
| } | ||
|
|
||
| private static ExpressionPostAggregator EXPRESSION_POST_AGG(final String name, final String expression) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this method be called expressionPostAgg?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a lot of other methods that are similarly named, like |
||
| { | ||
| return new ExpressionPostAggregator(name, expression, null, CalciteTests.createExprMacroTable()); | ||
| } | ||
| } | ||
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.
Suggested to change type to ImmutableMap and not to do extra copy.
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.
To do this, I'd have to change the
decoratemethod to use ImmutableMap builders rather than streams. Instead, I just removed theImmutableMap.copyOfin the constructor, since it's not really necessary. Nothing would be trying to modify the finalizers map anyway.