Commit 346f13d
Allow reading Parquet files without explicit projection
Currently, `ParquetReader` requires `ReaderOptions::projection` to be set, otherwise it returns an error. This change allows the reader to infer the schema from the Parquet file metadata if the projection is not provided.
- Modified `src/iceberg/parquet/parquet_reader.cc` to fallback to inferring schema from the file if `projection` is null.
- Added `src/iceberg/test/parquet_reader_no_projection_test.cc` to verify the fix.
- Used `ArrowSchemaGuard` to prevent memory leaks when handling Arrow C schemas.
Co-authored-by: wgtmac <4684607+wgtmac@users.noreply.github.com>1 parent 4c0124c commit 346f13d
2 files changed
Lines changed: 4 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | 37 | | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
0 commit comments