westonpace commented on code in PR #35129:
URL: https://github.com/apache/arrow/pull/35129#discussion_r1179834592
##########
cpp/src/arrow/testing/gtest_util.cc:
##########
@@ -427,6 +428,24 @@ std::shared_ptr<Table> TableFromJSON(const
std::shared_ptr<Schema>& schema,
return *Table::FromRecordBatches(schema, std::move(batches));
}
+Result<std::shared_ptr<Table>> RunEndEncodeTableColumns(
+ const Table& table, const std::vector<int>& column_indices) {
+ const int num_columns = table.num_columns();
+ std::vector<std::shared_ptr<ChunkedArray>> encoded_columns;
+ encoded_columns.reserve(num_columns);
+ for (int i = 0; i < num_columns; i++) {
+ if (std::find(column_indices.begin(), column_indices.end(), i) !=
+ column_indices.end()) {
+ EXPECT_OK_AND_ASSIGN(auto run_end_encoded,
compute::RunEndEncode(table.column(i)));
+ EXPECT_EQ(run_end_encoded.kind(), Datum::CHUNKED_ARRAY);
Review Comment:
If that's the case then change the return type to `std::shared_ptr<Table>`
and change the end to...
```
EXPECT_OK_AND_ASSIGN(auto table, Table::Make(...));
return table;
```
I don't really mind one pattern or the other. It's just the mixing of
patterns we should avoid.
--
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]