Skip to content

Instantly share code, notes, and snippets.

@zero323
Last active August 29, 2015 14:26
Show Gist options
  • Save zero323/df674b939d3bbd109e17 to your computer and use it in GitHub Desktop.
Save zero323/df674b939d3bbd109e17 to your computer and use it in GitHub Desktop.
(import org.apache.spark.sql.Row$)
(import scala.collection.JavaConversions)
(import org.apache.spark.sql.RowFactory)
(defn vec->row1 [v]
(let [s (-> v JavaConversions/asScalaBuffer .toSeq)]
(.fromSeq Row$/MODULE$ s)))
(defn vec->row2 [v]
(RowFactory/create (into-array Object v)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment