StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.67k stars 1.75k forks source link

BE crash when trun on enable_filter_unused_columns_in_scan_stage #2521

Closed wangruin closed 2 years ago

wangruin commented 2 years ago

Steps to reproduce the behavior (Required)

  1. set enable_filter_unused_columns_in_scan_stage = true
  2. admin set frontend config("enable_decimal_v3" = "false")
  3. CREATE TABLE aggregate_table_with_null_v2 ( k1 char(20), k2 varchar(20), k3 date, k4 datetime, k5 boolean, v1 tinyint sum, v2 smallint sum, v3 int sum, v4 bigint max, v5 largeint max, v6 float min, v7 double min, v8 decimal(27,9) sum ) ENGINE=OLAP AGGREGATE KEY(k1, k2, k3, k4, k5) COMMENT "OLAP" DISTRIBUTED BY HASH(k1, k2) BUCKETS 3 PROPERTIES ( "replication_num" = "1", "storage_format" = "v2" );
  4. insert some data
  5. select sum(cast(v1 as int)), sum(v2), sum(v3), max(v4), max(v5), min(v6), min(v7), sum(v8) from aggregate_table_with_null_v2 where k3 = '2020-06-23' and k4 <= '2020-06-23 18:11:00';
  6. the query returns 1 row when turn off enable_filter_unused_columns_in_scan_stage

Expected behavior (Required)

1 row

Real behavior (Required)

terminate called after throwing an instance of 'std::bad_variant_access'
  what():  std::get: wrong index for variant
*** Aborted at 1640769340 (unix time) try "date -d @1640769340" if you are using GNU date ***
PC: @     0x7f096e5d9387 __GI_raise
*** SIGABRT (@0x3f700000198) received by PID 408 (TID 0x7f0944faf700) from PID 408; stack trace: ***
    @          0x3432b42 google::(anonymous namespace)::FailureSignalHandler()
    @     0x7f096f2a4630 (unknown)
    @     0x7f096e5d9387 __GI_raise
    @     0x7f096e5daa78 __GI_abort
    @          0x15aeae3 _ZN9__gnu_cxx27__verbose_terminate_handlerEv.cold
    @          0x4de7556 __cxxabiv1::__terminate()
    @          0x4de75c1 std::terminate()
    @          0x4de7715 __cxa_throw
    @          0x1329f25 std::__throw_bad_variant_access()
    @          0x1329f42 std::__throw_bad_variant_access()
    @          0x189359a starrocks::vectorized::DateToDateV2FieldConverter::copy_convert()
    @          0x1891e04 starrocks::vectorized::FieldConverter::move_convert()
    @          0x187e9e9 starrocks::vectorized::ChunkConverter::move_convert()
    @          0x183d37b starrocks::vectorized::SegmentChunkIteratorAdapter::do_get_next()
    @          0x1bf68da starrocks::SegmentIteratorWrapper::do_get_next()
    @          0x18c23f2 starrocks::vectorized::TimedChunkIterator::do_get_next()
    @          0x18c731b starrocks::vectorized::UnionIterator::do_get_next()
    @          0x18c23f2 starrocks::vectorized::TimedChunkIterator::do_get_next()
    @          0x1a14a37 starrocks::vectorized::AggregateIterator::do_get_next()
    @          0x1a15b14 starrocks::vectorized::AggregateIterator::do_get_next()
    @          0x18c23f2 starrocks::vectorized::TimedChunkIterator::do_get_next()
    @          0x18b919e starrocks::vectorized::TabletReader::do_get_next()
    @          0x24951e4 starrocks::vectorized::TabletScanner::get_chunk()
    @          0x21e8965 starrocks::vectorized::OlapScanNode::_scanner_thread()
    @          0x1c20120 starrocks::PriorityThreadPool::work_thread()
    @          0x33da937 thread_proxy
    @     0x7f096f29cea5 start_thread
    @     0x7f096e6a18dd __clone
    @                0x0 (unknown)

StarRocks version (Required)

github-actions[bot] commented 2 years ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!