Downcast the `DataSourceExec`'s `data_source` to a specific file source Returns `None` if 1. the datasource is not scanning files (`FileScanConfig`) 2. The [`FileScanConfig::file_source`] is not of type `T`
(
&self,
)
| 595 | /// 1. the datasource is not scanning files (`FileScanConfig`) |
| 596 | /// 2. The [`FileScanConfig::file_source`] is not of type `T` |
| 597 | pub fn downcast_to_file_source<T: FileSource>( |
| 598 | &self, |
| 599 | ) -> Option<(&FileScanConfig, &T)> { |
| 600 | self.data_source() |
| 601 | .downcast_ref::<FileScanConfig>() |
| 602 | .and_then(|file_scan_conf| { |
| 603 | file_scan_conf |
| 604 | .file_source() |
| 605 | .downcast_ref::<T>() |
| 606 | .map(|source| (file_scan_conf, source)) |
| 607 | }) |
| 608 | } |
| 609 | } |
| 610 | |
| 611 | /// Create a new `DataSourceExec` from a `DataSource` |
nothing calls this directly
no test coverage detected