pitrou commented on code in PR #50770:
URL: https://github.com/apache/arrow/pull/50770#discussion_r3861124042


##########
cpp/src/arrow/util/dict_util.cc:
##########
@@ -54,9 +54,16 @@ int64_t LogicalNullCount(const ArraySpan& span) {
 }  // namespace
 
 int64_t LogicalNullCount(const ArraySpan& span) {
-  if (span.dictionary().GetNullCount() == 0 || span.length == 0) {
+  const auto& dictionary_span = span.dictionary();
+  if (dictionary_span.GetNullCount() == 0 || span.length == 0) {
     return span.GetNullCount();
   }
+  if (!dictionary_span.HasValidityBitmap()) {
+    // The dictionary has nulls but no validity bitmap to inspect, which means 
all
+    // of its values are null (a null-typed dictionary). Every index, valid or 
not,
+    // is then logically null.

Review Comment:
   Perhaps DCHECK that the dictionary's type is Type::NA?



-- 
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]

Reply via email to