pepijnve commented on code in PR #17813:
URL: https://github.com/apache/datafusion/pull/17813#discussion_r2507829109


##########
datafusion/core/src/physical_planner.rs:
##########
@@ -2516,7 +2517,9 @@ impl<'a> OptimizationInvariantChecker<'a> {
         previous_schema: Arc<Schema>,
     ) -> Result<()> {
         // if the rule is not permitted to change the schema, confirm that it 
did not change.
-        if self.rule.schema_check() && plan.schema() != previous_schema {
+        if self.rule.schema_check()
+            && !is_allowed_schema_change(previous_schema.as_ref(), 
plan.schema().as_ref())

Review Comment:
   This change relaxes the schema check slightly. It now allows individual 
fields to change from nullable to not-nullable which is ok because it only 
allow a strict subset of the original schema. `schema_check` has documentation 
stating that you should disable the schema check entirely if you want to do 
this. Seemed better to not have to disable checking entirely. 



##########
datafusion/expr/src/predicate_bounds.rs:
##########


Review Comment:
   This is now called `predicate_bounds` to reflect what it actually calculates.



##########
datafusion/expr/Cargo.toml:
##########
@@ -45,6 +45,7 @@ sql = ["sqlparser"]
 [dependencies]
 arrow = { workspace = true }
 async-trait = { workspace = true }
+bitflags = "2.9.4"

Review Comment:
   This is already a dependency via `arrow-schema` so I assumed it would be ok 
to use.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to