Create a rule to push the projections used in aggregate functions. From Julian Hyde:
Calcite should realize that Aggregate has an implied Project (because it only uses a few columns) and push that projection into the CsvTableScan, but it doesn’t.
A query scans only the used projection when no aggregation is used:
But it scans all the projections when an aggregation is used: