     (doseq [{:keys [columns table-name] :as source-data-group}  data-groups-to-be-created]
       (let [data (->>
                   (fetch-data-2 conn {:source-data-group source-data-group
-                                         :source {:merge-column (get source "mergeColumn")
-                                                  :table-name (:table-name source-dataset)
-                                                  :aggregation-column (get source "aggregationColumn")
-                                                  :aggregation-direction (get source "aggregationDirection")
-                                                  :spec source}
-                                         :target {:merge-column (get target "mergeColumn")
-                                                  :table-name (:table-name target-merge-data-group)}})
+                                      :source {:merge-column (get source "mergeColumn")
+                                               :table-name (:table-name source-dataset)
+                                               :aggregation-column (get source "aggregationColumn")
+                                               :aggregation-direction (get source "aggregationDirection")
+                                               :spec source}
+                                      :target {:merge-column (get target "mergeColumn")
+                                               :table-name (:table-name target-merge-data-group)}})
                   (map #(to-sql-types % (walk/stringify-keys columns))))]
         (postgres/create-dataset-table conn table-name (map #(update % :id (fn [_]
                                                                              (:columnName %)))

  [conn table-name columns]
  (doseq [column columns]
    (db.tx.engine/add-column conn {:table-name table-name
                      :new-column-name (get column "columnName")
                      :column-type (condp = (get column "type")
                                     "date" "timestamptz"
                                     "geopoint" "geometry(POINT, 4326)"
                                     "geoshape" "geometry(GEOMETRY, 4326)"
                                     "number" "double precision"
                                     "multiple" "text"
                                     "text" "text"
                                     "option" "text")})))

(defn insert-merged-data
  "Insert the merged values into the target dataset"


(defn ->pggeometry [value]
  (doto
      (PGgeometry/geomFromString value)
    (.setSrid 4326)))

(defn ->timestamp [value]
