 (defn create-or-replace-temp-view [v-name]
   (.createOrReplaceTempView v-name))
 
-(defn encoder-for-type
-  "Create a Spark SQL Encoder for **type**.  The available options for
-  **type** are:
-
+(defn ^Encoder encoder-for-type
+  "Create a Spark SQL Encoder for **type-**.  The available options for
+  **type-** are:
+
+  * a class to be encoded
+  * an Encoder instance
   * :object
   * :string
   * :boolean

  * :integer
  * :long
  * :string-tuple"
  [type]
  (cond (instance? java.lang.Class type) (Encoders/javaSerialization type)
        (keyword? type)
        (case type
          :object (Encoders/javaSerialization java.io.Serializable)
          :string (Encoders/STRING)
          :boolean (Encoders/BOOLEAN)

           [org.apache.spark.sql.hive HiveContext]
           [org.apache.spark.sql.expressions Window]
           [org.apache.spark.sql.types DataTypes]
           [org.apache.spark.sql Encoder Encoders]))

;; ## SQLContext

