<?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: How to make Imapla Variance UDAF to return Double value instead of String in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29342#M16735</link>
    <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your fast response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have couple of questions more &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I see that the KnuthVariance returns Double, but when I try it in my code having Finalize function return a Double I get,&lt;/P&gt;&lt;P&gt;Analysis Exception: Could not find function &lt;STRONG&gt;func_nameUpdate&lt;/STRONG&gt;(double,double,double) returns double in 'HDFS_so_filepath' Check that function name, agruments and return types are correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am curious how the in-built functions have that feature.&lt;/P&gt;&lt;P&gt;Pls do let me know if I am missing something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) If cloudera needs to fix it, pls let me know on which CDH and impala version, fix might be released. Thanks !!!&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jul 2015 14:41:30 GMT</pubDate>
    <dc:creator>ajaysadhu</dc:creator>
    <dc:date>2015-07-07T14:41:30Z</dc:date>
    <item>
      <title>How to make Imapla Variance UDAF to return Double value instead of String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29295#M16733</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been working on creating custom User Defined Aggregate Functions (UDAF), looking at the example provided &lt;A href="https://github.com/cloudera/impala-udf-samples/blob/master/variance-uda.cc" target="_blank"&gt;here. &lt;/A&gt;&lt;BR /&gt;Here Variance and standard deviation is calculated on a Impala column.&lt;BR /&gt;&lt;BR /&gt;Since we have quite a lot varibles to calculate like sum, sum of squares and count, we use a C++ struct and serialize it as a string, so that data is passed to init, update, merge and finalize phases.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My questions:&lt;/P&gt;&lt;P&gt;1) Can we have a Double return type instead of String.&lt;/P&gt;&lt;P&gt;2) Where can we find the implementations of Impala buitl-in functions like min(), sum(), max() since these functions return double.&lt;BR /&gt;&lt;BR /&gt;Any suggestions are welcome. Thanks !!!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:33:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29295#M16733</guid>
      <dc:creator>ajaysadhu</dc:creator>
      <dc:date>2022-09-16T09:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to make Imapla Variance UDAF to return Double value instead of String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29317#M16734</link>
      <description>&lt;P&gt;I'm afraid you may have to wait until we resolve:&lt;/P&gt;&lt;P&gt;&lt;A href="https://issues.cloudera.org/browse/IMPALA-1829" target="_blank"&gt;https://issues.cloudera.org/browse/IMPALA-1829&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the impala builtins you can have a look at:&lt;/P&gt;&lt;P&gt;IMPALA_HOME/be/src/exprs/aggregate-functions.h&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IMPALA_HOME/be/src/exprs/aggregate-functions.cc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 08:13:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29317#M16734</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2015-07-07T08:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to make Imapla Variance UDAF to return Double value instead of String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29342#M16735</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your fast response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have couple of questions more &lt;span class="lia-unicode-emoji" title=":face_with_tongue:"&gt;😛&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I see that the KnuthVariance returns Double, but when I try it in my code having Finalize function return a Double I get,&lt;/P&gt;&lt;P&gt;Analysis Exception: Could not find function &lt;STRONG&gt;func_nameUpdate&lt;/STRONG&gt;(double,double,double) returns double in 'HDFS_so_filepath' Check that function name, agruments and return types are correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am curious how the in-built functions have that feature.&lt;/P&gt;&lt;P&gt;Pls do let me know if I am missing something.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) If cloudera needs to fix it, pls let me know on which CDH and impala version, fix might be released. Thanks !!!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 14:41:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29342#M16735</guid>
      <dc:creator>ajaysadhu</dc:creator>
      <dc:date>2015-07-07T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to make Imapla Variance UDAF to return Double value instead of String</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29533#M16736</link>
      <description>&lt;P&gt;1) The Knuth variance is an Impala built-in. Internally, Impala can handle aggregate functions with different intermediate and output types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, the only reason you are not allowed to create UDAs with different intermediate/output types is because we have not enabled the feature in sermantic analysis.&lt;/P&gt;&lt;P&gt;For us, enabling the feature is the easy part. Adding extensive testing is the hard part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are curious, the check for preventing you from creating such UDAs is in:&lt;/P&gt;&lt;P&gt;./fe/src/main/java/com/cloudera/impala/analysis/CreateUdaStmt.java&lt;/P&gt;&lt;P&gt;lines 137 following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) Like I said, enabling the&amp;nbsp;feature is not hard, but does involve a non-trivial QA effort, so I cannot promise a concrete release at this point. I'd recommend keeping an eye on that JIRA for updates to the target version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2015 02:03:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-make-Imapla-Variance-UDAF-to-return-Double-value/m-p/29533#M16736</guid>
      <dc:creator>alex.behm</dc:creator>
      <dc:date>2015-07-14T02:03:27Z</dc:date>
    </item>
  </channel>
</rss>

