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

Change subject: IMPALA-13565: Add general AI platform support to 
ai_generate_text
......................................................................


Patch Set 7: Code-Review+1

(6 comments)

http://gerrit.cloudera.org:8080/#/c/22130/7//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/22130/7//COMMIT_MSG@9
PS7, Line 9: open ai
for clarity mention 'OpenAI' single word


http://gerrit.cloudera.org:8080/#/c/22130/7//COMMIT_MSG@30
PS7, Line 30: 5MB
Maybe make this an advanced flagfile option with default value 5M, in case we 
have to tweak it without changing code.


http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions-ir.cc
File be/src/exprs/ai-functions-ir.cc:

http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions-ir.cc@46
PS7, Line 46: DEFINE_string(ai_api_additional_platforms, "",
I think we should rename this to "ai_additional_platforms"?


http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions.inline.h
File be/src/exprs/ai-functions.inline.h:

http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions.inline.h@160
PS7, Line 160:   try {
             :     ParseImpalaOptions(impala_options, impala_options_document, 
ai_options);
             :   } catch (const std::runtime_error& e) {
             :     LOG(WARNING) << AI_GENERATE_TXT_JSON_PARSE_ERROR << ": " << 
e.what();
             :     return StringVal(AI_GENERATE_TXT_JSON_PARSE_ERROR.c_str());
             :   }
We should put this block inside 'if(!fastpath)'


http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions.inline.h@169
PS7, Line 169:       // Use the credential as a plain text token.
             :       string token(reinterpret_cast<char*>(auth_credential.ptr), 
auth_credential.len);
             :       RETURN_STRINGVAL_IF_ERROR(
             :           ctx, getAuthorizationHeader<platform>(authHeader, 
token, ai_options));
When using plain text secret/token we shouldn't create a copy and we can maybe 
use string_view here and change getAuthorizationHeader's signature to accept 
string_view instead of string reference.


http://gerrit.cloudera.org:8080/#/c/22130/7/be/src/exprs/ai-functions.inline.h@192
PS7, Line 192:   if (!ai_options.ai_custom_payload.empty()) {
skip the if block for fastpath
```
if (!fastpath && !ai_options.ai_custom_payload.empty())
```



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I4ea2e1946089f262dda7ace73d5f7e37a5c98b14
Gerrit-Change-Number: 22130
Gerrit-PatchSet: 7
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Anonymous Coward (801)
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Mon, 13 Jan 2025 22:46:53 +0000
Gerrit-HasComments: Yes

Reply via email to