adriangb commented on code in PR #18253:
URL: https://github.com/apache/datafusion/pull/18253#discussion_r2465644684
##########
datafusion/datasource/src/file_scan_config.rs:
##########
@@ -455,6 +464,10 @@ impl FileScanConfigBuilder {
file_compression_type.unwrap_or(FileCompressionType::UNCOMPRESSED);
let new_lines_in_values = new_lines_in_values.unwrap_or(false);
+ let projection = projection_indices.as_ref().map(|indices| {
+ ProjectionExprs::from_indices(indices, table_schema.table_schema())
+ });
Review Comment:
That's a good question. The main place where this API is used by actual
users is in `TableProvider::scan_with_args`. The projection pushed down into
`TableProvider` is a `Vec<usize>` so that's all you have. I'd argue that we
should change that so that the full expression tree gets pushed down there as
well. But for now we can either:
1. Put a convenience method on `FileScanConfigBuilder` like you say.
2. Make users call `ProjectionExprs::from_indices(&projection, &schema)` or
something like that which seems like it isn't too bad and keeps us from adding
a method we know we probably want to remove later.
--
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]