- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Impala retries even when "SetError(const char* error_msg)" Error is set in UDF.
- Labels:
-
Apache Impala
Created on 09-04-2017 03:14 AM - edited 09-16-2022 05:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
In UDF executing the context->SetError(const char* error_msg) method impala again retries the UDF.
Below is my UDF:-
IntVal my_udf(
FunctionContext* context,
IntVal& sInput
)
{
if( sInput.val == 0 )
{
context->SetError( "Off Value" );
return 0;
}
IntVal iResult(sInput.val + 1);
return iResult;
}
DDL :--
CREATE FUNCTION my_udf(INTEGER) RETURNS INTEGER
LOCATION '/opt/impala/udfs/myudf.so'
SYMBOL = 'my_udf';
So if we debug this UDF using GDB.
If we add the break point at "context->SetError( "Off Value" );" this line then we come to know that if we pass 0 to this UDF this will hit the break point more than one time.
So please let me know that it is right behavior?
i ran this UDF in CDH 5.10 & CDH 5.11.
Created 09-29-2017 05:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw this in my email backlog. Yes this is the expected behaviour. Your UDF may be called again on the same thread or a different thread. After you call SetError() the query will fail but the error will take some time to propagate.
Created 09-29-2017 05:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw this in my email backlog. Yes this is the expected behaviour. Your UDF may be called again on the same thread or a different thread. After you call SetError() the query will fail but the error will take some time to propagate.
