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

Method GetAnalyzedQuery

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

Extracts analyzed query SQL text from the plan field.

Source from the content-addressed store, hash-verified

811
812// Extracts analyzed query SQL text from the plan field.
813string QueryProfileToolAccessor::GetAnalyzedQuery() const {
814 const Value* summary = GetSummaryPtr();
815 if (summary != nullptr && summary->HasMember("Plan") && (*summary)["Plan"].IsString()) {
816 const Value& plan_value = (*summary)["Plan"];
817 re2::StringPiece plan(plan_value.GetString(), plan_value.GetStringLength());
818 re2::StringPiece match;
819 if (re2::RE2::PartialMatch(plan, ANALYZED_RE, &match)) {
820 const string_view analyzed =
821 TrimWhiteSpace(string_view(match.data(), match.length()));
822 return string(analyzed);
823 }
824 }
825 return string();
826}
827
828// Reads query type from the Summary section.
829string_view QueryProfileToolAccessor::GetQueryType(const Value& query_obj) const {

Callers 1

ExecuteToolFunction · 0.80

Calls 4

TrimWhiteSpaceFunction · 0.85
GetStringMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected