taepper commented on PR #50653:
URL: https://github.com/apache/arrow/pull/50653#issuecomment-5091492351
Putting
```
template <typename BuilderType>
std::shared_ptr<Array> BinaryArrayFromStrings(
const std::shared_ptr<DataType>& type,
const std::vector<std::optional<std::string>>& values) {
std::unique_ptr<ArrayBuilder> builder;
ARROW_CHECK_OK(MakeBuilder(default_memory_pool(), type, &builder));
auto& concrete_builder = checked_cast<BuilderType&>(*builder);
for (const auto& value : values) {
if (value.has_value()) {
ARROW_CHECK_OK(concrete_builder.Append(*value));
} else {
ARROW_CHECK_OK(concrete_builder.AppendNull());
}
}
std::shared_ptr<Array> array;
ARROW_CHECK_OK(concrete_builder.Finish(&array));
return array;
}
```
felt a little bit ugly, but as it only contains test it might be fine? I did
not see a good other place as changing the library interface for a
test-helper-method seems excessive, and including from `.../testing/...` in
`gdb.cc` would break boundaries..
--
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]