Uday Singh Matta
04/11/2024, 4:35 AM{
"queryType": "groupBy",
"dataSource": "EnergyMeterST501",
"intervals": [
"2023-12-23T00:00+03:00/2024-03-23T23:59:59+03:00"
],
"granularity": {
"type": "period",
"period": "P1D",
"timeZone": "Asia/Riyadh"
},
"dimensions": [
"deviceID"
],
"metric": "count",
"aggregations": [
{
"type": "count",
"name": "count",
"fieldName": "deviceID"
}
],
"having": {
"type": "filter",
"filter": {
"type": "in",
"dimension": "deviceID",
"values": [
"2020070100"
]
}
}
}
Slack ConversationJohn Kowtko
04/12/2024, 11:40 AMreplace into test_mo overwrite all
WITH seq10 AS (
SELECT * FROM TABLE(EXTERN(
'{"type":"inline","data":"0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n"}',
'{"type":"csv","findColumnsFromHeader":false,"columns":["val"]}',
'[{"name":"val","type":"long"}]'
))
)
SELECT TIMESTAMPADD(DAY, b.val*10 + c.val, CURRENT_TIMESTAMP) __time, '-' flag from seq10 b CROSS JOIN seq10 c
PARTITIONED BY MONTH