Commit 9e384cc
apacheGH-514: [Parquet] Infer schema when projection is null in ParquetReader
This change enables reading Parquet files without an explicit projection schema.
If `options.projection` is not provided, the reader now infers the Iceberg schema
from the Parquet file's Arrow schema using the Arrow C++ API.
* Modified `src/iceberg/parquet/parquet_reader.cc`:
* Removed null check for `projection` in `Open`.
* Implemented `InferIcebergSchema` and `ConvertArrowType` to convert `arrow::Schema` to `iceberg::Schema` directly, avoiding complex C-ABI/nanoarrow dependencies.
* Used inferred schema when `projection` is null.
* Used `::arrow::` prefix to avoid namespace ambiguity.
* Added `src/iceberg/test/parquet_reader_no_projection_test.cc` to verify the fix.
* Updated `src/iceberg/test/CMakeLists.txt` to register the new test file.
Co-authored-by: wgtmac <4684607+wgtmac@users.noreply.github.com>1 parent e4c20cf commit 9e384cc
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
0 commit comments