You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/12/16 08:02:05 UTC
[GitHub] [incubator-doris] yuanfeng0905 opened a new issue #2464: 窗口函数嵌套查询报错
yuanfeng0905 opened a new issue #2464: 窗口函数嵌套查询报错
URL: https://github.com/apache/incubator-doris/issues/2464
当执行如下 SQL 语句时,BE 节点会崩溃:
```sql
select date, website_id, sku, frequency,
lag(date, 1, null) over (partition by website_id, sku order by date) da,
lag(frequency,1, null) over (partition by website_id, sku order by date) fre
from dw__tag.ac_product_view where date >= '2019-12-07' and website_id in (12,33)
```
原始表结构为:
```sql
CREATE TABLE `ac_product_view` (
`date` date NOT NULL COMMENT "日期",
`ac_open_id` varchar(512) NOT NULL COMMENT "ac open id",
`website_id` int(11) NOT NULL COMMENT "站点id",
`sku` varchar(512) NOT NULL COMMENT "商户sku",
`frequency` int(11) REPLACE NOT NULL COMMENT "次数"
) ENGINE=OLAP
AGGREGATE KEY(`date`, `ac_open_id`, `website_id`, `sku`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`date`, `ac_open_id`, `website_id`, `sku`) BUCKETS 16
PROPERTIES (
"storage_type" = "COLUMN"
);
```
BE 奔溃时 core dump 截图(gdb bt):
```shell
#0 fixed_size_memory_copy<1> (src=0x19a4d80000000000, dst=0x16165915a) at /root/doris-0.11.25/be/src/util/mem_util.hpp:37
#1 doris::memory_copy (dst=0x16165915a, src=0x19a4d80000000000, size=1) at /root/doris-0.11.25/be/src/util/mem_util.hpp:108
#2 0x000000000103676b in doris::Tuple::deep_copy (this=<optimized out>, desc=..., data=data@entry=0x7f477c399a40, offset=offset@entry=0x7f477c399a3c, convert_ptrs=convert_ptrs@entry=true) at /root/doris-0.11.25/be/src/runtime/tuple.cpp:137
#3 0x0000000001032c35 in doris::RowBatch::serialize (this=this@entry=0x15ac5d340, output_batch=output_batch@entry=0x154476398) at /root/doris-0.11.25/be/src/runtime/row_batch.cpp:402
#4 0x00000000015abd4b in doris::DataStreamSender::serialize_batch<doris::PRowBatch> (this=this@entry=0x154476340, src=src@entry=0x15ac5d340, dest=0x154476398, num_receivers=1) at /root/doris-0.11.25/be/src/runtime/data_stream_sender.cpp:630
#5 0x00000000015aa489 in doris::DataStreamSender::send (this=0x154476340, state=0x1633f1800, batch=0x15ac5d340) at /root/doris-0.11.25/be/src/runtime/data_stream_sender.cpp:450
#6 0x000000000102a3a4 in doris::PlanFragmentExecutor::open_internal (this=this@entry=0x15fb20e30) at /root/doris-0.11.25/be/src/runtime/plan_fragment_executor.cpp:334
#7 0x000000000102a804 in doris::PlanFragmentExecutor::open (this=this@entry=0x15fb20e30) at /root/doris-0.11.25/be/src/runtime/plan_fragment_executor.cpp:284
#8 0x0000000000fb7bb7 in doris::FragmentExecState::execute (this=0x15fb20dc0) at /root/doris-0.11.25/be/src/runtime/fragment_mgr.cpp:209
#9 0x0000000000fb9806 in doris::FragmentMgr::exec_actual(std::shared_ptr<doris::FragmentExecState>, std::function<void (doris::PlanFragmentExecutor*)>) (this=0x56e9c00, exec_state=..., cb=...) at /root/doris-0.11.25/be/src/runtime/fragment_mgr.cpp:388
#10 0x0000000000fbfeb4 in operator() (a2=<error reading variable: access outside bounds of object referenced via synthetic pointer>, a1=..., p=<optimized out>, this=<optimized out>) at /var/local/thirdparty/installed/include/boost/bind/mem_fn_template.hpp:280
#11 operator()<boost::_mfi::mf2<void, doris::FragmentMgr, std::shared_ptr<doris::FragmentExecState>, std::function<void(doris::PlanFragmentExecutor*)> >, boost::_bi::list0> (a=<synthetic pointer>, f=..., this=<optimized out>)
at /var/local/thirdparty/installed/include/boost/bind/bind.hpp:398
#12 operator() (this=<optimized out>) at /var/local/thirdparty/installed/include/boost/bind/bind.hpp:1294
#13 boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf2<void, doris::FragmentMgr, std::shared_ptr<doris::FragmentExecState>, std::function<void (doris::PlanFragmentExecutor*)> >, boost::_bi::list3<boost::_bi::value<doris::FragmentMgr*>, boost::_bi::value<std::shared_ptr<doris::FragmentExecState> >, boost::_bi::value<std::function<void (doris::PlanFragmentExecutor*)> > > >, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...)
at /var/local/thirdparty/installed/include/boost/function/function_template.hpp:159
#14 0x0000000000ec28d8 in operator() (this=0x7f477c399fc0) at /var/local/thirdparty/installed/include/boost/function/function_template.hpp:759
#15 doris::ThreadPool::work_thread (this=0x56e9c80, thread_id=<optimized out>) at /root/doris-0.11.25/be/src/util/thread_pool.hpp:120
#16 0x00000000019f17ed in thread_proxy ()
#17 0x00007f47bb26ddc5 in start_thread () from /lib64/libpthread.so.0
#18 0x00007f47bb57828d in clone () from /lib64/libc.so.6
```
测试发现,当窗口函数 lag 在一个查询中使用两次,任意一个给默认值为 null 不会出现问题,但同时指定默认值为 null 则 BE 奔溃。如上面给出的 SQL 中:
```sql
lag(date, 1, null) , lag(frequency,1, null)
```
这种情况, BE 奔溃退出。
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org