kszucs opened a new issue, #55342:
URL: https://github.com/apache/arrow/issues/55342

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   The Parquet reader treats a data page without values (`num_values = 0`) as 
the end of the column chunk and silently skips the rest of it. A column chunk 
starting with such a page reads as 0 rows, or fails with `ArrowInvalid` when 
only some of the columns are affected.
   
   parquet-rs 58.1.0 to 60.1.0 writes such pages when content-defined chunking 
is enabled (apache/arrow-rs#10929); arrow-rs and DuckDB read them correctly.
   
   Reproducer with pyarrow 26.0.0 (plus `fsspec` and `aiohttp`), reading 
`empty_data_pages.parquet` from apache/parquet-testing#131:
   
   ```python
   import pyarrow.parquet as pq
   
   url = 
"https://raw.githubusercontent.com/kszucs/parquet-testing/empty-data-pages/data/empty_data_pages.parquet";
   print(pq.read_table(f"fsspec+{url}").num_rows)  # 0 instead of 3
   ```
   
   while DuckDB reads the three rows:
   
   ```
   $ duckdb -c "SELECT * FROM 
'https://raw.githubusercontent.com/kszucs/parquet-testing/empty-data-pages/data/empty_data_pages.parquet'"
   ┌───────┐
   │ int64 │
   │ int64 │
   ├───────┤
   │     1 │
   │     2 │
   │     3 │
   └───────┘
   ```
   
   The cause is `ColumnChunkReader::EnsureDataPage()` in 
`cpp/src/parquet/column_reader.cc`, which returns false when the next data page 
has no values.
   
   ### Component(s)
   
   C++, Parquet
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to