mbrobbel commented on a change in pull request #11843:
URL: https://github.com/apache/arrow/pull/11843#discussion_r762817626



##########
File path: cpp/src/arrow/array/concatenate_test.cc
##########
@@ -364,27 +364,89 @@ TEST_F(ConcatenateTest, DictionaryTypeNullSlots) {
   AssertArraysEqual(*expected, *concat_actual);
 }
 
-TEST_F(ConcatenateTest, DISABLED_UnionType) {
+TEST_F(ConcatenateTest, UnionType) {
   // sparse mode
   Check([this](int32_t size, double null_probability, std::shared_ptr<Array>* 
out) {
-    auto foo = this->GeneratePrimitive<Int8Type>(size, null_probability);
+    auto foo = this->GeneratePrimitive<Int8Type>(size, 0);
     auto bar = this->GeneratePrimitive<DoubleType>(size, null_probability);
     auto baz = this->GeneratePrimitive<BooleanType>(size, null_probability);
-    auto type_ids = rng_.Numeric<Int8Type>(size, 0, 2, null_probability);
+    auto type_ids = rng_.Numeric<Int8Type>(size, 0, 2, 0);
     ASSERT_OK_AND_ASSIGN(*out, SparseUnionArray::Make(*type_ids, {foo, bar, 
baz}));
   });
   // dense mode
-  Check([this](int32_t size, double null_probability, std::shared_ptr<Array>* 
out) {
-    auto foo = this->GeneratePrimitive<Int8Type>(size, null_probability);
-    auto bar = this->GeneratePrimitive<DoubleType>(size, null_probability);
-    auto baz = this->GeneratePrimitive<BooleanType>(size, null_probability);
-    auto type_ids = rng_.Numeric<Int8Type>(size, 0, 2, null_probability);
-    auto value_offsets = rng_.Numeric<Int32Type>(size, 0, size, 0);
-    ASSERT_OK_AND_ASSIGN(
-        *out, DenseUnionArray::Make(*type_ids, *value_offsets, {foo, bar, 
baz}));
+  Check([this](int32_t size, double null_probabilities, 
std::shared_ptr<Array>* out) {
+    *out = rng_.ArrayOf(dense_union({

Review comment:
       The test already existed for both sparse and dense unions. However for 
the dense union it didn't generate valid arrays, so I updated that to use 
`ArrayOf`. I'll also update the sparse union generation to use `ArrayOf`.




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