zhuqi-lucas commented on code in PR #14572:
URL: https://github.com/apache/datafusion/pull/14572#discussion_r1952299587
##########
datafusion/common/src/dfschema.rs:
##########
@@ -1028,20 +1028,48 @@ impl SchemaExt for Schema {
})
}
- fn logically_equivalent_names_and_types(&self, other: &Self) -> bool {
+ // There are three cases we need to check
+ // 1. The len of the schema of the plan and the schema of the table should
be the same
+ // 2. The nullable flag of the schema of the plan and the schema of the
table should be the same
+ // 3. The datatype of the schema of the plan and the schema of the table
should be the same
+ fn logically_equivalent_names_and_types(&self, other: &Self) -> Result<(),
String> {
Review Comment:
Thank you @jayzhan211 for this good suggestion, i change my code to use
result<()>, it seems it's enough for this case, similar with many other cases,
for example:
```rust
/// Check if the schema have some fields with the same name
pub fn check_names(&self) -> Result<()> {
}
```
--
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]