     (with-open [importer (import/dataset-importer (get data-source-spec "source") import-config)]
       (let [initial-dataset-version  (initial-dataset-version-to-update-by-dataset-id conn {:dataset-id dataset-id})
             imported-dataset-columns (vec (:columns initial-dataset-version))
-            importer-columns         (p/columns importer)]
-        (if-let [compatible-errors (compatible-columns-error? imported-dataset-columns importer-columns)]
+            importer-columns         (p/columns importer)
+
+            columns-used (columns-used-in-txs
+                          initial-dataset-version
+                          (latest-dataset-version-by-dataset-id tenant-conn {:dataset-id dataset-id}))
+            imported-dataset-columns-checked (reduce (fn [c co]
+                                                       (if (contains? columns-used (get co "columName"))
+                                                         (conj c co)
+                                                         c)) [] imported-dataset-columns)]
+        (if-let [compatible-errors (compatible-columns-error? imported-dataset-columns-checked importer-columns)]
           (failed-update conn job-execution-id
                          (cond-> "Column mismatch"
                            (seq (:missed-columns compatible-errors))

(hugsql/def-db-fns "akvo/lumen/lib/job-execution.sql")
(hugsql/def-db-fns "akvo/lumen/lib/transformation.sql")
(hugsql/def-db-fns "akvo/lumen/lib/dataset.sql")

(defn- successful-update
  "On a successful update we need to create a new dataset-version that

     (lib/ok {"updateId" job-execution-id}))))




