manuzhang opened a new pull request, #1008:
URL: https://github.com/apache/iceberg-cpp/pull/1008

   Metadata table scans currently always return every column. Java's metadata 
tables support `newScan().select(...)`: `StaticDataTask` projects each row to 
`scan.schema()`, so an engine running `SELECT name FROM t.refs` only gets 
`name`. This adds the same column selection to C++ metadata tables.
   
   - Add `ColumnSelection` (column names plus case sensitivity), 
`MetadataTable::Scan(const ColumnSelection&)`, and 
`TimeTravelMetadataTable::Scan(const SnapshotSelection&, const 
ColumnSelection&)`. Names resolve through `Schema::Select`, as in 
`TableScanBuilder::Select`: nested names are dot-concatenated, columns come 
back in schema order, `*` selects all columns, and unknown names are ignored 
(as in Java's `Schema.select`). An empty list returns rows without columns, 
which is enough to count rows.
   - `Scan()` is no longer virtual. Tables implement the protected 
`ScanProjection(const Schema& projected_schema)` instead, and `ScanSnapshot` 
also receives the projected schema.
   - Add `inspect/metadata_table_columns_internal.h`, which maps the projected 
columns to per-column append functions so a table builds only the selected 
columns. Selecting only some fields of a nested struct column returns 
`NotSupported` for now; no current metadata table has a struct column.
   - `SnapshotsTable` builds only the selected columns; for example, it no 
longer copies the `summary` map unless that column is selected. 
`HistoryTable::Scan` still returns `NotSupported`.
   
   Open metadata table PRs (#876, #920, #1007) will need to override 
`ScanProjection(const Schema&)` instead of `Scan()`.
   
   Validation: pre-commit passed. All 18 `metadata_table_test` cases pass 
locally, including 8 new ones covering selection order, unknown names, case 
sensitivity, `*` and no selection, an empty selection, map columns, time-travel 
scans (using a recording test table), and `HistoryTable`. The changed public 
headers also compile as a C++20 consumer.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to