pitrou commented on code in PR #48955:
URL: https://github.com/apache/arrow/pull/48955#discussion_r2727780178
##########
cpp/src/arrow/compute/kernels/vector_sort_test.cc:
##########
@@ -437,6 +437,27 @@ TEST(ArraySortIndicesFunction, AllNullDictionaryArray) {
}
}
+TEST(ArraySortIndicesFunction, NullTypeDictionaryArray) {
+ // Test that dictionaries with Type::NA (null type) values can be sorted.
+ // All values in a null-type dictionary are logically null, so sorting
+ // should just arrange indices based on null placement, preserving order.
+ for (const auto& index_type : all_dictionary_index_types()) {
+ ARROW_SCOPED_TRACE("index_type = ", index_type->ToString());
+ auto dict_type = dictionary(index_type, null());
+ auto dict_arr = DictArrayFromJSON(dict_type, "[null, null, null, null]",
"[]");
Review Comment:
Hmm, another way of encoding this is to have null values in the dictionary,
perhaps test that too?
For example:
```suggestion
auto dict_arr = DictArrayFromJSON(dict_type, "[null, 0, 0, null]",
"[null]");
```
--
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]