| 1814 | |
| 1815 | #[test] |
| 1816 | fn test_concat_run_array_single() { |
| 1817 | // Create a run array with run ends [2, 4] and values [10, 20] |
| 1818 | let run_ends1 = Int32Array::from(vec![2, 4]); |
| 1819 | let values1 = Int32Array::from(vec![10, 20]); |
| 1820 | let array1 = RunArray::try_new(&run_ends1, &values1).unwrap(); |
| 1821 | |
| 1822 | // Concatenate the single array |
| 1823 | let result = concat(&[&array1]).unwrap(); |
| 1824 | let result_run_array: &arrow_array::RunArray<Int32Type> = result.as_run(); |
| 1825 | |
| 1826 | // The result should have length 4 |
| 1827 | assert_eq!(result_run_array.len(), 4); |
| 1828 | |
| 1829 | // Check that the run ends are correct |
| 1830 | let run_ends = result_run_array.run_ends().values(); |
| 1831 | assert_eq!(&[2, 4], run_ends); |
| 1832 | |
| 1833 | // Check that the values are correct |
| 1834 | assert_eq!( |
| 1835 | &[10, 20], |
| 1836 | result_run_array |
| 1837 | .values() |
| 1838 | .as_any() |
| 1839 | .downcast_ref::<Int32Array>() |
| 1840 | .unwrap() |
| 1841 | .values() |
| 1842 | ); |
| 1843 | } |
| 1844 | |
| 1845 | #[test] |
| 1846 | fn test_concat_run_array_with_3_arrays() { |