Closed tonipenya closed 6 years ago
My older comment got deleted (looks like gitlab does not play well with git push -f
)
Reading druid's documentation with more attention, turns out that what I was calling Field
is actually a post aggregator.
I've renamed both Field
and FieldType
to PostAggregator
and PostAggregatorType
respectively.
I am in doubt whether to move them to a separate file or keep them with PostAggregation
since the post aggregators are specific to post aggregations. What would you do?
That sounds valid, I'm OK with the code. No necessity to place this within the PostAggregation
companion object now. To me this feels grouped now, so no need to place that part in a separate file.
LGTM
Hey guys, @tonipenya @bjgbeelen
I have one question about PostAggregator
and PostAggregation
: what is the difference between them?
Here I see two exactly the same traits, that are derived by the same in theory things - post-aggregations (arithmetic, constant, fieldAccessor, etc.).
Why does current impl divide Arithmetic
from Constant
and FieldAccessor
?
Why does Arithmetic
accept only two post-aggregation, when it can accept any amount of them? e.g. when we want to sum several (more than 2) aggregations together.
Why does Arithmetic
accepts only PostAggregator
s and not PostAggregation
s? It means that Arithmetic
cannot accept itself, while in reality it can.
Thanks in advance :)
Really good questions, @vkorchik
The answer to most of your questions is: Because I didn't understand Druid's documentation. In my head, a post-aggregation defined an operation over some data and a post-aggregator defined where that data came from. Clearly, it isn't that way.
I'll see if I can find some time today to put together a PR to:
PostAggregator
and PostAggregation
so post-aggregations can be nested@tonipenya , yes, they have not the best documentation.
Well, about PR: I have exactly these changes already (I have done them long ago, but was ut of time to finish and polish them, to write tests and so on). I guess I will create new PR and, please, have a look at it too. 🙏
Great!
@ mention me so I don't miss it, plz.
It also adds license to DruidQuerySpec' header since scalastyle's current configuration requires it.