Slackbot
11/30/2022, 5:28 PMVadim
11/30/2022, 6:27 PM? specifically developed (https://druid.apache.org/docs/latest/querying/sql.html#dynamic-parameters) to pass large single values into the query as a parameter. This was originally developed for Bloom filters (https://druid.apache.org/docs/latest/development/extensions-core/bloom-filter.html) that work with huge literal strings.Vadim
11/30/2022, 6:27 PMVadim
11/30/2022, 6:27 PMVadim
11/30/2022, 6:30 PMdim1Value => threshold then apply that lookup in your query and have it as another column and then write the having filter as HAVING COUNT(*) > thresholdVadim
11/30/2022, 6:32 PMVadim
11/30/2022, 6:32 PMUdit Sharma
12/01/2022, 4:33 AMVadim
12/01/2022, 4:36 AMUdit Sharma
12/01/2022, 5:09 AMRenato Santos
12/01/2022, 11:58 AMservice IN (..) AND over_threshold='yes' but if you change the threshold value you need to either reprocess everything or accept that only new data will be using the new threshold
Using lookup on filters does work, but I don't recommend using it for that, but it's possible you add a lookup with "${service_name}:${api}": $threshold
then use:
WHERE always_same_dim >= CAST (lookup(concat(dim_service, ':', dim_api)) AS Int)