Open nicoricimadalina opened 2 years ago
Spark version: 3.1.2 and 3.2.0 with java 11. Spark-Excel version: 3.1.2_0.15.0, 3.1.2_0.15.2, 3.1.2_0.15.2 and 3.1.2_0.16.0. Tried all the versions mentioned above but got an Exception.
Version: 0.14.0 is working. com.crealytics:spark-excel_2.12:0.14.0
Hi @cristichircu, in PR #562 I came across a multi thread issue with the code change you provided. I have a fix for this thread issue and two ways of doing it (see comment https://github.com/crealytics/spark-excel/pull/562#issuecomment-1064914743). Since you came up with the initial code fragment you might can answer my question: Is it neccessary to re-register the providers each time we do a getWorkbook() a on the workbook or is it sufficient to just do it once?
Hey @christianknoepfle! No, we don't need to do it every time. Once is ehough. I just couldn't figure out a better place to put it so it would get called once. Thanks for looking into this!
Hi @cristichircu , thanks for the quick feedback. registerProviders() is now called only once. I moved the function call from getWorkbook() to ExcelHelper.apply() (and made the ctor of ExcelHelper private) just in case someone comes up with another method in ExcelHelper for getting the workbook and forgets about the initialization
Previously working code for reading an excel file with the v2 format is failing after upgrading the library from 0.14.0 to the 0.15.1 version.
Expected Behavior
Reading with the format("excel") still works as with previous versions.
Current Behavior
Reading my excel file works for the format("com.crealytics.spark.excel") but with the format("excel") fails with the exception:
Possible Solution
The issue seems similar to the one fixed in the 0.15.1 version where some providers were added in WorkbookReader.
Steps to Reproduce (for bugs)
I'm reading my file similar to this:
Context
The issue was discovered trying to upgrade the library to the latest version.
Your Environment