How to gracefully handle and exit when sheet is empty #711
Unanswered
rbharathkumar
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @rbharathkumar, you can use an ordinary |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
Hope you are all doing well.
With your help a long time ago, I am successfully able to read an excel with multiple sheets.
Sheets are read as suggested by getting the sheet names in advance and looping through them.
Also read with schema and has a header.
But we have seen instances when one of the sheet is empty - as in it does not even have a header - just the sheet name.
Totally empty. The job is failing as expected although the error message is a little unclear.
NoSuchElementException: head of empty list
Is there a way I can identify that the sheet is empty and give out an appropriate error message like
Sheet is Empty
before aborting.Would be nice to have a clearer message if possible.
Thank you for all the hard work in maintaining and updating spark-excel with new features regularly.
Cheers...
Beta Was this translation helpful? Give feedback.
All reactions