You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/12 13:54:31 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #14386: ARROW-18004: [C++] ExecBatch conversion to RecordBatch may go out of bounds

pitrou commented on code in PR #14386:
URL: https://github.com/apache/arrow/pull/14386#discussion_r993497169


##########
cpp/src/arrow/compute/exec_test.cc:
##########
@@ -55,6 +55,19 @@ using ::arrow::internal::BitmapEquals;
 using ::arrow::internal::CopyBitmap;
 using ::arrow::internal::CountSetBits;
 
+TEST(ExecBatch, Basics) {
+  auto i32_array = ArrayFromJSON(int32(), "[0, 1, 2]");
+  auto utf8_array = ArrayFromJSON(utf8(), R"(["a", "b", "c"])");
+  ExecBatch exec_batch({Datum(i32_array), Datum(utf8_array)}, 3);
+  auto right_schema = schema({field("a", int32()), field("b", utf8())});
+  ASSERT_OK_AND_ASSIGN(auto right_record_batch, exec_batch.ToRecordBatch(right_schema));
+  auto accept_schema = schema({field("a", int32())});
+  ASSERT_OK_AND_ASSIGN(auto accept_record_batch, exec_batch.ToRecordBatch(accept_schema));

Review Comment:
   Why would this succeed and produce a truncated result here?



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org