Joshua Chen
08/08/2024, 6:50 PMWITH a AS (
SELECT druid_time
FROM dim_map
WHERE id = 'abc'
LIMIT 1
)
SELECT *
FROM agg_table
WHERE __time = (SELECT druid_time FROM a)
But got error
Error: INVALID_INPUT (ADMIN)
Query could not be planned. A possible reason is [Aggregation [SINGLE_VALUE($0)] is not supported]
I also tried using IN instead of =, but it end up with a join which is bad and scans all segments.
I know I can use two separate queries, but I am working with Looker so this is not an option. Any suggestion is appreciated!Laksh Singla
08/08/2024, 7:23 PMGian Merlino
08/08/2024, 7:24 PM= will work, you will still get a join that has to hit all segments!Gian Merlino
08/08/2024, 7:25 PMGian Merlino
08/08/2024, 7:25 PMGian Merlino
08/08/2024, 7:27 PMJoshua Chen
08/08/2024, 7:34 PM