MCPcopy Create free account
hub / github.com/apache/kudu / ExtractString

Method ExtractString

src/kudu/util/jsonreader.cc:173–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173Status JsonReader::ExtractString(const Value* object,
174 const char* field,
175 string* result) const {
176 const Value* val;
177 RETURN_NOT_OK(ExtractField(object, field, &val));
178 if (PREDICT_FALSE(!val->IsString())) {
179 if (val->IsNull()) {
180 *result = "";
181 return Status::OK();
182 }
183 return Status::InvalidArgument(Substitute(
184 "wrong type during field extraction: expected string but got $0",
185 TypeToString(val->GetType())));
186 }
187 result->assign(val->GetString());
188 return Status::OK();
189}
190
191Status JsonReader::ExtractObject(const Value* object,
192 const char* field,

Callers 11

GetInt64MetricFunction · 0.80
LocateRowFunction · 0.80
ConvertToKuduPartialRowFunction · 0.80
ParseValueOfTypeFunction · 0.80
ListTabletRowsetIdsMethod · 0.80
TESTFunction · 0.80
TEST_FFunction · 0.80
CheckMergeOutputFunction · 0.80
DecryptEncryptionKeyMethod · 0.80
CreateClusterKeyMethod · 0.80

Calls 7

OKFunction · 0.85
InvalidArgumentFunction · 0.85
SubstituteFunction · 0.85
GetTypeMethod · 0.80
TypeToStringFunction · 0.70
IsNullMethod · 0.45
GetStringMethod · 0.45

Tested by 5

GetInt64MetricFunction · 0.64
ListTabletRowsetIdsMethod · 0.64
TESTFunction · 0.64
TEST_FFunction · 0.64
CheckMergeOutputFunction · 0.64