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

Impala crash for avro table when casting to char data type

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Impala 2.3.0
    • Fix Version/s: Impala 2.6.0, Impala 2.3.4
    • Component/s: Backend
    • Labels:
      None

      Description

      Simple query against AVRO table will crash Impala daemon, see test case below:

      1. Create tables from Beeline:

      DROP TABLE IF EXISTS test_avro;
      
      CREATE TABLE `test_avro`(
         `col` string
      )
      
       ROW FORMAT SERDE
         'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
       WITH SERDEPROPERTIES (
         'avro.schema.url'='/tmp/schema.avsc')
       STORED AS INPUTFORMAT
         'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
       OUTPUTFORMAT
         'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
      ;
      

      2. Then copy the sample data to text table:

      hadoop fs -put /tmp/000000_0 /user/hive/warehouse/test_avro
      

      3. Run the following in Impala:

      SELECT * FROM test_avro WHERE CAST(col AS CHAR(20)) = CAST('10001207' AS CHAR(20)) LIMIT 1;
      

      Impala daemon log showed the following:

      I0305 21:35:01.680958  3999 status.cc:114] ScalarFnCall Codegen not supported for CHAR
          @           0xeada99  (unknown)
          @          0x127851f  (unknown)
          @          0x149fa8d  (unknown)
          @          0x14f6662  (unknown)
          @          0x14efcab  (unknown)
          @          0x14bc3f4  (unknown)
          @          0x1468c50  (unknown)
          @          0x10a8d9c  (unknown)
          @          0x109fe2d  (unknown)
          @           0xfe3eb5  (unknown)
          @          0x12d6767  (unknown)
          @          0x12d650c  (unknown)
          @           0xfd0d1a  (unknown)
          @          0x1ed8869  (unknown)
          @           0xf0cfe3  (unknown)
          @           0xf0e8c5  (unknown)
          @           0xf0e71e  (unknown)
          @           0xf0e49b  (unknown)
          @           0xf0e3a9  (unknown)
          @           0xf33ac5  (unknown)
          @          0x1192320  (unknown)
          @          0x119b4bc  (unknown)
          @          0x119b403  (unknown)
          @          0x119b3c2  (unknown)
          @          0x160cd83  (unknown)
          @     0x7ff3d81b4a51  start_thread
          @     0x7ff3d71129ad  clone
      I0305 21:35:01.681010  3999 exec-node.cc:452] Could not codegen EvalConjuncts: ScalarFnCall Codegen not supported for CHAR
      F0305 21:35:01.681026  3999 llvm-codegen.cc:486] Check failed: new_fn != __null
      

      bt output:

      #0  0x00007f64612d9625 in raise () from /lib64/libc.so.6
      #1  0x00007f64612dae05 in abort () from /lib64/libc.so.6
      #2  0x0000000001f37079 in ?? ()
      #3  0x0000000001f2e69d in google::LogMessage::Fail() ()
      #4  0x0000000001f32237 in google::LogMessage::SendToLog() ()
      #5  0x0000000001f30c6a in google::LogMessage::Flush() ()
      #6  0x0000000001f30f3d in google::LogMessageFatal::~LogMessageFatal() ()
      #7  0x0000000000e76da8 in impala::LlvmCodeGen::ReplaceCallSites(llvm::Function*, bool, llvm::Function*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int*) ()
      #8  0x00000000014f66c8 in impala::HdfsAvroScanner::CodegenDecodeAvroData(impala::RuntimeState*, llvm::Function*, std::vector<impala::ExprContext*, std::allocator<impala::ExprContext*> > const&) ()
      #9  0x00000000014efcab in impala::HdfsAvroScanner::Codegen(impala::HdfsScanNode*, std::vector<impala::ExprContext*, std::allocator<impala::ExprContext*> > const&) ()
      #10 0x00000000014bc3f4 in impala::HdfsScanNode::Prepare(impala::RuntimeState*) ()
      #11 0x0000000001468c50 in impala::PlanFragmentExecutor::Prepare(impala::TExecPlanFragmentParams const&) ()
      #12 0x00000000010a8d9c in impala::FragmentMgr::FragmentExecState::Prepare(impala::TExecPlanFragmentParams const&) ()
      #13 0x000000000109fe2d in impala::FragmentMgr::ExecPlanFragment(impala::TExecPlanFragmentParams const&) ()
      #14 0x0000000000fe3eb5 in impala::ImpalaInternalService::ExecPlanFragment(impala::TExecPlanFragmentResult&, impala::TExecPlanFragmentParams const&) ()
      #15 0x00000000012d6767 in impala::ImpalaInternalServiceProcessor::process_ExecPlanFragment(int, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, void*) ()
      #16 0x00000000012d650c in impala::ImpalaInternalServiceProcessor::dispatchCall(apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, void*) ()
      #17 0x0000000000fd0d1a in apache::thrift::TDispatchProcessor::process(boost::shared_ptr<apache::thrift::protocol::TProtocol>, boost::shared_ptr<apache::thrift::protocol::TProtocol>, void*) ()
      #18 0x0000000001ed8869 in apache::thrift::server::TThreadedServer::Task::run() ()
      #19 0x0000000000f0cfe3 in impala::ThriftThread::RunRunnable(boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*) ()
      #20 0x0000000000f0e8c5 in boost::_mfi::mf2<void, impala::ThriftThread, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*>::operator()(impala::ThriftThread*, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*) const ()
      #21 0x0000000000f0e71e in void boost::_bi::list3<boost::_bi::value<impala::ThriftThread*>, boost::_bi::value<boost::shared_ptr<apache::thrift::concurrency::Runnable> >, boost::_bi::value<impala::Promise<unsigned long>*> >::operator()<boost::_mfi::mf2<void, impala::ThriftThread, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf2<void, impala::ThriftThread, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*>&, boost::_bi::list0&, int) ()
      #22 0x0000000000f0e49b in boost::_bi::bind_t<void, boost::_mfi::mf2<void, impala::ThriftThread, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*>, boost::_bi::list3<boost::_bi::value<impala::ThriftThread*>, boost::_bi::value<boost::shared_ptr<apache::thrift::concurrency::Runnable> >, boost::_bi::value<impala::Promise<unsigned long>*> > >::operator()() ()
      #23 0x0000000000f0e3a9 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf2<void, impala::ThriftThread, boost::shared_ptr<apache::thrift::concurrency::Runnable>, impala::Promise<unsigned long>*>, boost::_bi::list3<boost::_bi::value<impala::ThriftThread*>, boost::_bi::value<boost::shared_ptr<apache::thrift::concurrency::Runnable> >, boost::_bi::value<impala::Promise<unsigned long>*> > >, void>::invoke(boost::detail::function::function_buffer&) ()
      #24 0x0000000000f33ac5 in boost::function0<void>::operator()() const ()
      #25 0x0000000001192320 in impala::Thread::SuperviseThread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*) ()
      #26 0x000000000119b4bc in void boost::_bi::list4<boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<boost::function<void ()()> >, boost::_bi::value<impala::Promise<long>*> >::operator()<void (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*), boost::_bi::list0>(boost::_bi::type<void>, void (*&)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*), boost::_bi::list0&, int) ()
      #27 0x000000000119b403 in boost::_bi::bind_t<void, void (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*), boost::_bi::list4<boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<boost::function<void ()()> >, boost::_bi::value<impala::Promise<long>*> > >::operator()() ()
      #28 0x000000000119b3c2 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*), boost::_bi::list4<boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<boost::function<void ()()> >, boost::_bi::value<impala::Promise<long>*> > > >::run() ()
      #29 0x000000000160cd83 in ?? ()
      #30 0x00007f6462431a51 in start_thread () from /lib64/libpthread.so.0
      #31 0x00007f646138f9ad in clone () from /lib64/libc.so.6
      

        Attachments

        1. 000000_0
          980 kB
          Eric Lin
        2. schema.avsc
          0.4 kB
          Eric Lin

          Issue Links

            Activity

              People

              • Assignee:
                anujphadke Anuj Phadke
                Reporter:
                ericlin Eric Lin
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: