mapleFU commented on code in PR #14351:
URL: https://github.com/apache/arrow/pull/14351#discussion_r1048718751


##########
cpp/src/parquet/reader_test.cc:
##########
@@ -502,6 +514,160 @@ TEST_F(TestLocalFile, OpenWithMetadata) {
   ASSERT_EQ(metadata.get(), reader2->metadata().get());
 }
 
+// https://github.com/google/googletest/pull/2904 not available in our version 
of
+// gtest/gmock

Review Comment:
   The code is move-ahead from L861-L870 in the same file. Origin tests uses it.
   
   Though I think I'd like to move it to parquet test tools



##########
cpp/src/parquet/reader_test.cc:
##########
@@ -502,6 +514,160 @@ TEST_F(TestLocalFile, OpenWithMetadata) {
   ASSERT_EQ(metadata.get(), reader2->metadata().get());
 }
 
+// https://github.com/google/googletest/pull/2904 not available in our version 
of
+// gtest/gmock
+#define EXPECT_THROW_THAT(callable, ex_type, property)   \
+  EXPECT_THROW(                                          \
+      try { (callable)(); } catch (const ex_type& err) { \
+        EXPECT_THAT(err, (property));                    \
+        throw;                                           \
+      },                                                 \
+      ex_type)
+
+TEST(TestDataPageV1Checksum, CorruptPage) {
+  // works when not checking crc.
+  {
+    auto reader = ParquetFileReader::OpenFile(data_page_v1_corrupt_checksum());
+    auto metadata_ptr = reader->metadata();
+    EXPECT_EQ(1U, metadata_ptr->num_row_groups());
+    auto rg = reader->RowGroup(0);
+    auto column0 = 
std::dynamic_pointer_cast<TypedColumnReader<Int32Type>>(rg->Column(0));
+    auto column1 = 
std::dynamic_pointer_cast<TypedColumnReader<Int32Type>>(rg->Column(1));
+    EXPECT_NE(nullptr, column0);
+    EXPECT_NE(nullptr, column1);
+    const int kPageSize = 1024 * 10;
+    const int kMembers = kPageSize * 2 / sizeof(int32_t);

Review Comment:
   Sure, each column have 2 Pages



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

Reply via email to