 (defn schema-from-url
   "Return a schema as a map from a parquet table at **url**.
 
-  See [[setup-temp-view]] for `:type` key."
+  See [[setup-temporary-view]] for `:type` key."
   [url & {:keys [type]}]
   (-> (query url "select * from tmp" :type type)
       (schema)))

          (.putAll options)))
    (if (and (nil? schema) infer-schema?)
      (.put options "inferSchema" "true"))
    (-> (sql-context)
        .read
        (.format (name type))
        (.options options)
        ((fn [df]
           (if infer-schema?
             (.schema df schema))
           df))
        .load
        ((fn [df]
           (if table-name
             (.createOrReplaceTempView df table-name)
             df))))))

(defn query
  "Query a parquet file at **url** with **sql** statement creating temporary
  table key **table** (default to `tmp`).

  See [[setup-temp-view]] for `:type` key."
  [url sql & {:keys [table partitions] :as m
              :or {table "tmp"}}]
  (apply setup-temp-view url table (apply concat m))
  (-> (.getOrCreate (SparkSession/builder))
      (.sql sql)
      ((fn [df]

  ([^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]
