apache / iceberg-rust

Apache Iceberg
https://rust.iceberg.apache.org/
Apache License 2.0
673 stars 159 forks source link

bug: TableScanBuilder should take care of empty projections #676

Closed sundy-li closed 4 weeks ago

sundy-li commented 1 month ago

For query select count() from table, the project is empty, so table should not scan any columns and return an RecordBatch with empty arrays and the true row count (by parquet metadata).

Yet it scans all columns.

// Empty column names means to select all columns
    column_names: Vec<String>,

 /// Select all columns.
    pub fn select_all(mut self) -> Self {
        self.column_names.clear();
        self
    }
sundy-li commented 1 month ago

/assign me

Xuanwo commented 1 month ago

Thank you @sundy-li for working on this!