MCPcopy Create free account
hub / github.com/4paradigm/OpenMLDB / GetString

Method GetString

src/codec/codec.cc:765–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

763}
764
765int32_t RowView::GetString(uint32_t idx, char** val, uint32_t* length) {
766 if (val == NULL || length == NULL) {
767 return -1;
768 }
769
770 if (!CheckValid(idx, ::fedb::type::kVarchar) &&
771 !CheckValid(idx, fedb::type::kString)) {
772 return -1;
773 }
774 if (IsNULL(row_, idx)) {
775 return 1;
776 }
777 uint32_t field_offset = offset_vec_.at(idx);
778 uint32_t next_str_field_offset = 0;
779 if (offset_vec_.at(idx) < string_field_cnt_ - 1) {
780 next_str_field_offset = field_offset + 1;
781 }
782 return v1::GetStrField(row_, field_offset, next_str_field_offset,
783 str_field_start_offset_, str_addr_length_,
784 reinterpret_cast<int8_t**>(val), length);
785}
786
787int32_t RowView::GetStrValue(uint32_t idx, std::string* val) {
788 return GetStrValue(row_, idx, val);

Callers 8

CompareRowFunction · 0.45
CompareRowFunction · 0.45
DecodeRowMethod · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
ProjectMethod · 0.45
PrintResultSetFunction · 0.45
TEST_FFunction · 0.45

Calls 1

GetStrFieldFunction · 0.85

Tested by 5

CompareRowFunction · 0.36
CompareRowFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36