โ05-07-2019 05:14 AM
0
I have a excel file as source file and i want to read data from excel file and convert data in data frame using databricks. I have already added maven dependence for Excel file format. when i a tring below code it is giving error .(Error: java.io.FileNotFoundException: /FileStore/tables/Airline.xlsx (No such file or directory) But file is available. Please help me on this code.
val df = spark.read.format("com.crealytics.spark.excel")
.option("location", "/FileStore/tables/Airline.xlsx")
.option("useHeader", "true")
.option("treatEmptyValuesAsNulls", "false")
.option("inferSchema", "false")
.option("addColorColumns", "false")
.load("/FileStore/tables/Airline.xlsx")
โ05-07-2019 07:46 AM
Hi,
You can try -
val df = spark.read
.format("org.zuinnote.spark.office.excel")
.option("read.spark.useHeader", "true")
.load("dbfs:/FileStore/tables/Airline.xlsx")
โ06-11-2019 01:39 AM
@[email protected].. Hi Ashish... I'm getting error java.lang.NoSuchMethodError: org.apache.spark.sql.execution.datasources.FileFormat.$init$(Lorg/apache/spark/sql/execution/datasources/FileFormat;) when I used your logic..
I have installed spark_hadoopoffice_ds_2_12_1_3_1.jar for the above class.. Please help
โ06-27-2019 04:11 PM
I have the same problem, did you solve it?
โ09-24-2019 06:00 AM
For me the problem was the library was for scala 2.12 and my cluster was running scale 2.11 (should've been spark_hadoopoffice_ds_2_11_1_3_1)
Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections.
Click here to register and join today!
Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.