You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2022/04/28 19:01:10 UTC
[arrow-datafusion] branch master updated: Improve documentation for DFSchema combine and merge functions (#2367)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/master by this push:
new ef49d2858 Improve documentation for DFSchema combine and merge functions (#2367)
ef49d2858 is described below
commit ef49d2858c2aba1ea7cd5fed3b1e5feb77fc2233
Author: Andy Grove <ag...@apache.org>
AuthorDate: Thu Apr 28 13:01:06 2022 -0600
Improve documentation for DFSchema combine and merge functions (#2367)
---
datafusion/common/src/dfschema.rs | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/datafusion/common/src/dfschema.rs b/datafusion/common/src/dfschema.rs
index 168ab8442..33c4193e2 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<Self> {
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