Copilot commented on code in PR #49296:
URL: https://github.com/apache/arrow/pull/49296#discussion_r2845216351
##########
cpp/src/parquet/encoding_test.cc:
##########
@@ -1967,6 +1961,30 @@ TYPED_TEST(TestDeltaBitPackEncoding, DeltaBitPackedSize)
{
ASSERT_EQ(encoded->size(), encoded_size);
}
+TYPED_TEST(TestDeltaBitPackEncoding, ZeroDeltaBitWidth) {
+ // Exercise ranges of zero deltas interspersed between ranges of non-zero
deltas.
+ // This checks that the zero bit-width optimization in GH-49266 doesn't mess
+ // decoder state.
+ using T = typename TypeParam::c_type;
+
+ // At least the size of a block
+ constexpr int kRangeSize = 256;
+
+ std::vector<T> int_values;
+ for (int i = 0; i < kRangeSize; ++i) {
+ int_values.push_back((i * 7) % 11);
+ }
+ // Range of equal values, should emit zero-width deltas
+ for (int i = 0; i < kRangeSize * 2; ++i) {
+ int_values.push_back(42);
+ }
+ // int_values.insert(int_values.end(), /*count=*/kRangeSize * k,
/*value=*/42);
Review Comment:
This commented-out line should be removed. It appears to be leftover code
from development that was replaced by the explicit loop above.
```suggestion
```
--
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]