save-buffer commented on a change in pull request #12537:
URL: https://github.com/apache/arrow/pull/12537#discussion_r824953047



##########
File path: cpp/src/arrow/compute/exec/tpch_node.cc
##########
@@ -0,0 +1,3836 @@
+#include "arrow/compute/exec/tpch_node.h"
+#include "arrow/util/make_unique.h"
+#include "arrow/util/future.h"
+#include "arrow/util/unreachable.h"
+
+#include <algorithm>
+#include <bitset>
+#include <cstring>
+#include <random>
+#include <vector>
+#include <memory>
+#include <mutex>
+#include <queue>
+#include <unordered_set>
+
+namespace arrow
+{
+    using internal::checked_cast;
+
+    namespace compute
+    {
+        class TpchText
+        {
+        public:
+            Status InitIfNeeded(random::pcg32_fast &rng);
+            Result<Datum> GenerateComments(
+                size_t num_comments,
+                size_t min_length,
+                size_t max_length,
+                random::pcg32_fast &rng);
+
+        private:
+            bool GenerateWord(int64_t &offset, random::pcg32_fast &rng, char 
*arr, const char **words, size_t num_choices);
+            bool GenerateNoun(int64_t &offset, random::pcg32_fast &rng, char 
*arr);
+            bool GenerateVerb(int64_t &offset, random::pcg32_fast &rng, char 
*arr);
+            bool GenerateAdjective(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+            bool GenerateAdverb(int64_t &offset, random::pcg32_fast &rng, char 
*arr);
+            bool GeneratePreposition(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+            bool GenerateAuxiliary(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+            bool GenerateTerminator(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+
+            bool GenerateNounPhrase(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+            bool GenerateVerbPhrase(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+            bool GeneratePrepositionalPhrase(int64_t &offset, 
random::pcg32_fast &rng, char *arr);
+
+            bool GenerateSentence(int64_t &offset, random::pcg32_fast &rng, 
char *arr);
+
+            std::atomic<bool> done_ = { false };
+            int64_t generated_offset_ = 0;
+            std::mutex text_guard_;

Review comment:
       I need the same one to be visible to each thread. 




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