Skip to content
Snippets Groups Projects
Unverified Commit fa37b582 authored by Case Nelson's avatar Case Nelson Committed by GitHub
Browse files

aggregations to aggregation (#29327)

parent 0c7864a0
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,6 @@
(let [stage-number (or stage-number -1)]
(lib.util/update-query-stage
query stage-number
update :aggregations
update :aggregation
(fn [aggregations]
(conj (vec aggregations) (lib.common/->op-arg query stage-number an-aggregate-clause)))))))
......@@ -32,15 +32,15 @@
(testing "without query/stage-number, return a function for later resolution"
(is-fn? op tag [venues-category-id-metadata] [venue-field-check]))))))
(deftest ^:parallel join-test
(deftest ^:parallel aggregate-test
(is (=? {:lib/type :mbql/query,
:database (meta/id) ,
:type :pipeline,
:stages [{:lib/type :mbql.stage/mbql,
:source-table (meta/id :venues) ,
:lib/options {:lib/uuid string?},
:aggregations [[:sum {:lib/uuid string?}
[:field {:base-type :type/Integer, :lib/uuid string?} (meta/id :venues :category-id)]]]}]}
:aggregation [[:sum {:lib/uuid string?}
[:field {:base-type :type/Integer, :lib/uuid string?} (meta/id :venues :category-id)]]]}]}
(-> (lib/query-for-table-name meta/metadata-provider "VENUES")
(lib/aggregate (lib/sum (lib/field "VENUES" "CATEGORY_ID")))
(dissoc :lib/metadata)))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment