jayzhan211 commented on code in PR #11989:
URL: https://github.com/apache/datafusion/pull/11989#discussion_r1720493334


##########
datafusion/core/src/physical_planner.rs:
##########
@@ -670,6 +670,10 @@ impl DefaultPhysicalPlanner {
                 let input_exec = children.one()?;
                 let physical_input_schema = input_exec.schema();
                 let logical_input_schema = input.as_ref().schema();
+                let physical_input_schema_from_logical: Arc<Schema> =
+                    logical_input_schema.as_ref().clone().into();
+
+                debug_assert_eq!(physical_input_schema_from_logical, 
physical_input_schema, "Physical input schema should be the same as the one 
converted from logical input schema. Please file an issue or send the PR");

Review Comment:
   The objective here is to ensure that the logical schema from `ExprSchemable` 
and the physical schema from `ExecutionPlan.schema()` are equivalent. if they 
are not, it indicates a potential schema mismatch issue. This is also why you 
can see the code change in this PR are mostly fixing schema related things and 
they are all required thus I don't think we should let user bypass the check 🤔 
   
   If we encounter inconsistent schemas, it raises an important question: Which 
schema should we use?
   
   > Did you consider making this function return an internal_error rather than 
debug_assert ?
   
   It looks good to me



-- 
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