Abhishek Rawat 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 17: (6 comments) http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/ai-functions.h File be/src/exprs/ai-functions.h: http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/ai-functions.h@18 PS16, Line 18: #pragma once : > yes please Done http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/ai-functions.inline.h File be/src/exprs/ai-functions.inline.h: http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/ai-functions.inline.h@18 PS16, Line 18: #pragma once : > nit. #pragma once seems simpler, but not a big deal Done http://gerrit.cloudera.org:8080/#/c/21168/14/be/src/exprs/ai-functions.inline.h File be/src/exprs/ai-functions.inline.h: http://gerrit.cloudera.org:8080/#/c/21168/14/be/src/exprs/ai-functions.inline.h@43 PS14, Line 43: namespace impala { : : template <bool fastpath> : StringVal AiFunctions::AiGenerateTextInternal(FunctionContext* ctx, : const StringVal& endpoint, const StringVal& prompt, const StringVal& model, : const StringVal& api_key_jceks_secret, const StringVal& params, const bool dry_run) { : std::string_view endpoint_sv(FLAGS_ai_endpoint); : // endpoint validation : if (!fastpath && endpoint.ptr != nullptr && endpoint.len != 0) { : endpoint_sv = std::string_view(reinterpret_cast<char*>(endpoint.ptr), endpoint.len); : // Simple validation for endpoint. It should start with https:// > missed static const static member http://gerrit.cloudera.org:8080/#/c/21168/14/be/src/exprs/ai-functions.inline.h@61 PS14, Line 61: return StringVal(AI_GENERA > missed static const static member http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/expr-test.cc File be/src/exprs/expr-test.cc: http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/expr-test.cc@11341 PS16, Line 11341: ng to_null("(\'\\0\')"); : size_t pos = content.find(from_null); : content.replace(pos, from_null.length(), to_null); : EXPECT_EQ(string(res), content); : > nit: use content instead Done. http://gerrit.cloudera.org:8080/#/c/21168/16/be/src/exprs/expr-test.cc@11341 PS16, Line 11341: ng to_null("(\'\\0\')"); : size_t pos = content.find(from_null); : content.replace(pos, from_null.length(), to_null); : EXPECT_EQ(string(res), content); : > There are some slight differences in escaping. Could transform the string t Done -- 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: 17 Gerrit-Owner: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Abhishek Rawat <ara...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Wenzhe Zhou <wz...@cloudera.com> Gerrit-Reviewer: Yida Wu <wydbaggio...@gmail.com> Gerrit-Comment-Date: Wed, 10 Apr 2024 19:00:27 +0000 Gerrit-HasComments: Yes