gaodayue opened a new issue #3520:
URL: https://github.com/apache/incubator-doris/issues/3520


   **Describe the bug**
   When input to hll function is null, BE crashes with the following stack
   
   ```
   *** Aborted at 1588908360 (unix time) try "date -d @1588908360" if you are 
using GNU date ***
   PC: @           0xe16f00 (unknown)
   *** SIGSEGV (@0x0) received by PID 100031 (TID 0x7ff8805a0700) from PID 0; 
stack trace: ***
       @     0x7ff8b1a675d0 (unknown)
       @           0xe16f00 (unknown)
       @           0xdc7578 doris::HllFunctions::hll_merge()
       @          0x14e5a53 doris::NewAggFnEvaluator::Update()
       @          0x1465ab6 doris::NewPartitionedAggregationNode::UpdateTuple()
       @          0x1470cef 
doris::NewPartitionedAggregationNode::ProcessBatch<>()
       @          0x146b404 doris::NewPartitionedAggregationNode::open()
       @          0x1014d7b doris::PlanFragmentExecutor::open_internal()
       @          0x10154a4 doris::PlanFragmentExecutor::open()
       @           0xfa2637 doris::FragmentExecState::execute()
       @           0xfa4286 doris::FragmentMgr::exec_actual()
       @           0xfaa6e4 
boost::detail::function::void_function_obj_invoker0<>::invoke()
       @           0xea8a58 doris::ThreadPool::work_thread()
       @          0x19ca0cd thread_proxy
       @     0x7ff8b1a5fdd5 start_thread
       @     0x7ff8b0e64ead __clone
   ```
   
   **To Reproduce**
   1) create a test table
   ```
   CREATE TABLE `t1` (
     `siteid` int(11) NULL COMMENT "",
     `citycode` smallint(6) NULL COMMENT "",
     `username` varchar(32) NULL COMMENT "",
     `uv` hll HLL_UNION COMMENT "")
   AGGREGATE KEY(`siteid`, `citycode`, `username`)
   DISTRIBUTED BY HASH(`siteid`) BUCKETS 1
   PROPERTIES (
    "replication_num" = "3"
   );
   ```
   2) load some sample data
   ```
   $ cat data.tsv
   1       1       'jim'   2
   2       1       'grace' 2
   3       2       'tom'   2
   4       3       'bush'  3
   5       3       'helen' 3
   $ curl -v --location-trusted -u user:pass -H 
'columns:siteid,citycode,username,x,uv=hll_hash(x)' -T data.tsv -XPUT 
http://localhost:8410/api/test/t1/_stream_load
   ```
   
   3) make a query that could produce null input to hll function
   ```
   mysql> select citycode, hll_union_agg(case when length(username) >= 100 then 
uv end) from t3 group by citycode;
   ```
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to