                         (post-process query-type)
                         remove-bonus-keys)
         columns    (vec (keys (first results)))]
-    (log/error "THIS Query from execute-query")    
-    (log/error query) 
-    (log/error "THIS result from execute-query")    
-    (log/error results)
-
     {:columns   columns
      :rows      (for [row results]
                   (mapv row columns))


(defn- druid-query-type
  "What type of Druid query type should we perform?"
  [{breakout-fields :breakout, {ag-type :aggregation-type} :aggregation}]
  (let [breakouts   (condp = (count breakout-fields)
                      0 :none
                      1 :one
                        :many)
        agg?        (boolean (and ag-type (not= ag-type :rows)))
        period-set  #{:minute :hour :day :week :month :quarter :year}
        ts?         (and (instance? DateTimeField (first breakout-fields))        ;; Checks whether the query is a timeseries (excludes x-of-y type breakouts)
                         (contains? period-set (:unit (first breakout-fields))))]

    (match [breakouts agg? ts?]
      [:none  false    _] ::select

(defmulti ^:private post-process query-type-dispatch-fn)

(defmethod post-process ::select     [_ results] (->> results first :result :events (map :event)))
(defmethod post-process ::total      [_ results] (map :result results))
(defmethod post-process ::topN       [_ results] (-> results first :result))
(defmethod post-process ::groupBy    [_ results] (map :event results))

