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

Method ExtractString

be/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 3

TESTFunction · 0.80
TEST_FFunction · 0.80
CheckMergeOutputFunction · 0.80

Calls 6

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

Tested by 3

TESTFunction · 0.64
TEST_FFunction · 0.64
CheckMergeOutputFunction · 0.64