Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when the first row of a sheet has only empty fields. #4

Closed
virtualramblas opened this issue Mar 21, 2017 · 3 comments

Comments

@virtualramblas
Copy link

virtualramblas commented Mar 21, 2017

Hi everybody. I found the following issue using the release 0.8.2 of the library for Scala 2.11 (and Spark 1.6.2): when the selected sheet to transform to DataFrame has the first row containing only empty fields it throws a NullPointerException:

17/03/21 23:03:49 INFO BlockManagerMaster: Registered BlockManager
Exception in thread "main" java.lang.NullPointerException
at com.crealytics.spark.excel.ExcelRelation.(ExcelRelation.scala:30)
at com.crealytics.spark.excel.DefaultSource.createRelation(DefaultSource.scala:31)
at com.crealytics.spark.excel.DefaultSource.createRelation(DefaultSource.scala:7)
at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)
at com.optum.sparkexcelpoc.DataFrameFromExcel$.main(DataFrameFromExcel.scala:30)
at com.optum.sparkexcelpoc.DataFrameFromExcel.main(DataFrameFromExcel.scala)

Browsing the source code I found the root cause of the problem and how to fix it. Please let me know if you're happy to have me fixing it and what procedure do you follow to accept changes. Thanks a lot.

@nightscape
Copy link
Collaborator

A PR would be great!
As the project currently doesn't have any tests, we don't have any specific procedures for accepting changes.
I'll just do a quick code review.

@virtualramblas
Copy link
Author

Hi Martin,

Thanks a lot for the reply. Going to do a PR as soon as the code is ready and tested. Thanks a lot.

Best Regards,
Guglielmo

virtualramblas added a commit to virtualramblas/spark-excel that referenced this issue Mar 23, 2017
@virtualramblas
Copy link
Author

This issue has been solved through commit 8427d1e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants