Uh oh!
There was an error while loading. Please reload this page.
Add hooks to SchemaAdapter to add custom column generators - #15261
Add hooks to SchemaAdapter to add custom column generators#15261adriangb wants to merge 3 commits into
SchemaAdapter to add custom column generators#15261Conversation
| let err = adapter.map_schema(&file_schema).unwrap_err().to_string(); | ||
| assert_eq!(err, "Error during planning: Column a is missing from the file schema, cannot be generated, and is non-nullable"); |
There was a problem hiding this comment.
It's nice that this fails earlier 😄
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
adriangb
commented
Mar 17, 2025
I've moved the complex bit over to #15263. I'll let that settle first then resume work here. |
adriangb
commented
Mar 17, 2025
Noting that in #15263 (comment) I realized that it might be good to have a system to report stats for columns that will be generated before they are generated (is it all nulls? is it a constant?) to be used with stats pruning. |
adriangb
commented
Mar 19, 2025
Now that #15263 is merged I'll come back here and:
|
896eb8b to
74b884fComparede02a9a to
0bdebc8Compareadriangb
commented
Mar 20, 2025
Marking as ready for review. The main TODO is an API for transmitting statistics information for generated columns before they get generated, but that can even be a followup PR. |
Looking at how filter pushdown interacts with partition columns I think this could improve that. I feel like this change could help with that... but some details are missing: we somehow need to pipe the partition values into the |
| fn map_batch(&self, batch: RecordBatch) -> datafusion_common::Result<RecordBatch>; | ||
| } | ||
| pub trait MissingColumnGeneratorFactory: Debug + Send + Sync { |
There was a problem hiding this comment.
I haven't had a chance to review this entire PR yet, but I am feeling a little strange that these traits are not used by SchemaMapper but instead are used by DefaultSchemaMapper
I wonder what is the usecase for these extra two traits, compared to say adding a method on SchemaMapper
adriangb
commented
Jun 27, 2025
Marking as draft until I have time to work on this |
adriangb
commented
Jul 20, 2025
I'm proposing we replace SchemaAdapter in #16800 so I don't plan to work on this PR anymore |
Closes#15220
A lot of the work of this PR is meant to resolve#15220 (comment). I think I'll move that into a standalone PR.