[
https://issues.apache.org/jira/browse/PARQUET-2219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17656711#comment-17656711
]
ASF GitHub Bot commented on PARQUET-2219:
-----------------------------------------
shangxinli commented on code in PR #1018:
URL: https://github.com/apache/parquet-mr/pull/1018#discussion_r1066038932
##########
parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java:
##########
@@ -927,7 +925,15 @@ public PageReadStore readRowGroup(int blockIndex) throws
IOException {
* @return the PageReadStore which can provide PageReaders for each column.
*/
public PageReadStore readNextRowGroup() throws IOException {
- ColumnChunkPageReadStore rowGroup = internalReadRowGroup(currentBlock);
+ ColumnChunkPageReadStore rowGroup = null;
+ try {
+ rowGroup = internalReadRowGroup(currentBlock);
+ } catch (ParquetEmptyBlockException e) {
+ LOG.warn("Read empty block at index {}", currentBlock);
Review Comment:
Any way to add file path?
> ParquetFileReader throws a runtime exception when a file contains only
> headers and now row data
> -----------------------------------------------------------------------------------------------
>
> Key: PARQUET-2219
> URL: https://issues.apache.org/jira/browse/PARQUET-2219
> Project: Parquet
> Issue Type: Bug
> Components: parquet-mr
> Affects Versions: 1.12.1
> Reporter: chris stockton
> Assignee: Gang Wu
> Priority: Minor
>
> Google BigQuery has an option to export table data to Parquet-formatted
> files, but some of these files are written with header data only. When this
> happens and these files are opened with the ParquetFileReader, an exception
> is thrown:
> {{RuntimeException("Illegal row group of 0 rows");}}
> It seems like the ParquetFileReader should not throw an exception when it
> encounters such a file.
> https://github.com/apache/parquet-mr/blob/master/parquet-hadoop/src/main/java/org/apache/parquet/hadoop/ParquetFileReader.java#L949
--
This message was sent by Atlassian Jira
(v8.20.10#820010)