Abhishek Rawat has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24284 )

Change subject: IMPALA-14963: Query Profile AI Analysis Tool
......................................................................


Patch Set 13:

(3 comments)

http://gerrit.cloudera.org:8080/#/c/24284/12/be/src/service/query-profile-ai-analysis.cc
File be/src/service/query-profile-ai-analysis.cc:

http://gerrit.cloudera.org:8080/#/c/24284/12/be/src/service/query-profile-ai-analysis.cc@557
PS12, Line 557: }
We could parse the static json once and cache the document rather than parsing 
it every time BuildAgentPayloadJson is called? Also, declare PROFILE_TOOLS_JSON 
as an array so that you can compute its size.

```
static const Document parsed_tools_doc = [] {
    Document doc;
    doc.Parse(PROFILE_TOOLS_JSON, sizeof(PROFILE_TOOLS_JSON) - 1);
    return doc;
}();
....
....
Value tools_value(parsed_tools_doc, payload_doc.GetAllocator());
payload_doc.AddMember("tools", tools_value, alloc);
```


http://gerrit.cloudera.org:8080/#/c/24284/12/be/src/service/query-profile-ai-analysis.cc@582
PS12, Line 582: }
Use StringRef instead to avoid copy and update the static const to include both 
SYSTEM_INSTRUCTION + AGENT_PROTOCOL.


http://gerrit.cloudera.org:8080/#/c/24284/12/be/src/service/query-profile-ai-analysis.cc@703
PS12, Line 703:   str_type.type = FunctionContext::TYPE_STRING;
Use StringRef here and avoid deep copy.

impala_options_doc.AddMember("payload",
    rapidjson::StringRef(payload_json.c_str(), payload_json.size()), 
impala_options_alloc);



--
To view, visit http://gerrit.cloudera.org:8080/24284
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia9376b8c56df75032f51abbb76b3ac6927f9107e
Gerrit-Change-Number: 24284
Gerrit-PatchSet: 13
Gerrit-Owner: Gokul Kolady <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Gokul Kolady <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Kurt Deschler <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Tue, 19 May 2026 22:44:42 +0000
Gerrit-HasComments: Yes

Reply via email to