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 2020/06/22 21:20:39 UTC

[GitHub] [arrow] kou commented on a change in pull request #7507: ARROW-8797: [C++] [WIP] Create test to receive RecordBatch for different endian

kou commented on a change in pull request #7507:
URL: https://github.com/apache/arrow/pull/7507#discussion_r443832986



##########
File path: cpp/src/arrow/ipc/read_write_test.cc
##########
@@ -409,6 +414,32 @@ class IpcTestFixture : public io::MemoryMapFixture, public ExtensionTypesMixin {
     CheckRoundtrip(*batch, options, IpcReadOptions::Defaults(), buffer_size);
   }
 
+  void CheckRoundTrip(const RecordBatch& src_batch,
+                      const RecordBatch& expected_batch,
+                      IpcWriteOptions options = IpcWriteOptions::Defaults(),
+                      IpcReadOptions read_options = IpcReadOptions::Defaults(),
+                      int64_t buffer_size = 1 << 20) {
+    std::stringstream ss;
+    ss << "test-write-row-batch-" << g_file_number++;
+    ASSERT_OK_AND_ASSIGN(mmap_,
+                         io::MemoryMapFixture::InitMemoryMap(buffer_size, ss.str()));
+
+    DictionaryMemo dictionary_memo;
+
+    std::shared_ptr<Schema> schema_result;
+    DoSchemaRoundTrip(*src_batch.schema(), &dictionary_memo, &schema_result);
+    ASSERT_TRUE(expected_batch.schema()->Equals(*schema_result));

Review comment:
       Should we always convert schema's endianness to native endian?
   I think that we should keep the original schema's endianness for serialization.
   Did we discuss this?




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

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