diff --git a/test/metabase/driver/query_processor_test.clj b/test/metabase/driver/query_processor_test.clj index 06bd5d2f58ed54de794face1d44ce88442277437..db7c882055592ebdb0f76f0ce505d27f0739fbd2 100644 --- a/test/metabase/driver/query_processor_test.clj +++ b/test/metabase/driver/query_processor_test.clj @@ -997,27 +997,46 @@ ;;; Nested Field in ORDER ;; Let's get all the tips Kyle posted on Twitter sorted by tip.venue.name (expect - [[446 "Cam's Mexican Gastro Pub" - {:mentions ["@cams_mexican_gastro_pub"], :tags ["#mexican" "#gastro" "#pub"], :service "twitter", :username "kyle"}] - [230 "Haight European Grill" - {:mentions ["@haight_european_grill"], :tags ["#european" "#grill"], :service "twitter", :username "kyle"}] - [319 "Haight Soul Food Pop-Up Food Stand" - {:mentions ["@haight_soul_food_pop_up_food_stand"], :tags ["#soul" "#food" "#pop-up" "#food" "#stand"], :service "twitter", :username "kyle"}] - [224 "Pacific Heights Free-Range Eatery" - {:mentions ["@pacific_heights_free_range_eatery"], :tags ["#free-range" "#eatery"], :service "twitter", :username "kyle"}]] + [[446 + {:mentions ["@cams_mexican_gastro_pub"], :tags ["#mexican" "#gastro" "#pub"], :service "twitter", :username "kyle"} + "Cam's Mexican Gastro Pub is a historical and underappreciated place to conduct a business meeting with friends." + {:large "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/large.jpg", + :medium "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/med.jpg", + :small "http://cloudfront.net/6e3a5256-275f-4056-b61a-25990b4bb484/small.jpg"} + {:phone "415-320-9123", :name "Cam's Mexican Gastro Pub", :categories ["Mexican" "Gastro Pub"], :id "bb958ac5-758e-4f42-b984-6b0e13f25194"}] + [230 + {:mentions ["@haight_european_grill"], :tags ["#european" "#grill"], :service "twitter", :username "kyle"} + "Haight European Grill is a horrible and amazing place to have a birthday party during winter." + {:large "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/large.jpg", + :medium "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/med.jpg", + :small "http://cloudfront.net/1dcef7de-a1c4-405b-a9e1-69c92d686ef1/small.jpg"} + {:phone "415-191-2778", :name "Haight European Grill", :categories ["European" "Grill"], :id "7e6281f7-5b17-4056-ada0-85453247bc8f"}] + [319 + {:mentions ["@haight_soul_food_pop_up_food_stand"], :tags ["#soul" "#food" "#pop-up" "#food" "#stand"], :service "twitter", :username "kyle"} + "Haight Soul Food Pop-Up Food Stand is a underground and modern place to have breakfast on a Tuesday afternoon." + {:large "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/large.jpg", + :medium "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/med.jpg", + :small "http://cloudfront.net/8f613909-550f-4d79-96f6-dc498ff65d1b/small.jpg"} + {:phone "415-741-8726", :name "Haight Soul Food Pop-Up Food Stand", :categories ["Soul Food" "Pop-Up Food Stand"], :id "9735184b-1299-410f-a98e-10d9c548af42"}] + [224 + {:mentions ["@pacific_heights_free_range_eatery"], :tags ["#free-range" "#eatery"], :service "twitter", :username "kyle"} + "Pacific Heights Free-Range Eatery is a wonderful and modern place to take visiting friends and relatives Friday nights." + {:large "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/large.jpg", + :medium "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/med.jpg", + :small "http://cloudfront.net/cedd4221-dbdb-46c3-95a9-935cce6b3fe5/small.jpg"} + {:phone "415-901-6541", :name "Pacific Heights Free-Range Eatery", :categories ["Free-Range" "Eatery"], :id "88b361c8-ce69-4b2e-b0f2-9deedd574af6"}]] (Q run against geographical-tips using mongo - return :data :rows (map (fn [[id source _ {venue-name :name}]] [id venue-name source])) + return :data :rows aggregate rows of tips filter and = source...service "twitter" - = source...username "kyle" + = source...username "kyle" order venue...name)) ;; Nested Field in AGGREGATION -(expect - {} - (Q run against geographical-tips using mongo - return :data :rows - aggregate distinct venue...name of tips)) +(expect 99 + (Q run against geographical-tips using mongo + return :data :rows first first + aggregate distinct venue...name of tips)) ;;; Nested Field in BREAKOUT