R-JunmingChen commented on code in PR #38681:
URL: https://github.com/apache/arrow/pull/38681#discussion_r1390534945
##########
cpp/src/arrow/array/array_dict.cc:
##########
@@ -212,6 +212,56 @@ Result<std::shared_ptr<ArrayData>> TransposeDictIndices(
return out_data;
}
+struct CountDictionaryNullValuesVistor {
+ const std::shared_ptr<ArrayData>& data;
+ int64_t& out_null_count;
+
+ template <typename IndexArrowType>
+ Status CountDictionaryNullValuesImpl() {
+ int64_t index_length = data->length;
+ int64_t dict_length = data->dictionary->length;
+ const uint8_t* dictionary_null_bit_map =
data->dictionary->GetValues<uint8_t>(0);
+
+ using CType = typename IndexArrowType::c_type;
+ const CType* indices_data = data->GetValues<CType>(1);
+ CType dict_len = static_cast<CType>(dict_length);
+ for (int64_t i = 0; i < index_length; i++) {
+ if (data->IsNull(i)) {
+ continue;
Review Comment:
Sure, then I think it's better change name of `CountDictionaryNullValues`
to `CountDictionaryArrayNullValues`.
--
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]