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

Method GetSpecificOperator

be/src/service/query-profile-parsing-tools.cc:608–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608Value QueryProfileToolAccessor::GetSpecificOperator(string_view node_id,
609 string_view fragment_id, string_view instance_id,
610 Document::AllocatorType& alloc) const {
611 Value all = GetAllOperators(node_id, fragment_id, alloc);
612 if (!all.IsArray() || all.Empty()) {
613 Value err(rapidjson::kObjectType);
614 err.AddMember(Value(ERROR_KEY, alloc), Value("operator not found", alloc), alloc);
615 return err;
616 }
617 if (instance_id.empty()) {
618 return Value(move(all.GetArray()[0]));
619 }
620 for (auto& row : all.GetArray()) {
621 if (!row.IsObject() || !row.HasMember("instance")
622 || !row["instance"].IsString()) {
623 continue;
624 }
625 const Value& instance_value = row["instance"];
626 const string_view instance(
627 instance_value.GetString(), instance_value.GetStringLength());
628 if (instance.find(instance_id) != string::npos) return Value(move(row));
629 }
630 Value err(rapidjson::kObjectType);
631 err.AddMember(
632 Value(ERROR_KEY, alloc),
633 Value("specific operator instance not found", alloc), alloc);
634 return err;
635}
636
637// Returns compact metrics for scan nodes across fragments.
638Value QueryProfileToolAccessor::GetScanNodesSummary(

Callers 1

ExecuteToolFunction · 0.80

Calls 7

moveFunction · 0.85
ValueClass · 0.50
EmptyMethod · 0.45
AddMemberMethod · 0.45
emptyMethod · 0.45
GetStringMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected