<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Impala retries even when &amp;quot;SetError(const char* error_msg)&amp;quot;  Error is set in UDF. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-retries-even-when-quot-SetError-const-char-error-msg/m-p/60457#M67578</link>
    <description>&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Sep 2017 00:21:24 GMT</pubDate>
    <dc:creator>Tim Armstrong</dc:creator>
    <dc:date>2017-09-30T00:21:24Z</dc:date>
    <item>
      <title>Impala retries even when "SetError(const char* error_msg)"  Error is set in UDF.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-retries-even-when-quot-SetError-const-char-error-msg/m-p/59541#M67577</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In UDF executing the context-&amp;gt;SetError(const char* error_msg) method impala again retries the UDF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my UDF:-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IntVal my_udf(&lt;BR /&gt;FunctionContext* context,&lt;BR /&gt;IntVal&amp;amp; sInput&lt;BR /&gt;)&lt;BR /&gt;{&lt;BR /&gt;if( sInput.val == 0 )&lt;BR /&gt;{&lt;BR /&gt;context-&amp;gt;SetError( "Off Value" );&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;BR /&gt;IntVal iResult(sInput.val + 1);&lt;BR /&gt;return iResult;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DDL :--&lt;/P&gt;&lt;P&gt;CREATE FUNCTION my_udf(INTEGER) RETURNS INTEGER&lt;BR /&gt;LOCATION '/opt/impala/udfs/myudf.so'&lt;BR /&gt;SYMBOL = 'my_udf';&lt;BR /&gt;&lt;BR /&gt;So if we debug this UDF using GDB.&lt;/P&gt;&lt;P&gt;If we add the break point at "&lt;EM&gt;context-&amp;gt;SetError( "Off Value" );&lt;/EM&gt;" 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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So please let me know that it is right behavior?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;i ran this UDF in CDH 5.10 &amp;amp; CDH 5.11.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:11:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-retries-even-when-quot-SetError-const-char-error-msg/m-p/59541#M67577</guid>
      <dc:creator>RPAT</dc:creator>
      <dc:date>2022-09-16T12:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: Impala retries even when "SetError(const char* error_msg)"  Error is set in UDF.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-retries-even-when-quot-SetError-const-char-error-msg/m-p/60457#M67578</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Sep 2017 00:21:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Impala-retries-even-when-quot-SetError-const-char-error-msg/m-p/60457#M67578</guid>
      <dc:creator>Tim Armstrong</dc:creator>
      <dc:date>2017-09-30T00:21:24Z</dc:date>
    </item>
  </channel>
</rss>

