PARQUET-1851: fix parquet metadata converter NPE#852
PARQUET-1851: fix parquet metadata converter NPE#852gszadovszky merged 3 commits intoapache:masterfrom
Conversation
|
As I've commented in the jira I think this fix is not complete. I am no against adding a null check here but it will not solve the potential problem of writing an empty row group. |
|
@gszadovszky Thanks for the comment and it makes sense to me. How about throwing an exception when detecting the row group's count is zero? Does that sound reasonable to you? PS. the space changes in the PR is automatically fixed by idea IDE. If you don't like it, I can handle it. |
gszadovszky
left a comment
There was a problem hiding this comment.
Thanks a lot for the changes. Please find my only comment in the code. Otherwise it looks good to me.
| */ | ||
| public void endBlock() throws IOException { | ||
| if (currentRecordCount == 0) { | ||
| throw new IOException("End block with zero record"); |
There was a problem hiding this comment.
I would suggest using a ParquetEncodingException instead.
There was a problem hiding this comment.
The empty parquet files was used in Drill earlier and now this change breaks the possibility to store empty tables (with header schema only) in parquet files. Any suggestions to bypass this and integrate Parquet-1.12.0 to Drill?
@gszadovszky @chenjunjiedada
There was a problem hiding this comment.
@vdiravka, you might want to create a separate jira about this topic so we can discuss it in a more open way. Please, also describe what the empty parquet files are used for.
There was a problem hiding this comment.
This fixes the NPE as below: