pitrou commented on code in PR #13334:
URL: https://github.com/apache/arrow/pull/13334#discussion_r911021587
##########
cpp/src/arrow/compute/kernels/vector_sort_test.cc:
##########
@@ -352,6 +352,17 @@ TEST(ArraySortIndicesFunction, Array) {
expected = ArrayFromJSON(uint64(), "[2, 4, 6, 1, 0, 3, 5]");
ASSERT_OK_AND_ASSIGN(actual, CallFunction("array_sort_indices", {arr},
&options));
AssertDatumsEqual(expected, actual, /*verbose=*/true);
+
+ // Dictionary Array
+ auto dict_arr = DictArrayFromJSON(dictionary(uint64(), utf8()), "[0, null,
1, 0, 2, 3]",
+ "[ \"b\", null, \"c\", \"a\"]");
+ expected = ArrayFromJSON(uint64(), "[5, 0, 3, 4, 1, 2]");
+ ASSERT_OK_AND_ASSIGN(actual, CallFunction("array_sort_indices", {dict_arr}));
+ AssertDatumsEqual(expected, actual, /*verbose=*/true);
+
+ expected = ArrayFromJSON(uint64(), "[1, 2, 4, 0, 3, 5]");
+ ASSERT_OK_AND_ASSIGN(actual, CallFunction("array_sort_indices", {dict_arr},
&options));
+ AssertDatumsEqual(expected, actual, /*verbose=*/true);
Review Comment:
Also, the tests should probably try all possible dictionary index types, not
just `uint64`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]