forked from apache/datafusion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validate and adjust Substrait NamedTable schemas (apache#12223) (apac…
…he#12245) * fix: producer did not emit base_schema struct field for ReadRel Substrait plans are not valid without this, and it is generally useful for round trip testing * feat: include field_qualifier param for from_substrait_named_struct * feat: verify that Substrait and DataFusion agree on NamedScan schemas If the schema registered with DataFusion and the schema as given by the Substrait NamedScan do not have the same names and types, DataFusion should reject it * test: update existing substrait test + substrait validation test * added substrait_validation test * extracted useful test utilities The utils::test::TestSchemaCollector::generate_context_from_plan function can be used to dynamically generate a SessionContext from a Substrait plan, which will include the schemas for NamedTables as given in the Substrait plan. This helps us avoid the issue of DataFusion test schemas and Substrait plan schemas not being in sync. * feat: expose from_substrait_named_struct * refactor: remove unused imports * docs: add missing licenses * refactor: deal with unused code warnings * remove optional qualifier from from_substrait_named_struct * return DFSchema from from_substrait_named_struct * one must imagine clippy happy * accidental blah * loosen the validation for schemas allow cases where the Substrait schema is a subset of the DataFusion schema * minor doc tweaks * update test data to deal with case issues in tests * fix error message * improve readability of field compatability check * make TestSchemaCollector more flexible * fix doc typo Co-authored-by: Arttu <[email protected]> * remove unecessary TODO * handle ReadRel projection on top of mismatched schema --------- Co-authored-by: Arttu <[email protected]>
- Loading branch information
Showing
13 changed files
with
697 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.