-
Notifications
You must be signed in to change notification settings - Fork 2
spark shell: How To
James W. Kimani edited this page Feb 10, 2018
·
3 revisions
spark-shell
or
In case you need to use other libraries not included in spark
spark-shell --jars <location of jar files>
import com.databricks.spark.avro._
import org.apache.spark.sql._
val spark: SparkSession = SparkSession.builder.getOrCreate()
val df = spark.read.avro("/spark-warehouse/product_avro_table/part-00000-39888027-8365-49c2-8217-8294062cc595.avro")
val df = spark.read.format("orc").load("/spark-warehouse/product_orc_table/part-00000-6c329148-858e-4742-81f4-b40760a34acf.snappy.orc")
df.count
df.schema