    (extract-key-value key record-or-key-value {}))
 
   ([key record-or-key-value {:keys [key-value]}]
-   (let [key (flatten (v/coerce key)) ;; flatten partition key
-         key-value (or (v/coerce key-value nil)
+   (let [key (flatten-key key)
+         key-value (or (flatten-key key-value)
                        (if-not (map? record-or-key-value)
-                         (v/coerce record-or-key-value)
+                         (flatten-key record-or-key-value)
                          (repeat (count key) nil)))
          record (when (map? record-or-key-value)
                   record-or-key-value)

  "true if the record contains? keys for all the key components"
  [key record]
  (->> key
       flatten
       (map #(contains? record %))
       (every? identity)))

  ([key record col-colls]
   (when-let [kv (not-empty
                  (extract-key-value key record {}))]
     (let [key (flatten-key key)
           col-values (mapv (fn [k v]
                              (extract-collection-key-components
                               col-colls
