bkietz commented on code in PR #38252:
URL: https://github.com/apache/arrow/pull/38252#discussion_r1424349205


##########
cpp/src/arrow/array/array_test.cc:
##########
@@ -499,6 +501,24 @@ TEST_F(TestArray, TestMakeArrayOfNull) {
       }
     }
   }
+
+  for (int64_t length : {0, 16}) {
+    ARROW_SCOPED_TRACE("length = ", length, " (required fields)");
+
+    auto req = [](auto type) { return field("", std::move(type), 
/*nullable=*/false); };
+
+    // union with no nullable fields cannot represent a null
+    ASSERT_RAISES(Invalid, MakeArrayOfNull(dense_union({req(int8())}), 
length));

Review Comment:
   If the type cannot support any number of nulls, I would say that the special 
case of zero length is not worth allowing



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