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 change here is to ensure they are equivalent, if not, I think it indicates there is schema mismatch issue, typically logical schema from `ExprSchemable` is not the same as physical schema from `ExecutionPlan.schema()`. 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 🤔 Otherwise, there come out a question, if we got inconsistent schema, which one should I use? btw `internal_error ` 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org