wiedld commented on code in PR #13651:
URL: https://github.com/apache/datafusion/pull/13651#discussion_r1886133873


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -476,6 +520,38 @@ pub(crate) fn assert_schema_is_the_same(
     }
 }
 
+/// Returns an error if plan, and subplans, do not have unique fields.
+///
+/// This invariant is subject to change.
+/// refer: 
<https://github.com/apache/datafusion/issues/13525#issuecomment-2494046463>
+fn assert_unique_field_names(plan: &LogicalPlan) -> Result<()> {
+    plan.schema().check_names()?;

Review Comment:
   Yes, on every creation. But not after [every 
merge](https://github.com/apache/datafusion/blob/bd2c975df88c9e95f2f6b5f2abed5638904e2ac0/datafusion/common/src/dfschema.rs#L294).
 Which should be ok if no bug is introduced in the merge -- altho I would 
prefer to add the check there.



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