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

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


Patch Set 9:

(8 comments)

http://gerrit.cloudera.org:8080/#/c/24284/6/be/src/service/impala-http-handler.cc
File be/src/service/impala-http-handler.cc:

http://gerrit.cloudera.org:8080/#/c/24284/6/be/src/service/impala-http-handler.cc@481
PS6, Line 481:   status = GenerateAiAnalysisFromProfile(
             :       string(profile_buffer.GetString(), 
profile_buffer.GetSize()), &analysis);
> The linker is failing on this line with:
Done


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

http://gerrit.cloudera.org:8080/#/c/24284/7/be/src/service/query-profile-ai-analysis.cc@530
PS7, Line 530:   user_message.append(ANALYSIS_PROMPT)
             :       .append("\n\nInitial profile context:\n")
             :       .append(initial_summary_json.data(), 
initial_summary_json.size());
             :   conversation.emplace_back("user", std::move(user_message), "", 
"");
             :
             :   string last_response;
             :   for (int iteration = 0; iteration < MAX_AGENT_ITERATIONS; 
++iteration) {
             :     string payload_json;
             :     RETURN_IF_ERROR(BuildAgentPayloadJson(conversation, 
&payload_json));
             :
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24284/7/be/src/service/query-profile-ai-analysis.cc@580
PS7, Line 580:         if (!function.HasMember("name") || 
!function["name"].IsString()) continue;
             :
             :         const Value& tool_name_value = function["name"];
             :         const string_view tool_name(
             :
> Done
Done


http://gerrit.cloudera.org:8080/#/c/24284/7/be/src/service/query-profile-ai-analysis.cc@614
PS7, Line 614:  = tool_error_doc.GetAllocator();
> Done
Done


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

http://gerrit.cloudera.org:8080/#/c/24284/9/be/src/service/query-profile-ai-analysis.cc@61
PS9, Line 61: static bool ValidateQueryProfileAiAnalysisSizeLimitBytes(
            :     const char* flagname, int64_t value) {
            :   if (value > 0) return true;
            :   LOG(ERROR) << "Invalid value for --" << flagname << ": " << 
value
            :              << ". Must be > 0.";
            :   return false;
            : }
            : 
DEFINE_validator(query_profile_ai_analysis_profile_size_limit_bytes,
            :     ValidateQueryProfileAiAnalysisSizeLimitBytes);
Use the gt_zero function defined in gflag-validator-util.h instead of defining 
this ValidateQueryProfileAiAnalysisSizeLimitBytes function.


http://gerrit.cloudera.org:8080/#/c/24284/9/be/src/service/query-profile-ai-analysis.cc@68
PS9, Line 68: 
DEFINE_validator(query_profile_ai_analysis_profile_size_limit_bytes,
            :     ValidateQueryProfileAiAnalysisSizeLimitBytes);
Place the DEFINE_validator functions immediately below the DEFINE_* functions 
that define the flag.


http://gerrit.cloudera.org:8080/#/c/24284/9/be/src/service/query-profile-ai-analysis.cc@74
PS9, Line 74:   int64_t parsed = ParseUtil::ParseMemSpec(value, &is_percent, 
100);
This function does not cap the returned value at 100%.  It applies no cap at 
all.  Is that the desired behavior?


http://gerrit.cloudera.org:8080/#/c/24284/9/be/src/service/query-profile-ai-analysis.cc@95
PS9, Line 95:   if (byte_limit <= 0) {
            :     return Status(strings::Substitute(
            :         "Invalid 
--query_profile_ai_analysis_profile_size_limit_bytes: $0",
            :         byte_limit));
            :   }
No need for this if statement, the validator on the 
query_profile_ai_analysis_profile_size_limit_bytes flag takes care of ensuring 
FLAGS_query_profile_ai_analysis_profile_size_limit_bytes will be greater than 0.



--
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: 9
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: Mon, 18 May 2026 21:40:02 +0000
Gerrit-HasComments: Yes

Reply via email to