From 6a2b9a00695f4c71b18dac4335c8edbb4f2159cd Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies Date: Tue, 9 Apr 2024 10:51:01 +0100 Subject: [PATCH] Use ArrayData equality --- arrow-select/src/take.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/arrow-select/src/take.rs b/arrow-select/src/take.rs index d3f9da386288..dc9e13040c8e 100644 --- a/arrow-select/src/take.rs +++ b/arrow-select/src/take.rs @@ -1466,11 +1466,6 @@ mod tests { assert_eq!(actual.len(), index.len()); - let actual = actual - .as_any() - .downcast_ref::>() - .unwrap(); - let expected = { // ["large payload over 12 bytes", null, "world", "large payload over 12 bytes", "lulu", null] let mut builder = GenericByteViewBuilder::::new(); @@ -1483,20 +1478,7 @@ mod tests { builder.finish() }; - _assert_byte_view_equal(actual, &expected); - } - - fn _assert_byte_view_equal( - array1: &GenericByteViewArray, - array2: &GenericByteViewArray, - ) where - T: ByteViewType, - T::Native: PartialEq, - { - assert_eq!(array1.len(), array2.len()); - for (v1, v2) in array1.iter().zip(array2.iter()) { - assert_eq!(v1, v2); - } + assert_eq!(actual.as_ref(), &expected); } #[test]