Calculating the "delta" of a metric?

Hi,

Say I have a field named A in my segments.

What I want to do is calculating the A(in the given time) - A(in the previous not empty bucket).

I can do it by taking the results and calculating in a seperate program. But if Druid suggests a feature like this, that would be great.

Kind regards.

Hi,

(I’m not a Druid developer nor an expert in any way) Do you want to apply post-aggregations over this “delta aggregation” (a discrete differentiation)? It not, you could do the discrete differentiation after receiving it from Druid without too many overhead in your client application code.

In any way, this idea seems interesting for the first case. (I don’t think this is currently possible).

Hi,

After thinking for a while, I decided to do that in my applicaton, too.

Thanks for reply.

What is the SQL query you are trying to issue?

Perhaps https://github.com/implydata/plyql would help as it also does query planning for Druid.