jayzhan211 commented on issue #12010: URL: https://github.com/apache/datafusion/issues/12010#issuecomment-2295173846
I take a look at the code around `FileScanConfig` and `ParquetExec`. My understanding is that the `target` schema you mentioned -- I think it is also known as `table_schema` could get from `FileScanConfig::project`. If you want to specify the location of partition columns, `FileScanConfig::with_projection` let you choose the order of `fields` + `partition columns`. https://github.com/apache/datafusion/blob/cb1e3f0e5cfd04195ae0c933b74f3eb3fcbe1b45/datafusion/core/src/datasource/physical_plan/file_scan_config.rs#L224-L244 However, the `table schema` is stored as part of the properties in `ParquetExec`'s `cache`. https://github.com/apache/datafusion/blob/cb1e3f0e5cfd04195ae0c933b74f3eb3fcbe1b45/datafusion/core/src/datasource/physical_plan/parquet/mod.rs#L406-L412 I think we could store the `table_schema` in `ParquetExec` explicitly as `table_schema`, and we can get it for `ParquetExec::execute`. Then we could replace the `table_schema` in `ParquetOpener` with the one from `ParquetExec`. If you have the `table_schema` from `FileScanConfig::projection` in `ParquetOpener`, does this help? -- 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]
