You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/library-user-guide/upgrading.md
+115Lines changed: 115 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -202,6 +202,121 @@ Additionally, the FFI structure for Scalar UDF's no longer contains a
202
202
`return_type` call. This code was not used since the `ForeignScalarUDF`
203
203
struct implements the `return_field_from_args` instead.
204
204
205
+
### Projection handling moved from FileScanConfig to FileSource
206
+
207
+
Projection handling has been moved from `FileScanConfig` into `FileSource` implementations. This enables format-specific projection pushdown (e.g., Parquet can push down struct field access, Vortex can push down computed expressions into un-decoded data).
208
+
209
+
**Who is affected:**
210
+
211
+
- Users who have implemented custom `FileSource` implementations
212
+
- Users who use `FileScanConfigBuilder::with_projection_indices` directly
213
+
214
+
**Breaking changes:**
215
+
216
+
1.**`FileSource::with_projection` replaced with `try_pushdown_projection`:**
217
+
218
+
The `with_projection(&self, config: &FileScanConfig) -> Arc<dyn FileSource>` method has been removed and replaced with `try_pushdown_projection(&self, projection: &ProjectionExprs) -> Result<Option<Arc<dyn FileSource>>>`.
219
+
220
+
2.**`FileScanConfig.projection_exprs` field removed:**
221
+
222
+
Projections are now stored in the `FileSource` directly, not in `FileScanConfig`.
223
+
Various public helper methods that access projection information have been removed from `FileScanConfig`.
224
+
225
+
3.**`FileScanConfigBuilder::with_projection_indices` now returns `Result<Self>`:**
226
+
227
+
This method can now fail if the projection pushdown fails.
228
+
229
+
4.**`FileSource::create_file_opener` now returns `Result<Arc<dyn FileOpener>>`:**
230
+
231
+
Previously returned `Arc<dyn FileOpener>` directly.
232
+
Any `FileSource` implementation that may fail to create a `FileOpener` should now return an appropriate error.
We recommend you look at [#18627](https://github.com/apache/datafusion/pull/18627)
294
+
that introduced these changes for more examples for how this was handled for the various built in file sources.
295
+
296
+
We have added [`SplitProjection`](https://docs.rs/datafusion-datasource/latest/datafusion_datasource/projection/struct.SplitProjection.html) and [`ProjectionOpener`](https://docs.rs/datafusion-datasource/latest/datafusion_datasource/projection/struct.ProjectionOpener.html) helpers to make it easier to handle projections in your `FileSource` implementations.
297
+
298
+
For file sources that can only handle simple column selections (not computed expressions), use the `SplitProjection` and `ProjectionOpener` helpers to split the projection into pushdownable and non-pushdownable parts:
299
+
300
+
```rust,ignore
301
+
use datafusion_datasource::projection::{SplitProjection, ProjectionOpener};
302
+
303
+
// In try_pushdown_projection:
304
+
let split = SplitProjection::new(projection, self.table_schema())?;
305
+
// Use split.file_projection() for what to push down to the file format
306
+
// The ProjectionOpener wrapper will handle the rest
307
+
```
308
+
309
+
**For `FileScanConfigBuilder` users:**
310
+
311
+
```diff
312
+
let config = FileScanConfigBuilder::new(url, source)
0 commit comments