druid icon indicating copy to clipboard operation
druid copied to clipboard

SQL Having clause isn't working with field created via division

Open benvogan opened this issue 9 years ago • 2 comments

The following query results in a "Cannot build plan for query" error:

SELECT FLOOR(__time TO DAY), location_id, product_family_id, CAST(COUNT() FILTER(WHERE event_status <> 'success') AS FLOAT)/COUNT() AS scan_error_rate FROM sor_business_events_all WHERE event_type='product_scan' and __time > TIMESTAMP '2017-05-07 00:00:00' AND __time < TIMESTAMP '2017-05-10 00:00:00' GROUP BY FLOOR(__time TO DAY), location_id, product_family_id HAVING CAST(COUNT() FILTER(WHERE event_status <> 'success') AS FLOAT)/COUNT() = 1

benvogan avatar May 11 '17 15:05 benvogan

Would be fixed by #4360.

gianm avatar Jun 02 '17 21:06 gianm

Fixed by #4360.

gianm avatar Jul 18 '17 02:07 gianm