pitrou commented on code in PR #35731:
URL: https://github.com/apache/arrow/pull/35731#discussion_r1203842955
##########
cpp/src/parquet/bloom_filter.h:
##########
@@ -200,19 +257,52 @@ class PARQUET_EXPORT BlockSplitBloomFilter : public
BloomFilter {
bool FindHash(uint64_t hash) const override;
void InsertHash(uint64_t hash) override;
+ void InsertHashes(const uint64_t* hashes, int num_values) override {
+ for (int i = 0; i < num_values; ++i) {
+ InsertHash(hashes[i]);
+ }
+ }
void WriteTo(ArrowOutputStream* sink) const override;
uint32_t GetBitsetSize() const override { return num_bytes_; }
+ uint64_t Hash(int32_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(int64_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(float value) const override { return hasher_->Hash(value); }
uint64_t Hash(double value) const override { return hasher_->Hash(value); }
uint64_t Hash(const Int96* value) const override { return
hasher_->Hash(value); }
uint64_t Hash(const ByteArray* value) const override { return
hasher_->Hash(value); }
- uint64_t Hash(int32_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(const FLBA* value, uint32_t len) const override {
return hasher_->Hash(value, len);
}
+ void Hashes(const int32_t* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const int64_t* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const float* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const double* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const Int96* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const ByteArray* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const FLBA* values, uint32_t type_len, int num_values,
+ uint64_t* hashes) const override {
+ hasher_->Hashes(values, type_len, num_values, hashes);
+ }
+
+ uint64_t Hash(int32_t* value) const { return hasher_->Hash(*value); }
Review Comment:
Please make the pointers `const` here.
##########
cpp/src/parquet/bloom_filter.h:
##########
@@ -200,19 +257,52 @@ class PARQUET_EXPORT BlockSplitBloomFilter : public
BloomFilter {
bool FindHash(uint64_t hash) const override;
void InsertHash(uint64_t hash) override;
+ void InsertHashes(const uint64_t* hashes, int num_values) override {
+ for (int i = 0; i < num_values; ++i) {
+ InsertHash(hashes[i]);
+ }
+ }
void WriteTo(ArrowOutputStream* sink) const override;
uint32_t GetBitsetSize() const override { return num_bytes_; }
+ uint64_t Hash(int32_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(int64_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(float value) const override { return hasher_->Hash(value); }
uint64_t Hash(double value) const override { return hasher_->Hash(value); }
uint64_t Hash(const Int96* value) const override { return
hasher_->Hash(value); }
uint64_t Hash(const ByteArray* value) const override { return
hasher_->Hash(value); }
- uint64_t Hash(int32_t value) const override { return hasher_->Hash(value); }
uint64_t Hash(const FLBA* value, uint32_t len) const override {
return hasher_->Hash(value, len);
}
+ void Hashes(const int32_t* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const int64_t* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const float* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const double* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const Int96* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const ByteArray* values, int num_values, uint64_t* hashes) const
override {
+ hasher_->Hashes(values, num_values, hashes);
+ }
+ void Hashes(const FLBA* values, uint32_t type_len, int num_values,
+ uint64_t* hashes) const override {
+ hasher_->Hashes(values, type_len, num_values, hashes);
+ }
+
+ uint64_t Hash(int32_t* value) const { return hasher_->Hash(*value); }
Review Comment:
```suggestion
uint64_t Hash(const int32_t* value) const { return hasher_->Hash(*value); }
```
--
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]