MCPcopy Create free account
hub / github.com/apache/impala / CreateBatch

Method CreateBatch

be/src/exec/tuple-file-read-write-test.cc:87–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85 }
86
87 unique_ptr<RowBatch> CreateBatch(int size = 10) {
88 unique_ptr<RowBatch> batch =
89 make_unique<RowBatch>(nullable_row_desc(), size, tracker());
90 batch->AddRows(size);
91 for (int i = 0; i < size; i++) {
92 TupleRow* row = batch->GetRow(i);
93 Tuple* tuple_mem = Tuple::Create(sizeof(char) + sizeof(int32_t), mem_pool());
94 *reinterpret_cast<int32_t *>(tuple_mem->GetSlot(1)) = i;
95 tuple_mem->SetNotNull(NullIndicatorOffset(0, 1));
96 row->SetTuple(0, tuple_mem);
97 }
98 batch->CommitRows(size);
99 return batch;
100 }
101
102 MemTracker* tracker() { return &tracker_; }
103

Callers

nothing calls this directly

Calls 8

CreateClass · 0.85
NullIndicatorOffsetClass · 0.85
SetNotNullMethod · 0.80
AddRowsMethod · 0.45
GetRowMethod · 0.45
GetSlotMethod · 0.45
SetTupleMethod · 0.45
CommitRowsMethod · 0.45

Tested by

no test coverage detected