                 data-groups-to-be-created (adapt data-groups-to-be-created data-groups)]
             (let [applied-txs (conj applied-txs
                                     (assoc transformation "changedColumns"
-                                           (diff-columns previous-columns columns)))]
+                                           (diff-columns (:columns data-group)  columns)))]
               (db.job-execution/vacuum-table conn {:table-name (:table-name data-group)})
               (recur (rest transformations)
                      (reduce (fn [c dg]

        tx-data {:data-groups data-groups
                 :job-execution-id job-execution-id
                 :transformation transformation}
        {:keys [columns previous-columns data-groups-to-be-created data-group]}
        (try-apply-operation-2 deps tx-data)]
    (post-try-apply-operation-2 deps tx-data
                                {:columns columns
                                 :dataset-version dataset-version
                                 :previous-columns previous-columns
                                 :data-group data-group
                                 :data-groups-to-be-created data-groups-to-be-created})))


      (throw (ex-info (or message "") {:transformation-result (select-keys res [:success? :message :columns :execution-log])})))
    {:data-groups-to-be-created (or data-groups-to-be-created [])
     :columns columns
     :data-group data-group}))

(defn adapt [data-groups-to-be-created data-groups]
