(&self, partitioned_file: PartitionedFile)
| 68 | |
| 69 | impl FileOpener for ProjectionOpener { |
| 70 | fn open(&self, partitioned_file: PartitionedFile) -> Result<FileOpenFuture> { |
| 71 | let partition_values = partitioned_file.partition_values.clone(); |
| 72 | // Modify any references to partition columns in the projection expressions |
| 73 | // and substitute them with literal values from PartitionedFile.partition_values |
| 74 | let projection = if self.partition_columns.is_empty() { |
| 75 | self.projection.clone() |
| 76 | } else { |
| 77 | inject_partition_columns_into_projection( |
| 78 | &self.projection, |
| 79 | &self.partition_columns, |
| 80 | partition_values, |
| 81 | ) |
| 82 | }; |
| 83 | let projector = projection.make_projector(&self.input_schema)?; |
| 84 | |
| 85 | let inner = self.inner.open(partitioned_file)?; |
| 86 | |
| 87 | Ok(async move { |
| 88 | let stream = inner.await?; |
| 89 | let stream = stream.map(move |batch| { |
| 90 | let batch = batch?; |
| 91 | let batch = projector.project_batch(&batch)?; |
| 92 | Ok(batch) |
| 93 | }); |
| 94 | Ok(stream.boxed()) |
| 95 | } |
| 96 | .boxed()) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | #[derive(Debug, Clone, Copy)] |
nothing calls this directly
no test coverage detected