zhuqi-lucas commented on code in PR #14572:
URL: https://github.com/apache/datafusion/pull/14572#discussion_r1954754897
##########
datafusion/common/src/dfschema.rs:
##########
@@ -1028,21 +1028,32 @@ impl SchemaExt for Schema {
})
}
- fn logically_equivalent_names_and_types(&self, other: &Self) -> bool {
+ fn logically_equivalent_names_and_types(&self, other: &Self) -> Result<()>
{
if self.fields().len() != other.fields().len() {
- return false;
+ _plan_err!(
+ "Inserting query must have the same schema length as the
table. \
+ Expected table schema length: {}, got: {}",
+ self.fields().len(),
+ other.fields().len()
+ )
+ } else {
+ self.fields()
+ .iter()
+ .zip(other.fields().iter())
+ .try_for_each(|(f1, f2)| {
+ if f1.name() != f2.name() ||
!DFSchema::datatype_is_logically_equal(f1.data_type(), f2.data_type()) {
+ _plan_err!(
+ "Inserting query schema mismatch: Expected table
field '{}' with type {:?}, \
Review Comment:
Checked the function only be called by insert into cases.
--
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]