-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Less-strict schema equality in Table and ChunkedArray constructors (#98)
- Loading branch information
1 parent
2a243ed
commit b819f0c
Showing
4 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use arrow_schema::Schema; | ||
|
||
/// Check whether two schemas are equal | ||
/// | ||
/// This allows schemas to have different top-level metadata, as well as different nested field | ||
/// names and keys. | ||
pub(crate) fn schema_equals(left: &Schema, right: &Schema) -> bool { | ||
left.fields | ||
.iter() | ||
.zip(right.fields.iter()) | ||
.all(|(left_field, right_field)| { | ||
left_field.name() == right_field.name() | ||
&& left_field | ||
.data_type() | ||
.equals_datatype(right_field.data_type()) | ||
}) | ||
} |