cyb70289 commented on a change in pull request #11864:
URL: https://github.com/apache/arrow/pull/11864#discussion_r773592769



##########
File path: cpp/src/arrow/compute/api_scalar.h
##########
@@ -420,6 +420,30 @@ struct ARROW_EXPORT Utf8NormalizeOptions : public 
FunctionOptions {
   Form form;
 };
 
+class ARROW_EXPORT RandomOptions : public FunctionOptions {
+ public:
+  enum Initializer { SystemRandom, Seed };
+
+  static RandomOptions FromSystemRandom(int64_t length) {
+    return RandomOptions{length, SystemRandom, 0};
+  }
+  static RandomOptions FromSeed(int64_t length, uint32_t seed) {
+    return RandomOptions{length, Seed, seed};
+  }
+
+  RandomOptions(int64_t length, Initializer initializer, uint32_t seed);
+  RandomOptions();
+  constexpr static char const kTypeName[] = "RandomOptions";
+  static RandomOptions Defaults() { return RandomOptions(); }
+
+  /// The length of the array returned. Negative is invalid.
+  int64_t length;
+  /// The type of initialization for random number generation - system or 
provided seed.
+  Initializer initializer;
+  /// The seed value used to initialize the random number generation.
+  uint32_t seed;

Review comment:
       It was `uint32_t` to be consistent with system random seed, also 
references numpy.random.seed.
   But as we have changed to use pcg64 for system random seed, it looks better 
be also use uint64 here.




-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to