<?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: [UDA] Impala Operation Problem in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29171#M5590</link>
    <description>&lt;P&gt;I can run your code in the shell with -test.cc without the a problem, but when I created a function with it in impala, it is not working, only lines I added are:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;87 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; StringVal result;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;88 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; percentile-&amp;gt;values-&amp;gt;sort();&lt;/P&gt;&lt;P&gt;&amp;nbsp;89&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;90 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; &lt;SPAN&gt;"Sorted list:"&lt;/SPAN&gt; &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;91 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;for&lt;/SPAN&gt; (std::list&amp;lt;&lt;SPAN&gt;double&lt;/SPAN&gt;&amp;gt;::iterator it = percentile-&amp;gt;values-&amp;gt;begin(); it != percentile-&amp;gt;values-&amp;gt;end(); it++)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;92 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; *it &amp;lt;&amp;lt; &lt;SPAN&gt;' '&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;93 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\n&lt;/SPAN&gt;&lt;SPAN&gt;===Sorted list:"&lt;/SPAN&gt; &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;94&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;95 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;int&lt;/SPAN&gt; n = percentile-&amp;gt;percent * (percentile-&amp;gt;nb - &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;96 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::list&amp;lt;&lt;SPAN&gt;double&lt;/SPAN&gt;&amp;gt;::iterator it = percentile-&amp;gt;values-&amp;gt;begin();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from 90-93, to see if the list sorted correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;impalad.INFO&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;I0701 12:15:43.854324 30959 plan-fragment-executor.cc:190] descriptor table for fragment=7b405b9a021d464a:6b#&lt;/P&gt;&lt;P&gt;# A fatal error has been detected by the Java Runtime Environment:&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;#&amp;nbsp; SIGSEGV (0xb) at pc=0x00007fb42a30ba3c, pid=27281, tid=140411399993088&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)&lt;/P&gt;&lt;P&gt;# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)&lt;/P&gt;&lt;P&gt;# Problematic frame:&lt;/P&gt;&lt;P&gt;# C&amp;nbsp; [libudapctL.27281.0.so+0x3a3c]&amp;nbsp; std::list&amp;lt;double, std::allocator&amp;lt;double&amp;gt; &amp;gt;::merge(std::list&amp;lt;double, std::allocator&amp;lt;double&amp;gt; &amp;gt;&amp;amp;)+0x80&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# An error report file with more information is saved as:&lt;/P&gt;&lt;P&gt;# /var/run/cloudera-scm-agent/process/411-impala-IMPALAD/hs_err_pid27281.log&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# If you would like to submit a bug report, please visit:&lt;/P&gt;&lt;P&gt;# &amp;nbsp; &lt;A href="http://bugreport.sun.com/bugreport/crash.jsp" target="_blank"&gt;http://bugreport.sun.com/bugreport/crash.jsp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;5b38a813715cac&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;imalapd.ERROR&lt;/P&gt;&lt;P&gt;E0701 12:15:45.940914&amp;nbsp; 9620 logging.cc:119] stderr will be logged to this file.&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentSerialize:&lt;/P&gt;&lt;P&gt;call PercentMerge:&lt;/P&gt;&lt;P&gt;call PercentMerge:&lt;/P&gt;&lt;P&gt;My data set have more the 20 elements, seems like to read up 1/3 then start to serialize it, and merge the result, but error out there. Did you ever had this problem?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Seems like&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jul 2015 19:27:35 GMT</pubDate>
    <dc:creator>Jie.Liang</dc:creator>
    <dc:date>2015-07-01T19:27:35Z</dc:date>
    <item>
      <title>[UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/26602#M5586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I try to debug my UDA percentile function in cpp and i don't understand the impala operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is my percentile code :&lt;/P&gt;&lt;PRE&gt;template &amp;lt;typename T&amp;gt;
StringVal ToStringVal(FunctionContext* context, const T&amp;amp; val) {
    stringstream ss;
    ss &amp;lt;&amp;lt; val;
    string str = ss.str();
    StringVal string_val(context, str.size());
    memcpy(string_val.ptr, str.c_str(), str.size());
    return string_val;
}

template &amp;lt;&amp;gt;
StringVal ToStringVal&amp;lt;DoubleVal&amp;gt;(FunctionContext* context, const DoubleVal&amp;amp; val) {
    if (val.is_null) return StringVal::null();
    return ToStringVal(context, val.val);
}

 struct t_percent
 {
    int nb;
    std::list&amp;lt;double&amp;gt; *values;
    double percent;
    int64_t count;
 };

 void PercentInit(FunctionContext* context, StringVal* val)
 {
    val-&amp;gt;is_null = false;
    val-&amp;gt;len = sizeof(t_percent);
    val-&amp;gt;ptr = context-&amp;gt;Allocate(val-&amp;gt;len);
    memset(val-&amp;gt;ptr, 0, val-&amp;gt;len);
 }

 void PercentUpdate(FunctionContext* context, const DoubleVal&amp;amp; input,const DoubleVal&amp;amp; percent, StringVal* val)
 {
    if (input.is_null || percent.is_null || val-&amp;gt;is_null) return;

    t_percent* avg = reinterpret_cast&amp;lt;t_percent*&amp;gt;(val-&amp;gt;ptr);
    if (avg-&amp;gt;values == NULL)
        avg-&amp;gt;values = new std::list&amp;lt;double&amp;gt;();
    avg-&amp;gt;nb += 1;
    avg-&amp;gt;percent = percent.val;
    avg-&amp;gt;values-&amp;gt;push_back(input.val);
 }

 void PercentMerge(FunctionContext* context, const StringVal&amp;amp; src, StringVal* dst)
 {
    std::cout &amp;lt;&amp;lt; "Merge\n";
    if (src.is_null || dst-&amp;gt;is_null) return;
    t_percent* src_avg = reinterpret_cast&amp;lt;t_percent*&amp;gt;(src.ptr);
    t_percent* dst_avg = reinterpret_cast&amp;lt;t_percent*&amp;gt;(dst-&amp;gt;ptr);
    if (dst_avg-&amp;gt;values == NULL)
        dst_avg-&amp;gt;values = new std::list&amp;lt;double&amp;gt;();
    dst_avg-&amp;gt;nb += src_avg-&amp;gt;nb;
    for (std::list&amp;lt;double&amp;gt;::iterator it = src_avg-&amp;gt;values-&amp;gt;begin(); it != src_avg-&amp;gt;values-&amp;gt;end(); ++it)
        dst_avg-&amp;gt;values-&amp;gt;push_back(*it);
 }

const StringVal PercentSerialize(FunctionContext* context, const StringVal&amp;amp; val) {
    std::cout &amp;lt;&amp;lt; "Serialize\n";
    if (val.is_null)
        return (StringVal::null());
    StringVal result(context, val.len);
    memcpy(result.ptr, val.ptr, val.len);
    t_percent* avg = reinterpret_cast&amp;lt;t_percent*&amp;gt;(result.ptr);
    t_percent* old = reinterpret_cast&amp;lt;t_percent*&amp;gt;(val.ptr);
    avg-&amp;gt;values = old-&amp;gt;values;
    context-&amp;gt;Free(val.ptr);
    return result;
}

StringVal PercentFinalize(FunctionContext* context, const StringVal&amp;amp; val) {
    std::cout &amp;lt;&amp;lt; "Finalize\n";
    if (val.is_null)
        return (StringVal::null());
    t_percent* avg = reinterpret_cast&amp;lt;t_percent*&amp;gt;(val.ptr);
    if (avg-&amp;gt;values == NULL || avg-&amp;gt;values-&amp;gt;empty())
        return (StringVal::null());
    StringVal result;
    avg-&amp;gt;values-&amp;gt;sort();

    int n = avg-&amp;gt;percent * avg-&amp;gt;nb;
    std::list&amp;lt;double&amp;gt;::iterator it = avg-&amp;gt;values-&amp;gt;begin();
    for (int i = 0; i &amp;lt; n ; ++i)
        ++it;
    std::cout &amp;lt;&amp;lt;  " | n : " &amp;lt;&amp;lt; n &amp;lt;&amp;lt; " | it : " &amp;lt;&amp;lt; *it &amp;lt;&amp;lt; " \n";
    result = ToStringVal(context, *it);
    delete(avg-&amp;gt;values);
    context-&amp;gt;Free(val.ptr);
    return result;
}&lt;/PRE&gt;&lt;P&gt;That is my Test Code :&lt;/P&gt;&lt;PRE&gt;bool TestPercent() {
    UdaTestHarness2&amp;lt;StringVal, StringVal, DoubleVal, DoubleVal&amp;gt; test(
    PercentInit, PercentUpdate, PercentMerge, PercentSerialize, PercentFinalize);

    vector&amp;lt;DoubleVal&amp;gt; input;
    vector&amp;lt;DoubleVal&amp;gt; vpercent;

   for (int i = 0; i &amp;lt; 1001; ++i) {
        input.push_back(DoubleVal(i));
        vpercent.push_back(DoubleVal(0.75));
    }

    if (!test.Execute(input, vpercent, StringVal("750"))) {
        cerr &amp;lt;&amp;lt; "Avg: " &amp;lt;&amp;lt; test.GetErrorMsg() &amp;lt;&amp;lt; endl;
        return false;
    }
    return true;
}

int main(int argc, char** argv) {
bool passed = true;
passed &amp;amp;= TestPercent();
cerr &amp;lt;&amp;lt; (passed ? "Tests passed." : "Tests failed.") &amp;lt;&amp;lt; endl;
return 0;
}&lt;/PRE&gt;&lt;P&gt;That is the result:&lt;/P&gt;&lt;PRE&gt;Finalize
 | n : 750 | it : 750 
Serialize
Merge
Finalize
 | n : 0 | it : 0 
Avg: UDA failed running in one level distributed mode with 1 nodes.
Expected: 750 Actual: 0
Tests failed.&lt;/PRE&gt;&lt;P&gt;We can to see, the good results in my first pass of my finalize function, and i don't understand why the program did not finish at that time.&lt;/P&gt;&lt;P&gt;And also, my code works with UdaExecutionMode == SINGLE_NODE in parameter of execute test function.&lt;/P&gt;&lt;P&gt;If someone can help me in this point, i would appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:26:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/26602#M5586</guid>
      <dc:creator>sanchez</dc:creator>
      <dc:date>2022-09-16T09:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: [UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/26606#M5587</link>
      <description>&lt;P&gt;I find the error, i forget to initialize a struct's variable (percent) in merge function and when i used a SINGLE NODE level, the executions uses only update and finalize methods.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2015 15:27:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/26606#M5587</guid>
      <dc:creator>sanchez</dc:creator>
      <dc:date>2015-04-17T15:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: [UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/28752#M5588</link>
      <description>&lt;P&gt;Could you share your final code since you said that you have found the problem and resolved, thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jun 2015 19:47:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/28752#M5588</guid>
      <dc:creator>Jie.Liang</dc:creator>
      <dc:date>2015-06-19T19:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: [UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29067#M5589</link>
      <description>&lt;P&gt;Ok, no problem, this is the final code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; #include &amp;lt;algorithm&amp;gt;
 #include &amp;lt;list&amp;gt;
 #include &amp;lt;sstream&amp;gt;
 #include &amp;lt;iostream&amp;gt;

 #include &amp;lt;impala_udf/udf.h&amp;gt;
 #include &amp;lt;impala_udf/udf-debug.h&amp;gt;

 using namespace impala_udf;
 using namespace std;

template &amp;lt;typename T&amp;gt;
StringVal ToStringVal(FunctionContext* context, const T&amp;amp; val)
{
    stringstream ss;
    ss &amp;lt;&amp;lt; val;
    string str = ss.str();
    StringVal string_val(context, str.size());
    memcpy(string_val.ptr, str.c_str(), str.size());
    return string_val;
}

template &amp;lt;&amp;gt;
StringVal ToStringVal&amp;lt;DoubleVal&amp;gt;(FunctionContext* context, const DoubleVal&amp;amp; val)
{
    if (val.is_null) return StringVal::null();
    return ToStringVal(context, val.val);
}

 struct t_percent
 {
    int nb;
    std::list&amp;lt;double&amp;gt; *values;
    double percent;
    int64_t count;
 };

 void PercentInit(FunctionContext* context, StringVal* val)
 {
    val-&amp;gt;is_null = false;
    val-&amp;gt;len = sizeof(t_percent);
    val-&amp;gt;ptr = context-&amp;gt;Allocate(val-&amp;gt;len);
    memset(val-&amp;gt;ptr, 0, val-&amp;gt;len);
 }

 void PercentUpdate(FunctionContext* context, const DoubleVal&amp;amp; input,const DoubleVal&amp;amp; percent, StringVal* val)
 {
    if (input.is_null || percent.is_null || val-&amp;gt;is_null) return;

    t_percent* percentile = reinterpret_cast&amp;lt;t_percent*&amp;gt;(val-&amp;gt;ptr);
    if (percentile-&amp;gt;values == NULL)
        percentile-&amp;gt;values = new std::list&amp;lt;double&amp;gt;();
    percentile-&amp;gt;nb += 1;
    percentile-&amp;gt;percent = percent.val;
    percentile-&amp;gt;values-&amp;gt;push_back(input.val);
 }

 void PercentMerge(FunctionContext* context, const StringVal&amp;amp; src, StringVal* dst)
 {
    if (src.is_null || dst-&amp;gt;is_null) return;
    const t_percent* src_percentile = reinterpret_cast&amp;lt;t_percent*&amp;gt;(src.ptr);
    t_percent* dst_percentile = reinterpret_cast&amp;lt;t_percent*&amp;gt;(dst-&amp;gt;ptr);
    if (dst_percentile-&amp;gt;values == NULL)
        dst_percentile-&amp;gt;values = new std::list&amp;lt;double&amp;gt;();
    dst_percentile-&amp;gt;nb += src_percentile-&amp;gt;nb;
    dst_percentile-&amp;gt;percent = src_percentile-&amp;gt;percent;
    dst_percentile-&amp;gt;values-&amp;gt;merge(*src_percentile-&amp;gt;values);
 }

const StringVal PercentSerialize(FunctionContext* context, const StringVal&amp;amp; val)
{
    if (val.is_null)
        return (StringVal::null());
    StringVal result(context, val.len);
    memcpy(result.ptr, val.ptr, val.len);
    context-&amp;gt;Free(val.ptr);
    return result;
}

StringVal PercentFinalize(FunctionContext* context, const StringVal&amp;amp; val)
{
    if (val.is_null)
        return (StringVal::null());
    t_percent* percentile = reinterpret_cast&amp;lt;t_percent*&amp;gt;(val.ptr);
    if (percentile-&amp;gt;values == NULL || percentile-&amp;gt;values-&amp;gt;empty())
        return (StringVal::null());
    StringVal result;
    percentile-&amp;gt;values-&amp;gt;sort();

    int n = percentile-&amp;gt;percent * (percentile-&amp;gt;nb - 1);
    std::list&amp;lt;double&amp;gt;::iterator it = percentile-&amp;gt;values-&amp;gt;begin();
    for (int i = 0; i &amp;lt; n ; ++i)
        ++it;
    result = ToStringVal(context, *it);
    delete(percentile-&amp;gt;values);
    context-&amp;gt;Free(val.ptr);
    return result;
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2015 09:11:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29067#M5589</guid>
      <dc:creator>sanchez</dc:creator>
      <dc:date>2015-06-29T09:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: [UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29171#M5590</link>
      <description>&lt;P&gt;I can run your code in the shell with -test.cc without the a problem, but when I created a function with it in impala, it is not working, only lines I added are:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;87 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; StringVal result;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;88 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; percentile-&amp;gt;values-&amp;gt;sort();&lt;/P&gt;&lt;P&gt;&amp;nbsp;89&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;90 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; &lt;SPAN&gt;"Sorted list:"&lt;/SPAN&gt; &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;91 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;for&lt;/SPAN&gt; (std::list&amp;lt;&lt;SPAN&gt;double&lt;/SPAN&gt;&amp;gt;::iterator it = percentile-&amp;gt;values-&amp;gt;begin(); it != percentile-&amp;gt;values-&amp;gt;end(); it++)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;92 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; *it &amp;lt;&amp;lt; &lt;SPAN&gt;' '&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;93 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::cerr &amp;lt;&amp;lt; &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;\n&lt;/SPAN&gt;&lt;SPAN&gt;===Sorted list:"&lt;/SPAN&gt; &amp;lt;&amp;lt; endl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;94&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;95 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;SPAN&gt;int&lt;/SPAN&gt; n = percentile-&amp;gt;percent * (percentile-&amp;gt;nb - &lt;SPAN&gt;1&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;96 &lt;/SPAN&gt;&amp;nbsp; &amp;nbsp; std::list&amp;lt;&lt;SPAN&gt;double&lt;/SPAN&gt;&amp;gt;::iterator it = percentile-&amp;gt;values-&amp;gt;begin();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;from 90-93, to see if the list sorted correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;impalad.INFO&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;I0701 12:15:43.854324 30959 plan-fragment-executor.cc:190] descriptor table for fragment=7b405b9a021d464a:6b#&lt;/P&gt;&lt;P&gt;# A fatal error has been detected by the Java Runtime Environment:&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;#&amp;nbsp; SIGSEGV (0xb) at pc=0x00007fb42a30ba3c, pid=27281, tid=140411399993088&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# JRE version: Java(TM) SE Runtime Environment (7.0_67-b01) (build 1.7.0_67-b01)&lt;/P&gt;&lt;P&gt;# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode linux-amd64 compressed oops)&lt;/P&gt;&lt;P&gt;# Problematic frame:&lt;/P&gt;&lt;P&gt;# C&amp;nbsp; [libudapctL.27281.0.so+0x3a3c]&amp;nbsp; std::list&amp;lt;double, std::allocator&amp;lt;double&amp;gt; &amp;gt;::merge(std::list&amp;lt;double, std::allocator&amp;lt;double&amp;gt; &amp;gt;&amp;amp;)+0x80&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# An error report file with more information is saved as:&lt;/P&gt;&lt;P&gt;# /var/run/cloudera-scm-agent/process/411-impala-IMPALAD/hs_err_pid27281.log&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;# If you would like to submit a bug report, please visit:&lt;/P&gt;&lt;P&gt;# &amp;nbsp; &lt;A href="http://bugreport.sun.com/bugreport/crash.jsp" target="_blank"&gt;http://bugreport.sun.com/bugreport/crash.jsp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;#&lt;/P&gt;&lt;P&gt;5b38a813715cac&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;imalapd.ERROR&lt;/P&gt;&lt;P&gt;E0701 12:15:45.940914&amp;nbsp; 9620 logging.cc:119] stderr will be logged to this file.&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentUpdate:&lt;/P&gt;&lt;P&gt;call PercentSerialize:&lt;/P&gt;&lt;P&gt;call PercentMerge:&lt;/P&gt;&lt;P&gt;call PercentMerge:&lt;/P&gt;&lt;P&gt;My data set have more the 20 elements, seems like to read up 1/3 then start to serialize it, and merge the result, but error out there. Did you ever had this problem?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Seems like&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2015 19:27:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29171#M5590</guid>
      <dc:creator>Jie.Liang</dc:creator>
      <dc:date>2015-07-01T19:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: [UDA] Impala Operation Problem</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29204#M5591</link>
      <description>&lt;P&gt;This is strange because my example works with many millions of items, now, i had this problem several times, for me the error cause is the bad initialization of a variable but you don't have a new struct variable.&lt;/P&gt;&lt;P&gt;Sorry, i tested my last example and it works,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jul 2015 13:55:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/UDA-Impala-Operation-Problem/m-p/29204#M5591</guid>
      <dc:creator>sanchez</dc:creator>
      <dc:date>2015-07-02T13:55:48Z</dc:date>
    </item>
  </channel>
</rss>

