   ([^Dataset df type- f]
    (.flatMap df (flat-map-function f) (encoder-for-type type-))))
 
-(defn ^Dataset flat-map
-  "Similar to `map`, but each input item can be mapped to 0 or more output
-  items (so the function `f` should return a collection rather than a single
-  item)"
-  ([^Dataset df f] (flat-map df :object f))
-  ([^Dataset df type- f]
-   (.flatMap df (flat-map-function f) (encoder-for-type type-))))
-
 (defn ^Dataset for-each-partition
   "Run function **f** for each partition in a dataframe."
   [^Dataset df f]

    (.put options "quote" quote)
    (if schema
      (-> sql-context .read (.format "csv") (.options options) (.schema schema) .load)
      (-> sql-context .read (.format "csv") (.options options) .load)
      )))


(defn register-data-frame-as-table
  "Registers the given DataFrame as a temporary table in the

(defn schema-from-url
  "Return a schema as a map from a parquet table at **url**.

  See [[setup-temporary-view]] for `:type` key."
  [url & {:keys [type]}]
  (-> (query url "select * from tmp" :type type)
      (schema)))
