diff --git a/csharp/src/Apache.Arrow/Arrays/ArrowArrayConcatenator.cs b/csharp/src/Apache.Arrow/Arrays/ArrowArrayConcatenator.cs index cc151210aec6b..ac8252211eae4 100644 --- a/csharp/src/Apache.Arrow/Arrays/ArrowArrayConcatenator.cs +++ b/csharp/src/Apache.Arrow/Arrays/ArrowArrayConcatenator.cs @@ -18,9 +18,9 @@ namespace Apache.Arrow { - static class ArrowArrayConcatenator + public static class ArrowArrayConcatenator { - internal static IArrowArray Concatenate(IReadOnlyList arrowArrayList , MemoryAllocator allocator = default) + public static IArrowArray Concatenate(IReadOnlyList arrowArrayList , MemoryAllocator allocator = default) { if(arrowArrayList == null || arrowArrayList.Count == 0) { diff --git a/csharp/test/Apache.Arrow.Tests/ArrowArrayConcatenatorTests.cs b/csharp/test/Apache.Arrow.Tests/ArrowArrayConcatenatorTests.cs index f1dcbb5d37b8f..6f4c17a959981 100644 --- a/csharp/test/Apache.Arrow.Tests/ArrowArrayConcatenatorTests.cs +++ b/csharp/test/Apache.Arrow.Tests/ArrowArrayConcatenatorTests.cs @@ -30,7 +30,7 @@ public void TestStandardCases() { foreach ((List testTargetArrayList, IArrowArray expectedArray) in GenerateTestData()) { - IArrowArray actualArray = ArrowArrayConcatenatorReflector.InvokeConcatenate(testTargetArrayList); + IArrowArray actualArray = ArrowArrayConcatenator.Concatenate(testTargetArrayList); ArrowReaderVerifier.CompareArrays(expectedArray, actualArray); } } @@ -38,15 +38,15 @@ public void TestStandardCases() [Fact] public void TestNullOrEmpty() { - Assert.Null(ArrowArrayConcatenatorReflector.InvokeConcatenate(null)); - Assert.Null(ArrowArrayConcatenatorReflector.InvokeConcatenate(new List())); + Assert.Null(ArrowArrayConcatenator.Concatenate(null)); + Assert.Null(ArrowArrayConcatenator.Concatenate(new List())); } [Fact] public void TestSingleElement() { Int32Array array = new Int32Array.Builder().Append(1).Append(2).Build(); - IArrowArray actualArray = ArrowArrayConcatenatorReflector.InvokeConcatenate(new[] { array }); + IArrowArray actualArray = ArrowArrayConcatenator.Concatenate(new[] { array }); ArrowReaderVerifier.CompareArrays(array, actualArray); } @@ -107,17 +107,6 @@ private static IEnumerable, IArrowArray>> GenerateTestDa } } - private static class ArrowArrayConcatenatorReflector - { - private static readonly MethodInfo s_concatenateInfo = typeof(ArrayData).Assembly.GetType("Apache.Arrow.ArrowArrayConcatenator") - .GetMethod("Concatenate", BindingFlags.Static | BindingFlags.NonPublic); - - internal static IArrowArray InvokeConcatenate(IReadOnlyList arrowArrayList, MemoryAllocator allocator = default) - { - return s_concatenateInfo.Invoke(null, new object[] { arrowArrayList, allocator }) as IArrowArray; - } - } - private class TestDataGenerator : IArrowTypeVisitor, IArrowTypeVisitor,