Yida Wu has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/22588 )

Change subject: IMPALA-13812: Fail query for certain errors related to AI 
functions
......................................................................


Patch Set 7:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/22588/5/be/src/exprs/ai-functions.cc
File be/src/exprs/ai-functions.cc:

http://gerrit.cloudera.org:8080/#/c/22588/5/be/src/exprs/ai-functions.cc@71
PS5, Line 71:     const ::impala::Status& _status = (stmt);                     
              \
            :     if (UNLIKELY(!_status.ok())) {                                
              \
            :       SET_ERROR(ctx, _status.msg().msg(), 
AI_GENERATE_TXT_COMMON_ERROR_PREFIX); \
            :       return StringVal::null();                                   
              \
            :     }
> Done. I meant creating a single macro instead of two, while doing string co
It makes sense. Changed to string.


http://gerrit.cloudera.org:8080/#/c/22588/5/be/src/exprs/expr-test.cc
File be/src/exprs/expr-test.cc:

http://gerrit.cloudera.org:8080/#/c/22588/5/be/src/exprs/expr-test.cc@11395
PS5, Line 11395:     + AiFunctions::AI_GENERATE_TXT_COMMON_ERROR_PREFIX.size();
               :   size_t override_forbidden_error_len =
               :       
AiFunctions::AI_GENERATE_TXT_MSG_OVERRIDE_FORBIDDEN_ERROR.size()
               :       + 
AiFunctions::AI_GENERATE_TXT_COMMON_ERROR_PREFIX.size();
               :   size_t n_override_forbidden_error_len =
               :       
AiFunctions::AI_GENERATE_TXT_N_OVERRIDE_FORBIDDEN_ERROR.size()
               :       + 
AiFunctions::AI_GENERATE_TXT_COMMON_ERROR_PREFIX.size();
               :   // Test override/additional params
               :   // invalid json results in error.
               :   StringVal invalid_json_params("{\"temperature\": 0.49, \
> Sure. I meant something like TestStringValue method present here in the lon
Currently, I don't think TestStringValue() prints the call stack, for example, 
if an error occurs within TestStringValue(), it only points to the line inside 
the method, making it hard to trace errors back to the caller. A common method 
would be more useful if inputs or outputs were unique or if we needed the full 
stack trace. For now, clear but repetitive tests seem preferable.
Example Code:
TestStringValue(ctx->error_msg(), "");
Example Result:
[ RUN      ] Instantiations/ExprTest.AiFunctionsTest/2
/impala/Impala/be/src/exprs/expr-test.cc:363: Failure
Value of: expect_error
  Actual: false
Expected: true
stmt: select AI Generate Text Error: Invalid Json: error code 3, offset input 35
error: 42000: Query e9430d78ae4403d8:c5927cd900000000 failed:
ParseException: Syntax error in line 1:
select AI Generate Text Error: Invalid Json: er...
                   ^
Encountered: IDENTIFIER
Expected: CROSS, EXCEPT, FROM, FULL, GROUP, HAVING, INNER, INTERSECT, JOIN, 
LEFT, LIMIT, MINUS, OFFSET, ON, ORDER, RIGHT, STRAIGHT_JOIN, TABLESAMPLE, 
UNION, USING, WHERE, COMMA
CAUSED BY: Exception: Syntax error
[  FAILED  ] Instantiations/ExprTest.AiFunctionsTest/2, where GetParam() = 
(true, true) (42 ms)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I639e48e64d62f7990cf9a3c35a59a0ee3a2c64e0
Gerrit-Change-Number: 22588
Gerrit-PatchSet: 7
Gerrit-Owner: Yida Wu <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Surya Hebbar <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Thu, 13 Mar 2025 16:05:50 +0000
Gerrit-HasComments: Yes

Reply via email to