-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cec428
commit 78dc034
Showing
10 changed files
with
184 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use arrow_schema::DataType; | ||
|
||
pub trait LogicallyEq<Rhs: ?Sized = Self> { | ||
#[must_use] | ||
fn logically_eq(&self, other: &Rhs) -> bool; | ||
} | ||
|
||
impl LogicallyEq for DataType { | ||
fn logically_eq(&self, other: &Self) -> bool { | ||
use DataType::*; | ||
|
||
match (self, other) { | ||
(Utf8 | LargeUtf8 | Utf8View, Utf8 | LargeUtf8 | Utf8View) | ||
| (Binary | LargeBinary | BinaryView, Binary | LargeBinary | BinaryView) => { | ||
true | ||
} | ||
(Dictionary(_, inner), other) | (other, Dictionary(_, inner)) => { | ||
other.logically_eq(inner) | ||
} | ||
(RunEndEncoded(_, inner), other) | (other, RunEndEncoded(_, inner)) => { | ||
other.logically_eq(inner.data_type()) | ||
} | ||
_ => self == other, | ||
} | ||
} | ||
} |
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 @@ | ||
pub mod eq; |
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
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
Oops, something went wrong.