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



##########
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:
       Done. I don't know why it was changed to `uint32_t`, maybe @cyb70289 had 
a good reason. I made it `int64_t` initially, should have been `uint64_t`.




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