westonpace commented on code in PR #34416:
URL: https://github.com/apache/arrow/pull/34416#discussion_r1125136488
##########
cpp/src/arrow/adapters/orc/adapter_test.cc:
##########
@@ -840,6 +840,23 @@ TEST_F(TestORCWriterSingleArray, WriteListOfMap) {
AssertArrayWriteReadEqual(array, array, kDefaultSmallMemStreamSize * 10);
}
+TEST_F(TestORCWriterSingleArray, WriteSparseUnion) {
+ const int64_t num_rows = 1024;
+ auto type =
+ sparse_union({field("_union_0", utf8()), field("_union_1", int32())},
{0, 1});
+ auto array = checked_pointer_cast<SparseUnionArray>(rand.ArrayOf(type,
num_rows, 0.4));
+ ArrayVector children;
+ for (int i = 0; i < array->num_fields(); ++i) {
+ ASSERT_OK_AND_ASSIGN(auto flattened_child, array->GetFlattenedField(i));
+ children.emplace_back(std::move(flattened_child));
+ }
+ auto flattened_array = std::make_shared<SparseUnionArray>(
+ array->type(), array->length(), std::move(children), array->type_codes(),
+ array->offset());
Review Comment:
Why is this flattening needed?
##########
cpp/src/arrow/adapters/orc/util.cc:
##########
@@ -994,7 +1125,6 @@ Result<std::shared_ptr<DataType>> GetArrowType(const
liborc::Type* type) {
} else {
return decimal128(precision, scale);
}
- break;
Review Comment:
Why remove this break?
--
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]