Sivakumar Karthikesan
03/23/2025, 9:25 AMselect tenantId, systemId, TIMESTAMP_TO_MILLIS(__time) as "timestamp", sum(iops_pref_pct) as iops_pref_pct from (select DISTINCT(__time),* from "xyzdatasource" where systemId='aaajjjjccccc' and __time >= MILLIS_TO_TIMESTAMP(1742252400000) and __time <= MILLIS_TO_TIMESTAMP(1742338800000)) group by __time, tenantId,systemId order by __time ascJohn Kowtko
03/23/2025, 1:12 PMdistinct(colName) doesn't look like valid SQL to me, at least not Druid SQL ... but the parser appears to be accepting it and treating it like select distinct colName ... and then you have added , *, which should be invoking a group by on every column in your table ... which can be very expensive, if not overruning the max subquery buffer.
What are you trying to achieve with that subquery?
Thanks. John