You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kszucs (via GitHub)" <gi...@apache.org> on 2024/12/13 11:59:17 UTC

Re: [PR] GH-17211: [C++] Add `hash32` and `hash64` scalar compute functions [arrow]

kszucs commented on code in PR #45001:
URL: https://github.com/apache/arrow/pull/45001#discussion_r1883829420


##########
cpp/src/arrow/compute/api_scalar.h:
##########
@@ -1776,5 +1776,21 @@ ARROW_EXPORT Result<Datum> NanosecondsBetween(const Datum& left, const Datum& ri
 /// \note API not yet finalized
 ARROW_EXPORT Result<Datum> MapLookup(const Datum& map, MapLookupOptions options,
                                      ExecContext* ctx = NULLPTR);
+
+/// \brief Construct a hash value for each row of the input.
+///
+/// The result is an Array of length equal to the length of the input; however, the output
+/// shall be a UInt64Array, with each element being a hash constructed from each row of
+/// the input. If the input Array is a NestedArray, this means that each "attribute" or
+/// "field" of the input NestedArray corresponding to the same "row" will collectively
+/// produce a single uint64_t hash. At the moment, this function does not take options,
+/// though these may be added in the future.
+///
+/// \param[in] input_array input data to hash
+/// \param[in] ctx         function execution context, optional

Review Comment:
   Fixed.



##########
cpp/src/arrow/compute/kernels/CMakeLists.txt:
##########
@@ -73,6 +73,7 @@ add_arrow_compute_test(scalar_utility_test
                        scalar_random_test.cc
                        scalar_set_lookup_test.cc
                        scalar_validity_test.cc
+                       scalar_hash_test.cc

Review Comment:
   Fixed.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org