Skip to content
Snippets Groups Projects
Commit 1de60fbb authored by Cam Saül's avatar Cam Saül
Browse files

Add test to make sure named clause works with METRIC clause :100: [ci drivers]

parent 60ac2473
Branches
Tags
No related merge requests found
......@@ -201,3 +201,21 @@
:query {:source-table (data/id :venues)
:aggregation [:+ ["METRIC" (u/get-id metric)] 1]
:breakout [(ql/breakout (ql/field-id (data/id :venues :price)))]}})))))
;; check that we can handle METRICS (ick) inside a NAMED clause
(datasets/expect-with-engines (engines-that-support :expression-aggregations)
{:rows [[2 118]
[3 39]
[4 24]]
:columns [(data/format-name "price")
(if (= *engine* :redshift) "my cool metric" "My Cool Metric")]}
(tu/with-temp Metric [metric {:table_id (data/id :venues)
:definition {:aggregation [:sum [:field-id (data/id :venues :price)]]
:filter [:> [:field-id (data/id :venues :price)] 1]}}]
(format-rows-by [int int]
(rows+column-names (qp/process-query
{:database (data/id)
:type :query
:query {:source-table (data/id :venues)
:aggregation [[:named ["METRIC" (u/get-id metric)] "My Cool Metric"]]
:breakout [(ql/breakout (ql/field-id (data/id :venues :price)))]}})))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment