Conversation
e5182d5 to
8699fa5
Compare
|
Still 👍 from me after we resolve merge conflicts |
8699fa5 to
3c069a9
Compare
|
rebased |
|
@nishantmonu51 can u review? |
|
|
||
| ### First / Last aggregator | ||
|
|
||
| First and Last aggregator cannot be used in ingestion spec, and should only be specified as part of queries. |
There was a problem hiding this comment.
can we also document that if the rows are rolled up, the first/last value will be a the first/last value in druid row and not the raw data being ingested.
There was a problem hiding this comment.
Added note about rollup behavior
| public AggregatorFactory apply(String input) | ||
| { | ||
| return new JavaScriptAggregatorFactory(input, fieldNames, fnAggregate, fnReset, fnCombine, config); | ||
| return new JavaScriptAggregatorFactory(input, Lists.newArrayList(input), fnCombine, fnReset, fnCombine, config); |
There was a problem hiding this comment.
seems unrelated to this PR ?
There was a problem hiding this comment.
it's needed due to the changes within groupby in the PR
| private final LongColumnSelector timeSelector; | ||
| private final String name; | ||
|
|
||
| long firstTime; |
There was a problem hiding this comment.
made this and others protected, it's accessed by the corresponding AggregatorFactory in getCombiningFactory() when overriding factorize()
| private final String name; | ||
|
|
||
| long firstTime; | ||
| double firstValue; |
| private final String name; | ||
|
|
||
| long firstTime; | ||
| long firstValue; |
| private final String name; | ||
|
|
||
| long lastTime; | ||
| double lastValue; |
| { | ||
| return new DoubleLastAggregator( | ||
| name, metricFactory.makeFloatColumnSelector(fieldName), | ||
| metricFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME) |
There was a problem hiding this comment.
minor nit: can we pass time column selector before field selector to be consistent with buffered aggregator ?
| @Override | ||
| public String toString() | ||
| { | ||
| return "DoubleFirstAggregatorFactory{" + |
| private final String name; | ||
|
|
||
| long lastTime; | ||
| long lastValue; |
| { | ||
| return new LongLastAggregator( | ||
| name, metricFactory.makeLongColumnSelector(fieldName), | ||
| metricFactory.makeLongColumnSelector(Column.TIME_COLUMN_NAME) |
There was a problem hiding this comment.
minor nit: can we pass time column selector before field selector to be consistent with buffered aggregator ?
|
Also, would be nice to add these aggregators to existing integration tests, we can add them to ITTwitterQueryTest and ITWikipediaQueryTest |
1e2f53a to
2680177
Compare
2680177 to
cc25586
Compare
|
@nishantmonu51 Addressed your comments aside from the one about integration tests, haven't gotten around to that yet |
f362d19 to
11e50b6
Compare
|
I added some first/last aggs to ITWikipediaQueryTest I didn't add them to ITTwitterQueryTest since I saw the queries there weren't testing the full set of aggs, only using doubleSums generally. I noticed that some other agg types weren't represented in the integration tests (like the max/min or javascript), and it'd be convenient to have a reference to the raw data for |
|
👍 after travis |
* add first and last aggregator * add test and fix * moving around * separate aggregator valueType * address PR comment * add finalize inner query and adjust v1 inner indexing * better test and fixes * java-util import fixes * PR comments * Add first/last aggs to ITWikipediaQueryTest
… volcano planner
Reopening #3226 from @acslk to finish review/merge