Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-1808

Analytic function evaluation cannot handle partition/order by exprs with NaN

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.2
    • Fix Version/s: Impala 2.2
    • Component/s: None
    • Labels:
      None

      Description

      Analytic fn evaluation may not be able to handle order by or partition exprs that evaluate to NaN, i.e. 0/0. Infinity values, e.g. 1/0, are fine.

      The issue is that the comparison exprs generated by the FE (in AnalyticPlanner) compare prev/curr rows on the partition and order by exprs, but NaN always compares not equals and the be doesn't handle that correctly.

      In the following query, the partition expr is (id/int_col) which is NaN when id=0 and int_col=0.

      SELECT
      LEAD(-778) OVER (PARTITION BY id / int_col ORDER BY id) 
      FROM alltypestiny
      

      Stack Trace:

      raise () from /lib/x86_64-linux-gnu/libc.so.6
      raise () from /lib/x86_64-linux-gnu/libc.so.6
      abort () from /lib/x86_64-linux-gnu/libc.so.6
      google::DumpStackTraceAndExit () at src/utilities.cc:147
      google::LogMessage::Fail () at src/logging.cc:1315
      google::LogMessage::SendToLog (this=0x7fd1c6f8a1d0) at src/logging.cc:1269
      google::LogMessage::Flush (this=0x7fd1c6f8a1d0) at src/logging.cc:1138
      google::LogMessageFatal::~LogMessageFatal (this=0x7fd1c6f8a1d0, __in_chrg=) at src/logging.cc:1836
      impala::AnalyticEvalNode::InitNextPartition (this=0xcc8f180, stream_idx=0) at /opt/Impala/be/src/exec/analytic-eval-node.cc:424
      impala::AnalyticEvalNode::ProcessChildBatch (this=0xcc8f180, state=0xca44300) at /opt/Impala/be/src/exec/analytic-eval-node.cc:567
      impala::AnalyticEvalNode::ProcessChildBatches (this=0xcc8f180, state=0xca44300) at /opt/Impala/be/src/exec/analytic-eval-node.cc:517
      impala::AnalyticEvalNode::Open (this=0xcc8f180, state=0xca44300) at /opt/Impala/be/src/exec/analytic-eval-node.cc:220
      impala::PlanFragmentExecutor::OpenInternal (this=0xcb6da40) at /opt/Impala/be/src/runtime/plan-fragment-executor.cc:333
      impala::PlanFragmentExecutor::Open (this=0xcb6da40) at /opt/Impala/be/src/runtime/plan-fragment-executor.cc:319
      impala::Coordinator::Wait (this=0xca45100) at /opt/Impala/be/src/runtime/coordinator.cc:765
      impala::ImpalaServer::QueryExecState::WaitInternal (this=0xb416000) at /opt/Impala/be/src/service/query-exec-state.cc:554
      impala::ImpalaServer::QueryExecState::Wait (this=0xb416000) at /opt/Impala/be/src/service/query-exec-state.cc:530
      boost::_mfi::mf0::operator() (this=0x7fd1c6f8adb8, p=0xb416000) at /usr/include/boost/bind/mem_fn_template.hpp:49
      boost::_bi::list1 >::operator(), boost::_bi::list0> (this=0x7fd1c6f8adc8, f=..., a=...) at /usr/include/boost/bind/bind.hpp:253
      boost::_bi::bind_t, boost::_bi::list1 > >::operator() (this=0x7fd1c6f8adb8) at /usr/include/boost/bind/bind_template.hpp:20
      boost::detail::function::void_function_obj_invoker0, boost::_bi::list1 > >, void>::invoke (function_obj_ptr=...) at /usr/include/boost/function/function_template.hpp:153
      boost::function0::operator() (this=0x7fd1c6f8adb0) at /usr/include/boost/function/function_template.hpp:1013
      impala::Thread::SuperviseThread(std::string const&, std::string const&, boost::function, impala::Promise*) (name=..., category=..., functor=..., thread_started=0x7fd1e6fc9ac0) at /opt/Impala/be/src/util/thread.cc:311
      boost::_bi::list4, boost::_bi::value, boost::_bi::value >, boost::_bi::value*> >::operator(), impala::Promise*), boost::_bi::list0>(boost::_bi::type, void (*&)(std::string const&, std::string const&, boost::function, impala::Promise*), boost::_bi::list0&, int) (this=0xbba2370, f=@0xbba2368: 0x11a3a20 , impala::Promise*)>, a=...) at /usr/include/boost/bind/bind.hpp:457
      boost::_bi::bind_t, impala::Promise*), boost::_bi::list4, boost::_bi::value, boost::_bi::value >, boost::_bi::value*> > >::operator()() (this=0xbba2368) at /usr/include/boost/bind/bind_template.hpp:20
      boost::detail::thread_data, impala::Promise*), boost::_bi::list4, boost::_bi::value, boost::_bi::value >, boost::_bi::value*> > > >::run() (this=0xbba21e0) at /usr/include/boost/thread/detail/thread.hpp:61
      thread_proxy () from /usr/lib/libboost_thread.so.1.46.1
      start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
      clone () from /lib/x86_64-linux-gnu/libc.so.6
      ?? ()
      

      DB: Functional

        Attachments

          Activity

            People

            • Assignee:
              mjacobs Matthew Jacobs
              Reporter:
              tarasbob Taras Bobrovytsky
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: