-
Notifications
You must be signed in to change notification settings - Fork 63
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
Granularity builders should support origin parameter #172
Comments
According to http://druid.io/docs/latest/querying/granularities.html, the plywood/src/external/druidExternal.ts Lines 521 to 525 in c767f76
plywood/src/external/utils/druidExtractionFnBuilder.ts Lines 315 to 321 in c767f76
These need to be transformed to add the
Luckily, both of the places using plywood/src/external/druidExternal.ts Line 827 in c767f76
What I'm thinking is to do the following
I'm thinking that it's not an unreasonable idea to restrict this to only apply to cases where there is exactly 1 time filter, since I don't think it would be possible with 2+ time filters. The only other way I could see this being supported is an optional plywood/src/expressions/baseExpression.ts Lines 1288 to 1292 in c767f76
However, since this is a Druid-specific option, it smells pretty funky to go with that route. It would give more control to the programmer in case they did want to do something like multiple time filters, and would also be more transparent. Which approach are you more comfortable with? Do you have a better way to handle this? |
@robertervin were you able to solve this problem ? |
I am not 100% sure if the origin parameter is meant this way. From my perspective it serves the purpose of defining a different starting point for time bucketing, e.g. for specifying a diverting fiscal year. As said in the documentation https://druid.apache.org/docs/latest/querying/granularities.html
I 100% agree that it would be great to be able to specify an origin different from the normal calendar year but from my perspective it should not automatically match the beginning of the time filter. One should be able to specify it separately. A common use case for this, as already mentioned, is a fiscal year that does not start at the first of January. I think pretty often the beginning of the time filter will match the origin. But this does not have to be this way and it was not the intention of this parameter in the first place. Therefore I suggest to add this parameter to plywood but not to link it to the beginning of the time filter. |
Description
Queries should support
origin
in granularity builders. This is defined via http://druid.io/docs/latest/querying/granularities.html. Right now the response from Druid starts from the nearest year, month, or week depending on the granularity. It should start from the query's start time.Use Case
The text was updated successfully, but these errors were encountered: