diff --git a/datafusion/common/src/dfschema.rs b/datafusion/common/src/dfschema.rs index 168ab8442ecd..33c4193e2fc6 100644 --- a/datafusion/common/src/dfschema.rs +++ b/datafusion/common/src/dfschema.rs @@ -116,7 +116,8 @@ impl DFSchema { ) } - /// Combine two schemas + /// Create a new schema that contains the fields from this schema followed by the fields + /// from the supplied schema. An error will be returned if there are duplicate field names. pub fn join(&self, schema: &DFSchema) -> Result { let mut fields = self.fields.clone(); let mut metadata = self.metadata.clone(); @@ -125,7 +126,8 @@ impl DFSchema { Self::new_with_metadata(fields, metadata) } - /// Merge a schema into self + /// Modify this schema by appending the fields from the supplied schema, ignoring any + /// duplicate fields. pub fn merge(&mut self, other_schema: &DFSchema) { for field in other_schema.fields() { // skip duplicate columns