| 2347 | } |
| 2348 | |
| 2349 | Status L_COMMENT(size_t thread_index) { |
| 2350 | ThreadLocalData& tld = thread_local_data_[thread_index]; |
| 2351 | if (!tld.generated_lineitem[LINEITEM::L_COMMENT]) { |
| 2352 | tld.generated_lineitem[LINEITEM::L_COMMENT] = true; |
| 2353 | |
| 2354 | size_t ibatch = 0; |
| 2355 | for (int64_t irow = 0; irow < tld.lineitem_to_generate; ibatch++) { |
| 2356 | // Comments are kind of sneaky: we always generate the full batch and then just |
| 2357 | // bump the length |
| 2358 | size_t batch_offset = 0; |
| 2359 | if (tld.lineitem[ibatch][LINEITEM::L_COMMENT].kind() == Datum::NONE) { |
| 2360 | ARROW_ASSIGN_OR_RAISE(tld.lineitem[ibatch][LINEITEM::L_COMMENT], |
| 2361 | g_text.GenerateComments(batch_size_, 10, 43, tld.rng)); |
| 2362 | batch_offset = 0; |
| 2363 | } |
| 2364 | if (irow == 0) batch_offset = tld.first_batch_offset; |
| 2365 | |
| 2366 | int64_t remaining_in_batch = static_cast<int64_t>(batch_size_ - batch_offset); |
| 2367 | int64_t next_run = std::min(tld.lineitem_to_generate - irow, remaining_in_batch); |
| 2368 | |
| 2369 | batch_offset += next_run; |
| 2370 | irow += next_run; |
| 2371 | tld.lineitem[ibatch][LINEITEM::L_COMMENT].array()->length = batch_offset; |
| 2372 | } |
| 2373 | } |
| 2374 | return Status::OK(); |
| 2375 | } |
| 2376 | |
| 2377 | struct ThreadLocalData { |
| 2378 | std::vector<Datum> orders; |
nothing calls this directly
no test coverage detected