mapleFU commented on code in PR #37400:
URL: https://github.com/apache/arrow/pull/37400#discussion_r2158190645
##########
cpp/src/parquet/bloom_filter.h:
##########
@@ -106,6 +106,34 @@ class PARQUET_EXPORT BloomFilter {
/// @return hash result.
virtual uint64_t Hash(const FLBA* value, uint32_t len) const = 0;
+ // Variant of const reference argument to facilitate template
+
+ /// Compute hash for ByteArray value by using its plain encoding result.
+ ///
+ /// @param value the value to hash.
+ uint64_t Hash(const ByteArray& value) const { return Hash(&value); }
+
+ /// Compute hash for fixed byte array value by using its plain encoding
result.
+ ///
+ /// @param value the value to hash.
+ /// @param type_len the value length.
+ uint64_t Hash(const FLBA& value, uint32_t type_len) const {
+ return Hash(&value, type_len);
+ }
+
+ /// Compute hash for Int96 value by using its plain encoding result.
+ ///
+ /// @param value the value to hash.
+ uint64_t Hash(const Int96& value) const { return Hash(&value); }
+
+ /// Compute hash for std::string_view value by using its plain encoding
result.
+ ///
+ /// @param value the value to hash.
+ uint64_t Hash(std::string_view value) const {
+ ByteArray ba(value);
+ return Hash(&ba);
Review Comment:
Nice catch!
--
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]