   (:require [taoensso.timbre :as timbre])
   (:require [clojure.core.cache :as cache])
   (:require [cavm.h2-unpack-rows :as unpack])
-  (:require [cavm.statement :refer [sql-stmt cached-statement]])
+  (:require [cavm.statement :refer [sql-stmt sql-stmt-result cached-statement]])
   (:gen-class))
 
 ;

                      (quote-ent table) field-str val-str)]
     (sql-stmt (jdbc/find-connection) stmt-str fields)))

(def batch-size 1000)

(defn- table-writer-default [dir dataset-id matrix-fn]

                                                  :valueType :visibility])
              score-stmt (insert-stmt :scores [:id :scores])
              field-stmt (insert-stmt :field [:id :dataset_id :name])
              field-score-stmt (insert-stmt :field_score [:field_id :scores_id :i])
              field-seq-stmt (sequence-stmt "FIELD_IDS")
              scores-seq-stmt (sequence-stmt "SCORES_IDS")
              feature-seq-stmt (sequence-stmt "FEATURE_IDS")]
    (let [feature-seq #(-> (feature-seq-stmt []) first :i)
          field-seq #(-> (field-seq-stmt []) first :i)
          scores-seq #(-> (scores-seq-stmt []) first :i)
          ; XXX try memoization again?
          ;        score-id-fn (memoize-key (comp ahashable first) scores-seq)

