MCPcopy Create free account
hub / github.com/apache/arrow / GenerateRowCounts

Method GenerateRowCounts

cpp/src/arrow/acero/tpch_node.cc:1770–1789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1768 }
1769
1770 Status GenerateRowCounts(size_t thread_index) {
1771 ThreadLocalData& tld = thread_local_data_[thread_index];
1772 std::uniform_int_distribution<int> length_dist(1, 7);
1773 tld.lineitem_to_generate = 0;
1774 tld.items_per_order.clear();
1775 for (int64_t i = 0; i < tld.orders_to_generate; i++) {
1776 int length = length_dist(tld.rng);
1777 tld.items_per_order.push_back(length);
1778 tld.lineitem_to_generate += length;
1779 }
1780 int64_t num_batches =
1781 (tld.first_batch_offset + tld.lineitem_to_generate + batch_size_ - 1) /
1782 batch_size_;
1783 tld.lineitem.resize(num_batches);
1784 for (std::vector<Datum>& batch : tld.lineitem) {
1785 batch.resize(LINEITEM::kNumCols);
1786 std::fill(batch.begin(), batch.end(), Datum());
1787 }
1788 return Status::OK();
1789 }
1790
1791 Status AllocateLineItemBufferIfNeeded(size_t thread_index, size_t ibatch, int column,
1792 size_t& out_batch_offset) {

Callers

nothing calls this directly

Calls 7

push_backMethod · 0.80
resizeMethod · 0.80
DatumClass · 0.50
OKFunction · 0.50
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected