  org.dada.demo.whales
  (:use [org.dada.core])
  (:import [clojure.lang Symbol])
+ (:import [java.math BigDecimal])
  (:import [org.dada.core
 	   Average
 	   Creator

;; demonstrate reduction
;;----------------------------------------


;; (defn make-reducer [view #^Model model #^Keyword key #^Reducer$Strategy reduction]
;;   )

;; (defn do-reduce [view #^Model model #^Keyword key #^Reducer$Strategy reduction]
;;   (connect model (make-reducer reduction view))
;;   view)

;; (def sum nil)

;; ;; sum, average, mean, mode, COUNT, minimum, maximum,...
;; (def narwhals-total-length (do-reduce "SUM(length)" sum narwhals-length :length))
;; (insert *metamodel* narwhals-total-length)x

;;----------------------------------------
;; select - being refactored into filter, transform, aggregate, group, ...

;; create 10,000 whales and insert them into model
(insert-n
 whales
 (let [num-whales 10
       time (System/currentTimeMillis)
       #^Creator creator (.getCreator whale-metadata)
       max-length-x-100 (* max-length 100)
