     (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 %)))


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

(defn ->timestamp [value]

                                               (-> column
                                                   (assoc "sourceColumnName" (get column "columnName")
                                                          "columnName" (engine/derivation-column-name
                                                                        (+ (engine/next-column-index target-dataset-columns) i)))
                                                   reset-column-values))))
                              (group-by #(get % "groupId")))
        instance-id-column (->> (db.data-group/get-data-group-by-column-name ;; TODO: define column as a var? (def instance-id-col {})
                                 conn
