     query))
 
 (defn- validate-select
-  [query metadata slice]
+  [query]
   (try
     (let [select (select/parse (str (:select query)))]
       (-> query
-          (validate-select-fields metadata slice select)
+          (validate-select-fields select)
           (validate-select-no-aggregations-without-group select)
           (validate-select-no-non-aggregated-fields select)))
     (catch Exception e

    query
    (add-error query :group "You must have a select clause to use grouping.")))

(defn- validate-group-fields
  [query group metadata slice]
  (let [group (map (fn [g] (if (coll? g)
                             (str "__" (str/join "." (map name g)))
                             g)) group)]
    (reduce #(validate-field %1 :group metadata slice %2) query group)))

(defn- validate-group-only-group-dimensions
  [query group dimensions]
  (let [dimensions (set dimensions)]
    (reduce
     (fn [query field]
       (let [field (name field)]

          dimensions (:dimensions slicedef)]
      (-> query
          (assoc :errors {})
          validate-select
          validate-group
          validate-where
          validate-order-by
          validate-limit
