turnilo icon indicating copy to clipboard operation
turnilo copied to clipboard

Enabling queries like DAY_OF_WEEK, WEEK_OF_MONTH etc

Open akansal1 opened this issue 6 years ago • 5 comments

Hi,

Currently Turnilo enables time split at intervals like P1D, P1W etc. but there are another type time bucketing that is enabled by plywood, under timepart category.

Such queries as are useful in creating insights at granularity such as hour_of_day, day_of_week etc.

akansal1 avatar Feb 18 '19 10:02 akansal1

Sorry, I don't follow what's the issue/proposal? timePart is operator on time values, not dimension. You want to group by "day_of_week" and aggregate all mondays in one bucket and all tuesdays in another?

adrianmroz avatar Feb 18 '19 11:02 adrianmroz

it is a proposal, and yes I want to do something like that.

akansal1 avatar Feb 18 '19 11:02 akansal1

Sounds interesting, but I don't think it aligns with what Split is, right now. This is more like dimension transformation, from time -> number. Of course, we could assign labels for numbers, but still this is some categorical value, with no date time meaning. It will certainly break a lot of assumptions inside turnilo right now - from conditions on continuous dimensions to time shift.

For start, I would experiment with this idea as separate dimension definition. If it works and proves to be useful, we could think about how to integrate in UI, so you won't need to define this in configuration and/or change "granularity".

adrianmroz avatar Feb 18 '19 12:02 adrianmroz

In that case, you may have to look at using virtual columns, that allow you to treat inferred or derived value as a dimension.

akansal1 avatar Feb 18 '19 14:02 akansal1

Interesting, you can configure additional dimension in the configuration file using Plywood formula like: formula: $time.timePart('DAY_OF_WEEK')

As a result there is a new numeric column with day of week :) Unfortunately it does not work for example dataset only for data from real Druid cluster.

mkuthan avatar Feb 18 '19 15:02 mkuthan