Slackbot
02/29/2024, 2:49 PMKyle Hoondert
02/29/2024, 3:28 PMLATEST function? Something like
select
FLOOR(__time TO DAY),
groupId,
LATEST("event")
FROM "fooBarTable"
GROUP BY 1,2lnault
02/29/2024, 3:43 PMselect
__time,
groupId,
LATEST("event"),
LASTER("otherColumn1"),
LASTER("otherColumn2")
FROM "fooBarTable"
GROUP BY 1,2
I tried that and it is really not efficient. Plus, building the query on the fly in the code with the need to get all the columns names is not really handy.Kyle Hoondert
02/29/2024, 3:45 PMlnault
02/29/2024, 3:47 PMlnault
02/29/2024, 3:51 PMselect * from "fooBarTable" where LOOKUP(groupId, 'lookupName').value = __time
But I am scared by the size the lookup will need in memory. Plus, it is not that great for querying when lookup is really largeKyle Hoondert
02/29/2024, 3:52 PMLATEST on groupId and just include the rest in the group like
select
FLOOR(__time TO DAY),
LATEST("groupId"),
"event",
"otherDim"
FROM "fooBarTable"
GROUP BY 1,3,4lnault
02/29/2024, 3:57 PMlnault
02/29/2024, 3:58 PMlnault
02/29/2024, 4:03 PMlnault
02/29/2024, 4:16 PMJohn Kowtko
02/29/2024, 5:48 PM