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

Method WriteStringRow

be/src/runtime/buffered-tuple-stream-test.cc:1894–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1892}
1893
1894void SimpleTupleStreamTest::WriteStringRow(const RowDescriptor* row_desc, TupleRow* row,
1895 int64_t fixed_size, int64_t varlen_size, uint8_t* data) {
1896 uint8_t* fixed_data = data;
1897 uint8_t* varlen_write_ptr = data + fixed_size;
1898 for (int i = 0; i < row_desc->tuple_descriptors().size(); i++) {
1899 TupleDescriptor* tuple_desc = row_desc->tuple_descriptors()[i];
1900 Tuple* src = row->GetTuple(i);
1901 Tuple* dst = reinterpret_cast<Tuple*>(fixed_data);
1902 fixed_data += tuple_desc->byte_size();
1903 memcpy(dst, src, tuple_desc->byte_size());
1904 for (SlotDescriptor* slot : tuple_desc->slots()) {
1905 StringValue* src_string = src->GetStringSlot(slot->tuple_offset());
1906 if (src_string->IsSmall()) continue;
1907 StringValue* dst_string = dst->GetStringSlot(slot->tuple_offset());
1908 dst_string->Assign(reinterpret_cast<char*>(varlen_write_ptr), src_string->Len());
1909 memcpy(dst_string->Ptr(), src_string->Ptr(), src_string->Len());
1910 varlen_write_ptr += src_string->Len();
1911 }
1912 }
1913 ASSERT_EQ(data + fixed_size + varlen_size, varlen_write_ptr);
1914}
1915
1916// Test with rows with multiple nullable tuples.
1917TEST_F(MultiNullableTupleStreamTest, MultiNullableTupleOneBufferSpill) {

Callers

nothing calls this directly

Calls 9

GetStringSlotMethod · 0.80
tuple_offsetMethod · 0.80
sizeMethod · 0.45
GetTupleMethod · 0.45
byte_sizeMethod · 0.45
IsSmallMethod · 0.45
AssignMethod · 0.45
LenMethod · 0.45
PtrMethod · 0.45

Tested by

no test coverage detected