How to get timeintervals in druid for a particular range for a given timestamp

Hey guys,

i would like to explain my doubt using example.
i want to find Min value for 1hour interval taking 5 minutes of interval for let 2 days of time. i am not able to get this using javascript aggregator even using javascript function "setInterval’.
i want to get the series so that it shows 48 Min values(for 2 days).

Thanks in advance, any help is much appreciated.

Hi Rajnish, can you post the SQL query you are trying to do?
Alternatively, have you tried https://github.com/implydata/plyql?

Thanks Fangjin,

i am posting a part of my query:
Here period is 1h, so i want to get max/min taking 5 minutes of aggregated data for that 1 hour;i.e. for 1hour i will get one max/min value out of 12 data values(1hour=60 minutes;so taking 5 minutes of interval gives 12 values)

“intervals”: [
“2015-11-09T00:00+00:00/2015-11-10T00:00+00:00”
],
“metric”: “bytes”,
“granularity”: {
“period”: “pt1h”,
“timeZone”: “GMT+0000”,
“type”: “period”
},

“aggregations”: [
{
“type”: “javascript”,
“name”: “max”,
“fieldNames”: [
“sum_bytes”
],
“fnAggregate”: “function(current, sum_bytes) {return current == -1 ? sum_bytes: Math.max(current, sum_bytes); }”,
“fnCombine”: “function(partialA, partialB) { if (partialA == -1 && partialB != -1) return partialB;if (partialA != -1 && partialB == -1) return partialA;if (partialA == -1 && partialB == -1) return 0;return Math.max(partialA, partialB); }”,
“fnReset”: “function() { return -1; }”
},
{
“type”: “javascript”,
“name”: “aggtime”,
“fieldNames”: [
“__time”
],
“fnAggregate”: function(current,
time){return current + setInterval(time,
300000)}"
},
“fnCombine”: “function combinePartialResults(partialA, partialB) { return partialA + partialB; }”,

    }",
        "fnReset": "function(){
        return-1;
    }"
    },

Can you please provide the SQL query?