The following is the code in Druid SQL. My goal is to run this code from Python. I'm able to do so using DB API, but I'm wondering if there's a way to do this with the hydroid function "timeseries" because it would go better with the rest of my code. I haven't been able to get results because I'm not sure how to implement the "Avg" function into timeseries.
Thanks!
SELECT TIME_FLOOR(__time, 'PT1h') AS "__time_time_floor",
AVG("value"), COUNT(*) AS "Count"
FROM "database"
WHERE "__time" >= CURRENT_TIMESTAMP - INTERVAL '1' DAY AND "device" = 'device_1'AND
"metric"='metric_1'
GROUP BY 1
ORDER BY "__time_time_floor" DESC;