| 89 | } |
| 90 | |
| 91 | void verifyCompressionBlockAlignment(std::unique_ptr<Reader>& reader, uint64_t columnCount) { |
| 92 | auto stripeCount = reader->getNumberOfStripes(); |
| 93 | for (uint64_t stripeIndex = 0; stripeIndex < stripeCount; ++stripeIndex) { |
| 94 | for (uint64_t i = 0; i < columnCount; ++i) { |
| 95 | auto rowGroupIndexMap = reader->getRowGroupIndex(stripeIndex); |
| 96 | EXPECT_TRUE(rowGroupIndexMap.size() > 0); |
| 97 | auto rowGroupIndex = rowGroupIndexMap[columnCount]; |
| 98 | auto subType = reader->getType().getSubtype(i); |
| 99 | EXPECT_TRUE(rowGroupIndex.positions.size() > 0); |
| 100 | for (auto rowGroupPositions : rowGroupIndex.positions) { |
| 101 | for (uint64_t posIndex = 0; posIndex < rowGroupPositions.size(); ++posIndex) { |
| 102 | // After we call finishStream(), unusedBufferSize is set to 0, |
| 103 | // so only the first position is valid in each recordPosition call. |
| 104 | switch (subType->getKind()) { |
| 105 | case DECIMAL: |
| 106 | case STRING: |
| 107 | case BINARY: |
| 108 | case CHAR: |
| 109 | case VARCHAR: { |
| 110 | if (posIndex != 0 && posIndex != 2) { |
| 111 | EXPECT_EQ(rowGroupPositions[posIndex], 0); |
| 112 | } |
| 113 | break; |
| 114 | } |
| 115 | case TIMESTAMP_INSTANT: |
| 116 | case TIMESTAMP: { |
| 117 | if (posIndex != 0 && posIndex != 3) { |
| 118 | EXPECT_EQ(rowGroupPositions[posIndex], 0); |
| 119 | } |
| 120 | break; |
| 121 | } |
| 122 | default: { |
| 123 | if (posIndex != 0) { |
| 124 | EXPECT_EQ(rowGroupPositions[posIndex], 0); |
| 125 | } |
| 126 | break; |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | struct TestParams { |
| 136 | FileVersion fileVersion; |
no test coverage detected