Open ghost opened 3 years ago
Hi guys, any update on this error? I have the same issue
Hi @thijsnijhuis and @udossa
.format("excel")
Credit to #133 Apache commons dependency issue by @jakeatmsft and @fwani solution
@quanghgx , thanks for your reply. I have changed it but now I simply get this eror: java.lang.ClassNotFoundException: Failed to find data source: excel. Please find packages at http://spark.apache.org/third-party-projects.html
I will need to take a look at the wiki link later on. Thanks!
@thijsnijhuis
I think, you should add a dependency for excel
that is com.crealytics:spark-excel_2.12
with specific version, first.
(because the error is java.lang.ClassNotFoundException: Failed to find data source: excel
)
https://github.com/crealytics/spark-excel#linking
Please try and change the library installation to Maven, that resolved my issue.
I am using Azure Databricks and I am trying to read an Excel file (xlsx) from a Storage account (ADLS Gen2). Because I get an 'Anonymous access' error when I connect to the file using the wasbs path I mounted it and tried to read the excel from there. This is my code:
`df = spark.read \ .format("csv") \ .option("header", "true") \ .option("delimiter", ";") \ .load("/mnt/mountPoint/Budget.csv")
df = spark.read \ .format("com.crealytics.spark.excel") \ .option("header", "true") \ .option("sheetName", "Sheet1") \ .load("/mnt/mountPoint/Budget.xls")
df = spark.read \ .format("com.crealytics.spark.excel") \ .option("header", "true") \ .option("sheetName", "Sheet1") \ .load("/mnt/mountPoint/Budget.xlsx") `
The first command succeeds and I get the headers from the file. A df.show() will show me the content. The second command (using the xls) succeeds as well and I get the schema and content. The third command fails with this error: java.lang.NoClassDefFoundError: Could not initialize class shadeio.poi.xssf.model.SharedStringsTable
I am using Databricks runtime 8.3 with Apache Spark 3.1.1 and Scala 2.12. What I have tried so far (all with the same error):
This this the full stack trace. Any help is very much appreciated!' `--------------------------------------------------------------------------- Py4JJavaError Traceback (most recent call last)