Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// import this guy
import org.apache.spark.sql.hive.HiveContext
// this should look familiar
val conf = new SparkConf()
val sc = new SparkContext(conf)
// setup this fella
val hiveContext = new HiveContext(sc)
val rdd = ... // this is where the data goessssss
// boom shocka-locka, turn that RDD into a DF
hiveContext.createDataFrame(rdd)
.option("orc.compress", "snappy")
.mode(SaveMode.Append)
.orc("/this/is/yet/another/hdfs/directory/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment