pitrou commented on code in PR #35731:
URL: https://github.com/apache/arrow/pull/35731#discussion_r1203844892
##########
cpp/src/parquet/bloom_filter_test.cc:
##########
@@ -326,14 +327,137 @@ TEST(XxHashTest, TestBloomFilter) {
uint8_t bytes[32] = {};
for (int i = 0; i < 32; i++) {
- ByteArray byteArray(i, bytes);
+ ByteArray byte_array(i, bytes);
bytes[i] = i;
auto hasher_seed_0 = std::make_unique<XxHasher>();
- EXPECT_EQ(HASHES_OF_LOOPING_BYTES_WITH_SEED_0[i],
hasher_seed_0->Hash(&byteArray))
+ EXPECT_EQ(HASHES_OF_LOOPING_BYTES_WITH_SEED_0[i],
hasher_seed_0->Hash(&byte_array))
<< "Hash with seed 0 Error: " << i;
}
}
+// Same as TestBloomFilter but using Batch interface
+TEST(XxHashTest, TestBloomFilterHashes) {
+ uint8_t bytes[32] = {};
Review Comment:
Please use some kind of const instead of magic numbers.
```suggestion
constexpr int kNumValues = 32;
uint8_t bytes[kNumValues] = {};
```
##########
cpp/src/parquet/bloom_filter_test.cc:
##########
@@ -326,14 +327,137 @@ TEST(XxHashTest, TestBloomFilter) {
uint8_t bytes[32] = {};
for (int i = 0; i < 32; i++) {
- ByteArray byteArray(i, bytes);
+ ByteArray byte_array(i, bytes);
bytes[i] = i;
auto hasher_seed_0 = std::make_unique<XxHasher>();
- EXPECT_EQ(HASHES_OF_LOOPING_BYTES_WITH_SEED_0[i],
hasher_seed_0->Hash(&byteArray))
+ EXPECT_EQ(HASHES_OF_LOOPING_BYTES_WITH_SEED_0[i],
hasher_seed_0->Hash(&byte_array))
<< "Hash with seed 0 Error: " << i;
}
}
+// Same as TestBloomFilter but using Batch interface
+TEST(XxHashTest, TestBloomFilterHashes) {
+ uint8_t bytes[32] = {};
Review Comment:
Please use some kind of constant instead of magic numbers.
```suggestion
constexpr int kNumValues = 32;
uint8_t bytes[kNumValues] = {};
```
--
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]