Yida Wu has posted comments on this change. ( http://gerrit.cloudera.org:8080/21168 )
Change subject: IMPALA-12920: Support ai_generate_text built-in function for OpenAI's chat completion API ...................................................................... Patch Set 5: Code-Review+1 (4 comments) LGTM! Some minor comments. http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc File be/src/exprs/ai-functions-ir.cc: http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@83 PS5, Line 83: != nullptr); nit. seems we can save one line here because above line has enough space http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@225 PS5, Line 225: kudu::EasyCurl curl; : curl.set_timeout(kudu::MonoDelta::FromSeconds(FLAGS_ai_connection_timeout_s)); : curl.set_fail_on_http_error(true); : kudu::faststring resp; : kudu::Status status = curl.PostToURL(endpoint_str, payload_str, &resp, headers); : VLOG(2) << "AI Generate Text: \noriginal response: " << resp.ToString(); : if (!status.ok()) { : string msg = status.ToString(); : return StringVal::CopyFrom( : ctx, reinterpret_cast<const uint8_t*>(msg.c_str()), msg.size()); : } Can we add a summary comment about what this part of code is doing? I think it does the real thing to contact with the Ai endpoint, and can be critical to performance, maybe a comment can make it clearer for others to understand its importance. http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@236 PS5, Line 236: JSON string nit. how about saying "response JSON string" http://gerrit.cloudera.org:8080/#/c/21168/5/be/src/exprs/ai-functions-ir.cc@251 PS5, Line 251: response Thinking about whether we need to worry about the case when the length of response is very large or unexpected large. How about we print a warning log if the response is larger than certain size? -- To view, visit http://gerrit.cloudera.org:8080/21168 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Id4446957f6030bab1f985fdd69185c3da07d7c4b Gerrit-Change-Number: 21168 Gerrit-PatchSet: 5 Gerrit-Owner: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Abhishek Rawat <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Yida Wu <[email protected]> Gerrit-Comment-Date: Mon, 01 Apr 2024 22:19:10 +0000 Gerrit-HasComments: Yes
