 	 :query ::aggregation.pivot/query)
   :ret any?)
 
-(s/def ::aggregation.bar/bucketColumn (s/nilable ::db.dsv.column/columnName))
-(s/def ::aggregation.bar/subBucketColumn (s/nilable ::db.dsv.column/columnName))
-(s/def ::aggregation.bar/metricColumnY (s/nilable ::db.dsv.column/columnName))
+(s/def ::aggregation.bar/bucketColumn (s/nilable ::db.dsv.column.s/columnName))
+(s/def ::aggregation.bar/subBucketColumn (s/nilable ::db.dsv.column.s/columnName))
+(s/def ::aggregation.bar/metricColumnY (s/nilable ::db.dsv.column.s/columnName))
 (s/def ::aggregation.bar/metricAggregation (s/nilable #{"mean"
                                                         "sum"
                                                         "min"

	 :query ::aggregation.bar/query)
  :ret any?)

(s/def ::aggregation.bubble/bucketColumn ::db.dsv.column/columnName)
(s/def ::aggregation.bubble/metricColumn (s/nilable ::db.dsv.column/columnName))
(s/def ::aggregation.bubble/metricAggregation ::aggregation.bar/metricAggregation)

(s/def ::aggregation.bubble/query (s/keys :req-un [::postgres.filter/filters

            [akvo.lumen.lib.aggregation.bubble :as aggregation.bubble]
            [akvo.lumen.lib.aggregation.line :as aggregation.line]
            [akvo.lumen.lib.aggregation.pie :as aggregation.pie]
            [akvo.lumen.lib.aggregation.pivot :as aggregation.pivot]
            [akvo.lumen.lib.aggregation.scatter :as aggregation.scatter]
            [akvo.lumen.postgres.filter :as postgres.filter]
            [akvo.lumen.specs.db :as db.s]
            [clojure.spec.alpha :as s]))

(create-ns  'akvo.lumen.specs.aggregation.query)
(alias 'aggregation.query.s 'akvo.lumen.specs.aggregation.query)

(alias 'db.dsv.column.s 'akvo.lumen.specs.db.dataset-version.column)
(alias 'db.dsv.s 'akvo.lumen.specs.db.dataset-version)

(s/def ::aggregation/dataset (s/keys :req-un [::db.dsv.s/columns ::db.dsv.s/table-name]))
(s/def ::aggregation.pie/bucketColumn ::db.dsv.column.s/columnName)
(s/def ::aggregation.pie/query (s/keys :req-un [::postgres.filter/filters
                                                ::aggregation.pie/bucketColumn]))

