luffy-zh commented on code in PR #2005:
URL: https://github.com/apache/orc/pull/2005#discussion_r1732283853


##########
c++/test/TestWriter.cc:
##########
@@ -84,21 +86,67 @@ namespace orc {
     return reader->createRowReader(rowReaderOpts);
   }
 
-  class WriterTest : public TestWithParam<FileVersion> {
+  void verifyCompressionBlockAlignment(const std::unique_ptr<RowReader>& 
reader,
+                                       uint64_t columnCount) {
+    for (uint64_t i = 0; i < columnCount; ++i) {
+      auto posEntries = reader->getCurrentStripePositionEntries(i + 1);
+      auto subType = reader->getSelectedType().getSubtype(i);
+      for (auto posVector : posEntries) {
+        for (uint64_t posIndex = 0; posIndex < posVector.size(); ++posIndex) {
+          // After we call finishStream(), unusedBufferSize is set to 0,
+          // so only the first position is valid in each recordPosition call.
+          switch (subType->getKind()) {
+            case DECIMAL:
+            case STRING:
+            case BINARY:
+            case CHAR:
+            case VARCHAR: {
+              if (posIndex != 0 && posIndex != 2) {
+                EXPECT_EQ(posVector[posIndex], 0);
+              }
+              break;
+            }
+            case TIMESTAMP_INSTANT:
+            case TIMESTAMP: {
+              if (posIndex != 0 && posIndex != 3) {
+                EXPECT_EQ(posVector[posIndex], 0);
+              }
+              break;
+            }
+            default: {

Review Comment:
   Boolean case is covered here, but the rowIndexStripe is set to 1024, a 
multiple of 8.



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