A library for querying Excel files with Apache Spark, for Spark SQL and DataFrames.
This library requires Spark 1.4+
You can link against this library in your program at the following coordinates:
groupId: com.crealytics
artifactId: spark-excel_2.10
version: 0.8.3
groupId: com.crealytics
artifactId: spark-excel_2.11
version: 0.8.3
This package can be added to Spark using the --packages
command line option. For example, to include it when starting the spark shell:
$SPARK_HOME/bin/spark-shell --packages com.crealytics:spark-excel_2.11:0.8.3
$SPARK_HOME/bin/spark-shell --packages com.crealytics:spark-excel_2.10:0.8.3
This package allows querying Excel spreadsheets as Spark DataFrames.
Spark 1.4+:
Create a DataFrame from an Excel file:
import org.apache.spark.sql.SQLContext
val sqlContext = new SQLContext(sc)
val df = sqlContext.read
.format("com.crealytics.spark.excel")
.option("location", "Worktime.xlsx")
.option("sheetName", "Daily")
.option("useHeader", "true")
.option("treatEmptyValuesAsNulls", "true")
.option("inferSchema", "true")
.option("addColorColumns", "true")
.load()
This library is built with SBT.
To build a JAR file simply run sbt assembly
from the project root.
The build configuration includes support for both Scala 2.10 and 2.11.