Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Added PartialEqual for UnionArray
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Aug 14, 2021
1 parent d806ae8 commit 3fc6c9d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/array/equal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ use crate::{
types::{days_ms, NativeType},
};

use super::{
primitive::PrimitiveArray, Array, BinaryArray, BooleanArray, DictionaryArray, DictionaryKey,
FixedSizeBinaryArray, FixedSizeListArray, ListArray, NullArray, Offset, StructArray, Utf8Array,
};
use super::*;

mod binary;
mod boolean;
Expand Down Expand Up @@ -146,6 +143,18 @@ impl<K: DictionaryKey> PartialEq<&dyn Array> for DictionaryArray<K> {
}
}

impl PartialEq<UnionArray> for UnionArray {
fn eq(&self, other: &Self) -> bool {
equal(self, other)
}
}

impl PartialEq<&dyn Array> for UnionArray {
fn eq(&self, other: &&dyn Array) -> bool {
equal(self, *other)
}
}

/// Logically compares two [`Array`]s.
/// Two arrays are logically equal if and only if:
/// * their data types are equal
Expand Down

0 comments on commit 3fc6c9d

Please sign in to comment.