Commits


David Li authored and Paddy Horan committed 1bdb4a03715
ARROW-5722: [Rust] Implement Debug for List/Struct/BinaryArray - Add a helper to elide the middle of long arrays (same behavior as Python) - Adds `Debug` trait bound on `Array` If we don't want those changes, we can simply take only the first commit here, which adds basic `Debug` implementations for the three mentioned array types. Travis build: https://travis-ci.com/lihalite/arrow/builds/126247128 Example output: ``` $ cargo run --example builders Finished dev [unoptimized + debuginfo] target(s) in 0.07s Running `target/debug/examples/builders` PrimitiveArray<Int32> [ 55, null, 39, 89, 12, null, 25, 26, 27, 28, ...11 elements..., 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, ] PrimitiveArray<Date64(Millisecond)> [ 2019-02-23, null, 2019-02-23, ] PrimitiveArray<Time64(Nanosecond)> [ 00:00:00, 00:00:00.000000001, 00:00:00.000000002, 00:00:00.000000003, 00:00:00.000000004, 00:00:00.000000005, 00:00:00.000000006, 00:00:00.000000007, 00:00:00.000000008, 00:00:00.000000009, ...80 elements..., 00:00:00.000000090, 00:00:00.000000091, 00:00:00.000000092, 00:00:00.000000093, 00:00:00.000000094, 00:00:00.000000095, 00:00:00.000000096, 00:00:00.000000097, 00:00:00.000000098, 00:00:00.000000099, ] $ cargo run --example list_array Finished dev [unoptimized + debuginfo] target(s) in 0.06s Running `target/debug/examples/list_array` ListArray [ PrimitiveArray<Int32> [ 0, 1, 2, ], PrimitiveArray<Int32> [ 3, 4, 5, ], PrimitiveArray<Int32> [ 6, 7, ], ] StructArray [ -- child 0: "b" (Boolean) PrimitiveArray<Boolean> [ false, false, true, true, ] -- child 1: "c" (Int32) PrimitiveArray<Int32> [ 42, 28, 19, 31, ] ] ``` Closes #5309 from lihalite/arrow-5722 and squashes the following commits: 957916c2e <David Li> Merge array examples 2d8f779e5 <David Li> Add examples of binary/list/struct array c78f1a2b6 <David Li> Use array debug helper for all arrays 1631fe077 <David Li> Add helper for printing long arrays 57d969b5a <David Li> Add fmt::Debug to Array trait bounds 68e678166 <David Li> ARROW-5722: implement Debug for some array types Authored-by: David Li <li.davidm96@gmail.com> Signed-off-by: Paddy Horan <paddyhoran@hotmail.com>