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


##########
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] = {};
+
+  std::vector<ByteArray> byte_array_vector;
+  for (int i = 0; i < 32; i++) {
+    bytes[i] = i;
+    byte_array_vector.emplace_back(i, bytes);
+  }
+  auto hasher_seed_0 = std::make_unique<XxHasher>();
+  std::vector<uint64_t> hashes;
+  hashes.resize(32);
+  hasher_seed_0->Hashes(byte_array_vector.data(),
+                        static_cast<int>(byte_array_vector.size()), 
hashes.data());
+  for (int i = 0; i < 32; i++) {
+    EXPECT_EQ(HASHES_OF_LOOPING_BYTES_WITH_SEED_0[i], hashes[i])
+        << "Hash with seed 0 Error: " << i;
+  }
+}
+
+template <typename DType>
+class TestBatchBloomFilter : public testing::Test {
+ public:
+  using T = typename DType::c_type;

Review Comment:
   Thanks! This works!



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