Skip to content

Tmp mtmv multi pct tables - #2

Merged
seawinde merged 84 commits into
gzmf_pr_based_masterfrom
tmp_mtmv_multi_pct_tables
Oct 24, 2025
Merged

seawinde merged 84 commits into
gzmf_pr_based_masterfrom
tmp_mtmv_multi_pct_tables

Conversation

@seawinde

Copy link
Copy Markdown
Owner

Proposed changes

Issue Number: close #xxx

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

seawinde pushed a commit that referenced this pull request Mar 24, 2026
… exit (apache#61040)

### What problem does this PR solve?

The SyncPoint singleton was being destroyed during program exit while
background bthread timers were still accessing it, causing
heap-use-after-free.

Changed get_instance() to return a never-destructed heap-allocated
pointer
instead of a stack-allocated static object to prevent destruction order
issues.

This is a standard pattern for singletons accessed by background
threads.

```
11:47:40       #0 0x5582a963153d in operator new(unsigned long) (/root/doris/cloud/ut_build_ASAN/test/recycler_test+0x122b53d) (BuildId: 1191affa24589f52)
11:47:40       #1 0x5582ab0aa52f in doris::SyncPoint::SyncPoint() /root/doris/common/cpp/sync_point.cpp:77:9
11:47:40       #2 0x5582ab0aa46b in doris::SyncPoint::get_instance() /root/doris/common/cpp/sync_point.cpp:73:20
11:47:40       #3 0x5582aae33ee8 in doris::cloud::memkv::Transaction::get(std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>, std::unique_ptr<doris::cloud::RangeGetIterator, std::default_delete<doris::cloud::RangeGetIterator>>*, bool, int) /root/doris/cloud/src/meta-store/mem_txn_kv.cpp:276:5
11:47:40       apache#4 0x5582a968f49f in doris::cloud::txn_get(doris::cloud::TxnKv*, std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>, std::unique_ptr<doris::cloud::RangeGetIterator, std::default_delete<doris::cloud::RangeGetIterator>>&) /root/doris/cloud/src/recycler/recycler.cpp:99:18
11:47:40       apache#5 0x5582a9657090 in doris::cloud::InstanceRecycler::scan_and_recycle(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::basic_string_view<char, std::char_traits<char>>, std::function<int (std::basic_string_view<char, std::char_traits<char>>, std::basic_string_view<char, std::char_traits<char>>)>, std::function<int ()>) /root/doris/cloud/src/recycler/recycler.cpp:2976:23
11:47:40       apache#6 0x5582a9686153 in doris::cloud::InstanceRecycler::recycle_rowsets() /root/doris/cloud/src/recycler/recycler.cpp:2587:15
11:47:40       apache#7 0x5582a96a8d47 in doris::cloud::RecyclerTest_recycle_empty_Test::TestBody() /root/doris/cloud/test/recycler_test.cpp:1136:5
```
seawinde pushed a commit that referenced this pull request Mar 24, 2026
…free. (apache#61138)

### What problem does this PR solve?
Related PR: apache/doris-thirdparty#383

Problem Summary:
fix coredump:
```
#0 0x5561f1d46f12 in operator delete(void*, unsigned long) (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x50ae4f12)
    #1 0x55622c94b454 in std::__new_allocator<std::shared_ptr<orc::ExpressionTree>>::deallocate(std::shared_ptr<orc::ExpressionTree>*, unsigned long) (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x8b6e9454)
    #2 0x55622c94b41e in std::_Deque_base<std::shared_ptr<orc::ExpressionTree>, std::allocator<std::shared_ptr<orc::ExpressionTree>>>::_M_deallocate_node(std::shared_ptr<orc::ExpressionTree>*) (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x8b6e941e)
    #3 0x55622c950681 in std::deque<std::shared_ptr<orc::ExpressionTree>, std::allocator<std::shared_ptr<orc::ExpressionTree>>>::_M_pop_front_aux() (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x8b6ee681)
    apache#4 0x55622c94868e in std::deque<std::shared_ptr<orc::ExpressionTree>, std::allocator<std::shared_ptr<orc::ExpressionTree>>>::pop_front() (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x8b6e668e)
    apache#5 0x55622c947d79 in orc::rewriteLeaves(std::shared_ptr<orc::ExpressionTree>, unsigned long*) SearchArgument.cc
    apache#6 0x55622c947809 in orc::SearchArgumentBuilderImpl::build() (/mnt/disk2/tengjianping/doris-master/output/be/lib/doris_be+0x8b6e5809)
    apache#7 0x5562195209a6 in doris::vectorized::OrcReader::_init_search_argument(std::vector<std::shared_ptr<doris::vectorized::VExpr>, std::allocator<std::shared_ptr<doris::vectorized::VExpr>>> const&) /mnt/disk2/tengjianping/doris-master/be/src/vec/exec/format/orc/vorc_reader.cpp:1072:27
    apache#8 0x556219527175 in doris::vectorized::OrcReader::set_fill_columns(std::unordered_map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, doris::SlotDescriptor const*>, std::hash<std::__cxx11::basic_string<char, 
```
seawinde pushed a commit that referenced this pull request Mar 24, 2026
```
==1472432==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bc7535fba50 at pc 0x557ec5178739 bp 0x7b1743746d40 sp 0x7b1743746500
WRITE of size 104 at 0x7bc7535fba50 thread T2
    #0 0x557ec5178738 in memset ~/workspace/llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc:87:3
    #1 0x7f17566e64fc in fdb_transaction_set_option (libfdb_c.so+0xc014fc) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    #2 0x7f17566e2e47 in fdb_transaction_set_option (libfdb_c.so+0xbfde47) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    #3 0x7f17566e4ec5 in fdb_transaction_set_option (libfdb_c.so+0xbffec5) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    apache#4 0x7f17564f80ee in fdb_transaction_set_option (libfdb_c.so+0xa130ee) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    apache#5 0x7f1755e55b71 in fdb_transaction_set_option (libfdb_c.so+0x370b71) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    apache#6 0x7f1755e2b2e9 in fdb_run_network (libfdb_c.so+0x3462e9) (BuildId: 854ec989d11d3c183aa4963a6d758cfc2b571b07)
    apache#7 0x557ec6595a2b in doris::cloud::fdb::Network::init()::::operator()() const ~/workspace/doris/cloud/ut_build_ASAN/../src/meta-store/txn_kv.cpp:468:28
    apache#8 0x557ec65958e6 in void std::__invoke_impl<void, doris::cloud::fdb::Network::init()::>(std::__invoke_other, doris::cloud::fdb::Network::init()::&&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
    apache#9 0x557ec6595886 in std::__invoke_result<doris::cloud::fdb::Network::init()::>::type std::__invoke<doris::cloud::fdb::Network::init()::>(doris::cloud::fdb::Network::init()::&&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:96:14
    apache#10 0x557ec659584e in void std::thread::_Invoker<std::tuple<doris::cloud::fdb::Network::init()::>>::_M_invoke<0ul>(std::_Index_tuple<0ul>) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:292:13
    apache#11 0x557ec6595816 in std::thread::_Invoker<std::tuple<doris::cloud::fdb::Network::init()::>>::operator()() /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:299:11
    apache#12 0x557ec659571a in std::thread::_State_impl<std::thread::_Invoker<std::tuple<doris::cloud::fdb::Network::init()::>>>::_M_run() /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_thread.h:244:13
    apache#13 0x557ec7756e43 in execute_native_thread_routine InstrProfilingUtil.c
    apache#14 0x557ec50b1a07 in asan_thread_start(void*) ~/workspace/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:239:43
    apache#15 0x7f17545caaa3 in start_thread nptl/pthread_create.c:447:8
    apache#16 0x7f1754657a63 in clone misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
```
seawinde added a commit that referenced this pull request Apr 9, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Apr 10, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Apr 13, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Apr 15, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Apr 16, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde pushed a commit that referenced this pull request Apr 20, 2026
### What problem does this PR solve?
Fix memory corruption in PredicateColumnType::insert_duplicate_fields
for string types
Fixed a bug in the pointer arithmetic when inserting duplicate string
values. The original code used dst += i * str.size() which incorrectly
multiplied by the loop index, causing:
  - Iteration 0: no advance (correct by accident)
  - Iteration 1: advance by 1×size (correct)
- Iteration 2: advance by 2×size (wrong - overwrites beyond allocated
memory)

This resulted in memory corruption and incorrect string data when
inserting more than 2 duplicates.

The fix changes to dst += str.size() to correctly advance the pointer by
one string length per iteration.

  Added unit tests covering:
  - String type with multiple duplicate insertions
  - Integer type duplicates
  - LargeInt (Int128) type duplicates

Introduced by apache#60530

==13605==ERROR: AddressSanitizer: use-after-poison on address
0x7d639d26bc30 at pc 0x55e8b71df91e bp 0x7b4e8fc1e510 sp 0x7b4e8fc1dcd0
WRITE of size 6 at 0x7d639d26bc30 thread T620 (ls_normal [work)
#0 0x55e8b71df91d in __asan_memcpy
(/mnt/hdd01/PERFORMANCE_ENV/be/lib/doris_be+0x2205791d)
#1 0x55e8cce8b1ab in
doris::PredicateColumnType<(doris::PrimitiveType)23>::insert_duplicate_fields(doris::Field
const&, unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/column/predicate_column.h:327:17
#2 0x55e8b7db4e83 in
doris::ColumnNullable::insert_duplicate_fields(doris::Field const&,
unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/column/column_nullable.cpp:357:29
#3 0x55e8ccf8ba2c in
doris::segment_v2::DefaultValueColumnIterator::_insert_many_default(doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&,
unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.cpp:2167:14
apache#4 0x55e8ccf3c705 in
doris::segment_v2::DefaultValueColumnIterator::next_batch(unsigned
long*, doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&, bool*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.cpp:2152:5
apache#5 0x55e8cd4f9313 in
doris::segment_v2::ColumnIterator::next_batch(unsigned long*,
doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.h:330:16
apache#6 0x55e8cd4f9313 in
doris::segment_v2::SegmentIterator::_read_columns_by_index(unsigned int,
unsigned short&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2291:13
apache#7 0x55e8cd50621b in
doris::segment_v2::SegmentIterator::_next_batch_internal(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2643:5
apache#8 0x55e8cd4a0b82 in
doris::segment_v2::SegmentIterator::next_batch(doris::Block*)::$_0::operator()()
const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2519:9
apache#9 0x55e8cd4a0b82 in
doris::segment_v2::SegmentIterator::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2518:19
apache#10 0x55e8cd37cca1 in
doris::segment_v2::LazyInitSegmentIterator::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/lazy_init_segment_iterator.h:46:33
apache#11 0x55e8cccc0b05 in doris::Status
doris::BetaRowsetReader::_next_batch<doris::Block>(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/rowset/beta_rowset_reader.h:113:35
apache#12 0x55e8ccc98668 in doris::BetaRowsetReader::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/rowset/beta_rowset_reader.h:56:55
apache#13 0x55e8ca62ee8f in
doris::VCollectIterator::Level0Iterator::_refresh()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.h
apache#14 0x55e8ca611036 in
doris::VCollectIterator::Level0Iterator::refresh_current_row()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:523:24
apache#15 0x55e8ca601a08 in
doris::VCollectIterator::Level0Iterator::ensure_first_row_ref()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:496:14
apache#16 0x55e8ca604ea2 in
doris::VCollectIterator::Level1Iterator::ensure_first_row_ref()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:713:27
apache#17 0x55e8ca608b20 in
doris::VCollectIterator::build_heap(std::vector<std::shared_ptr<doris::RowsetReader>,
std::allocator<std::shared_ptr<doris::RowsetReader>>>&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:189:9
apache#18 0x55e8ca5dc1ae in
doris::BlockReader::_init_collect_iter(doris::TabletReader::ReaderParams
const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/block_reader.cpp:152:9
apache#19 0x55e8ca5d7b9d in
doris::BlockReader::init(doris::TabletReader::ReaderParams const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/block_reader.cpp:226:19
apache#20 0x55e8d02df6d6 in
doris::OlapScanner::_open_impl(doris::RuntimeState*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/olap_scanner.cpp:317:32
apache#21 0x55e8d02cd697 in doris::Scanner::open(doris::RuntimeState*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner.h:80:16
apache#22 0x55e8d02b576a in
doris::ScannerScheduler::_scanner_scan(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:185:5
apache#23 0x55e8d02bf603 in
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()::operator()() const::'lambda'()::operator()() const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:75:17
apache#24 0x55e8d02bf603 in
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()::operator()() const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:74:27
apache#25 0x55e8d02bf603 in bool std::__invoke_impl<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>(std::__invoke_other,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:63:14
apache#26 0x55e8d02bf603 in std::enable_if<is_invocable_r_v<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>, bool>::type std::__invoke_r<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>(doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:116:9
apache#27 0x55e8d02bf603 in std::_Function_handler<bool (),
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()>::_M_invoke(std::_Any_data const&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:292:9
apache#28 0x55e8d02bed85 in std::function<bool ()>::operator()() const
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:593:9
apache#29 0x55e8d02bed85 in
doris::ScannerSplitRunner::process_for(std::chrono::duration<long,
std::ratio<1l, 1000000000l>>)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:425:25
apache#30 0x55e8d02aa844 in doris::PrioritizedSplitRunner::process()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/prioritized_split_runner.cpp:102:35
apache#31 0x55e8d0272674 in doris::TimeSharingTaskExecutor::_dispatch_thread()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:556:77
apache#32 0x55e8d3fa8ad1 in std::function<void ()>::operator()() const
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:593:9
apache#33 0x55e8d3fa8ad1 in doris::Thread::supervise_thread(void*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/util/thread.cpp:460:5
apache#34 0x55e8b71ddd26 in asan_thread_start(void*)
(/mnt/hdd01/PERFORMANCE_ENV/be/lib/doris_be+0x22055d26)
    apache#35 0x7f539b835ac2 in start_thread nptl/pthread_create.c:442:8
apache#36 0x7f539b8c78cf misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

0x7d639d26bc30 is located 816 bytes inside of 4096-byte region
[0x7d639d26b900,0x7d639d26c900)
allocated by thread T620 (ls_normal [work) here:
#0 0x55e8b71e1b34 in malloc
(/mnt/hdd01/PERFORMANCE_ENV/be/lib/doris_be+0x22059b34)
#1 0x55e8b78d2140 in doris::DefaultMemoryAllocator::malloc(unsigned
long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/allocator.h:90:55
#2 0x55e8b78d2140 in doris::Allocator<false, false, false,
doris::DefaultMemoryAllocator, true>::alloc(unsigned long, unsigned
long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/allocator.cpp:337:23
#3 0x55e8b7ccdfaf in doris::Arena::Chunk::Chunk(unsigned long,
doris::Arena::Chunk*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/arena.h:59:63
apache#4 0x55e8b7ccdad9 in doris::Arena::_init_head_if_needed()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/arena.h:131:24
apache#5 0x55e8b7ccd758 in doris::Arena::alloc(unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/arena.h:148:9
apache#6 0x55e8cce8b118 in
doris::PredicateColumnType<(doris::PrimitiveType)23>::insert_duplicate_fields(doris::Field
const&, unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/column/predicate_column.h:325:32
apache#7 0x55e8b7db4e83 in
doris::ColumnNullable::insert_duplicate_fields(doris::Field const&,
unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/core/column/column_nullable.cpp:357:29
apache#8 0x55e8ccf8ba2c in
doris::segment_v2::DefaultValueColumnIterator::_insert_many_default(doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&,
unsigned long)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.cpp:2167:14
apache#9 0x55e8ccf3c705 in
doris::segment_v2::DefaultValueColumnIterator::next_batch(unsigned
long*, doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&, bool*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.cpp:2152:5
apache#10 0x55e8cd4f9313 in
doris::segment_v2::ColumnIterator::next_batch(unsigned long*,
doris::COW<doris::IColumn>::mutable_ptr<doris::IColumn>&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/column_reader.h:330:16
apache#11 0x55e8cd4f9313 in
doris::segment_v2::SegmentIterator::_read_columns_by_index(unsigned int,
unsigned short&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2291:13
apache#12 0x55e8cd50621b in
doris::segment_v2::SegmentIterator::_next_batch_internal(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2643:5
apache#13 0x55e8cd4a0b82 in
doris::segment_v2::SegmentIterator::next_batch(doris::Block*)::$_0::operator()()
const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2519:9
apache#14 0x55e8cd4a0b82 in
doris::segment_v2::SegmentIterator::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/segment_iterator.cpp:2518:19
apache#15 0x55e8cd37cca1 in
doris::segment_v2::LazyInitSegmentIterator::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/segment/lazy_init_segment_iterator.h:46:33
apache#16 0x55e8cccc0b05 in doris::Status
doris::BetaRowsetReader::_next_batch<doris::Block>(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/rowset/beta_rowset_reader.h:113:35
apache#17 0x55e8ccc98668 in doris::BetaRowsetReader::next_batch(doris::Block*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/rowset/beta_rowset_reader.h:56:55
apache#18 0x55e8ca62ee8f in
doris::VCollectIterator::Level0Iterator::_refresh()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.h
apache#19 0x55e8ca611036 in
doris::VCollectIterator::Level0Iterator::refresh_current_row()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:523:24
apache#20 0x55e8ca601a08 in
doris::VCollectIterator::Level0Iterator::ensure_first_row_ref()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:496:14
apache#21 0x55e8ca604ea2 in
doris::VCollectIterator::Level1Iterator::ensure_first_row_ref()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:713:27
apache#22 0x55e8ca608b20 in
doris::VCollectIterator::build_heap(std::vector<std::shared_ptr<doris::RowsetReader>,
std::allocator<std::shared_ptr<doris::RowsetReader>>>&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/vcollect_iterator.cpp:189:9
apache#23 0x55e8ca5dc1ae in
doris::BlockReader::_init_collect_iter(doris::TabletReader::ReaderParams
const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/block_reader.cpp:152:9
apache#24 0x55e8ca5d7b9d in
doris::BlockReader::init(doris::TabletReader::ReaderParams const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/storage/iterator/block_reader.cpp:226:19
apache#25 0x55e8d02df6d6 in
doris::OlapScanner::_open_impl(doris::RuntimeState*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/olap_scanner.cpp:317:32
apache#26 0x55e8d02cd697 in doris::Scanner::open(doris::RuntimeState*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner.h:80:16
apache#27 0x55e8d02b576a in
doris::ScannerScheduler::_scanner_scan(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:185:5
apache#28 0x55e8d02bf603 in
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()::operator()() const::'lambda'()::operator()() const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:75:17
apache#29 0x55e8d02bf603 in
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()::operator()() const
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:74:27
apache#30 0x55e8d02bf603 in bool std::__invoke_impl<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>(std::__invoke_other,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:63:14
apache#31 0x55e8d02bf603 in std::enable_if<is_invocable_r_v<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>, bool>::type std::__invoke_r<bool,
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()&>(doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/invoke.h:116:9
apache#32 0x55e8d02bf603 in std::_Function_handler<bool (),
doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>,
std::shared_ptr<doris::ScanTask>)::$_0::operator()()
const::'lambda'()>::_M_invoke(std::_Any_data const&)
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:292:9
apache#33 0x55e8d02bed85 in std::function<bool ()>::operator()() const
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:593:9
apache#34 0x55e8d02bed85 in
doris::ScannerSplitRunner::process_for(std::chrono::duration<long,
std::ratio<1l, 1000000000l>>)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.cpp:425:25
apache#35 0x55e8d02aa844 in doris::PrioritizedSplitRunner::process()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/prioritized_split_runner.cpp:102:35
apache#36 0x55e8d0272674 in doris::TimeSharingTaskExecutor::_dispatch_thread()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:556:77
apache#37 0x55e8d3fa8ad1 in std::function<void ()>::operator()() const
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:593:9
apache#38 0x55e8d3fa8ad1 in doris::Thread::supervise_thread(void*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/util/thread.cpp:460:5

Thread T620 (ls_normal [work) created by T0 here:
#0 0x55e8b71c5e91 in pthread_create
(/mnt/hdd01/PERFORMANCE_ENV/be/lib/doris_be+0x2203de91)
#1 0x55e8d3fa7b8a in
doris::Thread::start_thread(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char>> const&,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>> const&, std::function<void ()> const&,
std::shared_ptr<doris::Thread>*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/util/thread.cpp:412:15
#2 0x55e8d02849fd in doris::Status doris::Thread::create<void
(doris::TimeSharingTaskExecutor::*)(),
doris::TimeSharingTaskExecutor*>(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char>> const&,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>> const&, void (doris::TimeSharingTaskExecutor::*
const&)(), doris::TimeSharingTaskExecutor* const&,
std::shared_ptr<doris::Thread>*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/util/thread.h:47:16
#3 0x55e8d026e6b3 in doris::TimeSharingTaskExecutor::_create_thread()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:671:12
apache#4 0x55e8d026b628 in
doris::TimeSharingTaskExecutor::_try_create_thread(int,
std::lock_guard<std::mutex>&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:360:25
apache#5 0x55e8d026967a in doris::TimeSharingTaskExecutor::init()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:221:27
apache#6 0x55e8d025a85a in
doris::TaskExecutorSimplifiedScanScheduler::start(int, int, int, int)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/exec/scan/scanner_scheduler.h:288:9
apache#7 0x55e8d368d649 in
doris::WorkloadGroup::upsert_thread_pool_no_lock(doris::WorkloadGroupInfo*,
std::shared_ptr<doris::CgroupCpuCtl>)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/workload_group/workload_group.cpp:571:38
apache#8 0x55e8d368f14d in
doris::WorkloadGroup::upsert_task_scheduler(doris::WorkloadGroupInfo*)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/workload_group/workload_group.cpp:667:12
apache#9 0x55e8d36bd223 in doris::WorkloadGroupMgr::create_internal_wg()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/workload_group/workload_group_manager.cpp:900:5
apache#10 0x55e8d32bbd3d in doris::ExecEnv::_create_internal_workload_group()
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/exec_env_init.cpp:475:5
apache#11 0x55e8d32b27fc in
doris::ExecEnv::_init(std::vector<doris::StorePath,
std::allocator<doris::StorePath>> const&, std::vector<doris::StorePath,
std::allocator<doris::StorePath>> const&,
std::set<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>, std::less<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char>>>,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>>> const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/exec_env_init.cpp:424:5
apache#12 0x55e8d32ad7ec in doris::ExecEnv::init(doris::ExecEnv*,
std::vector<doris::StorePath, std::allocator<doris::StorePath>> const&,
std::vector<doris::StorePath, std::allocator<doris::StorePath>> const&,
std::set<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>, std::less<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char>>>,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>>> const&)
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/runtime/exec_env_init.cpp:199:17
apache#13 0x55e8b722cc8b in main
/mnt/disk3/pipeline/repo/selectdb-core_master/selectdb-core/be/src/service/doris_main.cpp:531:14
apache#14 0x7f539b7cad8f in __libc_start_call_main
csu/../sysdeps/nptl/libc_start_call_main.h:58:16

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
seawinde added a commit that referenced this pull request Apr 20, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request May 13, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request May 15, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

### What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

### Release note

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

### Check List (For Author)

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jun 1, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jun 8, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jun 15, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jun 22, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde pushed a commit that referenced this pull request Jul 4, 2026
### What problem does this PR solve?


`ColumnNullable::update_crc32c_batch()` normalized nullable fixed-width
nested columns by mutating and replacing `_nested_column` in a logically
const hash path. If another path reads the same nullable column at the
same time, it can keep reading the old nested column or its raw data
after the hash path releases it.

Root cause: the CRC32C nullable hash path used mutable source-column
access to replace NULL payloads with nested default values before
hashing. That preserved hash semantics, but it violated the expectation
that `update_crc32c_batch()` only reads the source column.

A focused BEUT can reproduce the problem before this fix:

```text
==2227142==ERROR: AddressSanitizer: heap-use-after-free
READ of size 4
    #0 doris::ColumnVector<(doris::PrimitiveType)5>::insert_indices_from(...)
       be/ut_build_ASAN/../src/core/column/column_vector.cpp:369:21
    #1 doris::ColumnVector<(doris::PrimitiveType)5>::insert_indices_from(...)
       be/ut_build_ASAN/../src/core/column/column_vector.cpp:373:5
    #2 doris::ColumnNullable::insert_indices_from(...)
       be/ut_build_ASAN/../src/core/column/column_nullable.cpp:378:25

freed by thread T18 here:
    apache#12 doris::ColumnNullable::update_crc32c_batch(unsigned int*, unsigned char const*) const
        be/ut_build_ASAN/../src/core/column/column_nullable.cpp:194:86

SUMMARY: AddressSanitizer: heap-use-after-free
```

This PR keeps the nullable CRC32C hash result unchanged without mutating
the source nested column. For replaceable fixed-width nested columns,
NULL rows are hashed as the nested type's default payload through
`update_crc32c_batch_default_on_null()`, avoiding both source mutation
and per-block cloned-column materialization.

A similar mutable-source issue exists in
`ColumnNullable::filter_by_selector()`: the selector API is currently
non-const even though it conceptually reads the source column and writes
only to the destination column. That path is intentionally left
unchanged in this PR and will be handled separately, because fixing it
cleanly requires changing the older selector API contract and
dictionary-column scratch-buffer behavior.



### Release note

None
seawinde added a commit that referenced this pull request Jul 4, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jul 6, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde pushed a commit that referenced this pull request Jul 9, 2026
Issue Number: None

Related PR: None

Problem Summary: 
UBSAN/ASAN reported a heap-use-after-free during BE shutdown in
TimeSharingTaskExecutor destruction. The scan executor owned pending
split runners, while the split runner function held ScannerContext, and
ScannerContext cleaned up its task by copying the executor shared_ptr
back from the scheduler. When the scheduler was already destroying that
shared_ptr, copying the same shared_ptr member could re-enter the
executor destruction path and release members such as MetricEntity
twice. Keep ScannerContext cleanup tied to a weak reference of the
executor captured when the task is created, and avoid capturing the
scheduler this pointer in split cleanup lambdas.

旧代码的链路大致是:

1. TaskExecutorSimplifiedScanScheduler 析构,成员 _task_executor 是最后阶段要销毁的
std::shared_ptr<TaskExecutor>。
2. 这个 shared_ptr 引用计数降到 0,于是开始执行
TimeSharingTaskExecutor::~TimeSharingTaskExecutor()。
  3. TimeSharingTaskExecutor 析构时会释放它持有的 split/task 容器。
4. split 里有 ScannerSplitRunner,它的 std::function 捕获了
std::shared_ptr<ScannerContext>。
5. 释放 split 会释放这个 captured ScannerContext,于是进入
ScannerContext::~ScannerContext()。
  6. 旧代码在 ScannerContext::~ScannerContext() 里又执行:

  task_executor_scheduler->task_executor()->remove_task(_task_handle)

  而 task_executor() 返回的是:

std::shared_ptr<TaskExecutor> task_executor() const { return
_task_executor; }

  也就是从 scheduler 的 _task_executor 成员再复制一个 shared_ptr。

问题在于:第 1 步里,scheduler 的 _task_executor 这个 shared_ptr 正在析构,并且它已经触发了
TimeSharingTaskExecutor 的析构。此时再从同一个 member
shared_ptr 复制引用,等价于在其析构过程中重新操作它的 control block。这个 control block 可能已经处于
release-last-use 路径,随后临时复制出来的
shared_ptr 析构又会再次 release 同一个 control block,导致 TimeSharingTaskExecutor
析构链被重入或二次释放其成员。

```
/usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11: runtime error: member call on address 0x7c63e14891c0 which does not point to an object of type 'std::_Sp_counted_base<>'
0x7c63e14891c0: note: object has invalid vptr
 00 00 00 00 e0 74 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 be be be be d0 26 2b e1
              ^~~~~~~~~~~~~~~~~~~~~~~
              invalid vptr
    #0 0x55e77069caee in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    #1 0x55e77069caee in std::__shared_ptr<doris::MetricEntity, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    #2 0x55e77069caee in doris::TimeSharingTaskExecutor::~TimeSharingTaskExecutor() be/build_ASAN/./be/build_ASAN/../src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:306:1
    #3 0x55e75b584397 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:174:2
    apache#4 0x55e7706486ac in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    apache#5 0x55e7706486ac in std::__shared_ptr<doris::TaskExecutor, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    apache#6 0x55e7706486ac in doris::ScannerContext::~ScannerContext() be/build_ASAN/./be/build_ASAN/../src/exec/scan/scanner_context.cpp:277:13
    apache#7 0x55e75b584397 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:174:2
    apache#8 0x55e7706f288d in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    apache#9 0x55e7706f288d in std::__shared_ptr<doris::ScannerContext, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    apache#10 0x55e7706f288d in doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>, std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()::~() be/build_ASAN/./be/build_ASAN/../src/exec/scan/scanner_scheduler.cpp:77:26
    apache#11 0x55e7706f39bb in std::_Function_base::_Base_manager<doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>, std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()>::_M_destroy(std::_Any_data&, std::integral_constant<bool, false>) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:177:4
    apache#12 0x55e7706f39bb in std::_Function_base::_Base_manager<doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>, std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:205:8
    apache#13 0x55e7706f39bb in std::_Function_handler<bool (), doris::ScannerScheduler::submit(std::shared_ptr<doris::ScannerContext>, std::shared_ptr<doris::ScanTask>)::$_0::operator()() const::'lambda'()>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:284:6
    apache#14 0x55e770702246 in std::_Function_base::~_Function_base() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:246:2
    apache#15 0x55e770702246 in doris::ScannerSplitRunner::~ScannerSplitRunner() be/build_ASAN/../src/exec/scan/scanner_scheduler.h:62:7
    apache#16 0x55e75b584397 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:174:2
    apache#17 0x55e7706e11e9 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    apache#18 0x55e7706e11e9 in std::__shared_ptr<doris::SplitRunner, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    apache#19 0x55e7706e11e9 in doris::PrioritizedSplitRunner::~PrioritizedSplitRunner() be/build_ASAN/../src/exec/scan/task_executor/time_sharing/prioritized_split_runner.h:54:47
    apache#20 0x55e75b584397 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release_last_use() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:174:2
    apache#21 0x55e7706b8ba4 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    apache#22 0x55e7706b8ba4 in std::__shared_ptr<doris::PrioritizedSplitRunner, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    apache#23 0x55e7706b8ba4 in void std::destroy_at<std::shared_ptr<doris::PrioritizedSplitRunner> >(std::shared_ptr<doris::PrioritizedSplitRunner>*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/stl_construct.h:88:15
    apache#24 0x55e7706b8ba4 in void std::allocator_traits<std::allocator<std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false> > >::destroy<std::shared_ptr<doris::PrioritizedSplitRunner> >(std::allocator<std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false> >&, std::shared_ptr<doris::PrioritizedSplitRunner>*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/alloc_traits.h:698:4
    apache#25 0x55e7706b8ba4 in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false> > >::_M_deallocate_node(std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false>*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/hashtable_policy.h:1572:7
    apache#26 0x55e7706b89ff in std::__detail::_Hashtable_alloc<std::allocator<std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false> > >::_M_deallocate_nodes(std::__detail::_Hash_node<std::shared_ptr<doris::PrioritizedSplitRunner>, false>*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/hashtable_policy.h:1594:4
    apache#27 0x55e7706b89ff in std::_Hashtable<std::shared_ptr<doris::PrioritizedSplitRunner>, std::shared_ptr<doris::PrioritizedSplitRunner>, std::allocator<std::shared_ptr<doris::PrioritizedSplitRunner> >, std::__detail::_Identity, std::equal_to<std::shared_ptr<doris::PrioritizedSplitRunner> >, std::hash<std::shared_ptr<doris::PrioritizedSplitRunner> >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, true, true> >::~_Hashtable() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/hashtable.h:1852:13
    apache#28 0x55e77069c6ca in std::unordered_set<std::shared_ptr<doris::PrioritizedSplitRunner>, std::hash<std::shared_ptr<doris::PrioritizedSplitRunner> >, std::equal_to<std::shared_ptr<doris::PrioritizedSplitRunner> >, std::allocator<std::shared_ptr<doris::PrioritizedSplitRunner> > >::~unordered_set() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/unordered_set.h:107:11
    apache#29 0x55e77069c6ca in doris::TimeSharingTaskExecutor::~TimeSharingTaskExecutor() be/build_ASAN/./be/build_ASAN/../src/exec/scan/task_executor/time_sharing/time_sharing_task_executor.cpp:306:1
    apache#30 0x55e75b583fa1 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:345:8
    apache#31 0x55e770688ecf in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
    apache#32 0x55e770688ecf in std::__shared_ptr<doris::TaskExecutor, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr() /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1531:31
    apache#33 0x55e770688ecf in doris::TaskExecutorSimplifiedScanScheduler::~TaskExecutorSimplifiedScanScheduler() be/build_ASAN/../src/exec/scan/scanner_scheduler.h:266:5
    apache#34 0x55e7706891ed in doris::TaskExecutorSimplifiedScanScheduler::~TaskExecutorSimplifiedScanScheduler() be/build_ASAN/../src/exec/scan/scanner_scheduler.h:261:53
    apache#35 0x55e7744d5afa in std::default_delete<doris::ScannerScheduler>::operator()(doris::ScannerScheduler*) const /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/unique_ptr.h:93:2
    apache#36 0x55e7744d5afa in std::__uniq_ptr_impl<doris::ScannerScheduler, std::default_delete<doris::ScannerScheduler> >::reset(doris::ScannerScheduler*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/unique_ptr.h:205:4
    apache#37 0x55e7744d5afa in std::unique_ptr<doris::ScannerScheduler, std::default_delete<doris::ScannerScheduler> >::reset(doris::ScannerScheduler*) /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/unique_ptr.h:512:7
    apache#38 0x55e7744d5afa in doris::WorkloadGroup::destroy_schedulers() be/build_ASAN/./be/build_ASAN/../src/runtime/workload_group/workload_group.cpp:776:22
    apache#39 0x55e774501af0 in doris::WorkloadGroupMgr::destroy_schedulers() be/build_ASAN/./be/build_ASAN/../src/runtime/workload_group/workload_group_manager.cpp:977:23
    apache#40 0x55e7740e0ddc in doris::ExecEnv::destroy() be/build_ASAN/./be/build_ASAN/../src/runtime/exec_env_init.cpp:892:34
    apache#41 0x55e75b5601f2 in main be/build_ASAN/./be/build_ASAN/../src/service/doris_main.cpp:734:15
    apache#42 0x7f53e1e6b082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
    apache#43 0x55e75b470029 in _start (/mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be+0x247b8029)

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/shared_ptr_base.h:1069:11
```

### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

### Release note

None

### Check List (For Author)

- Test <!-- At least one of them must be included. -->
    - [ ] Regression test
    - [ ] Unit Test
    - [ ] Manual test (add detailed scripts or steps below)
    - [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
        - [ ] Previous test can cover this change.
        - [ ] No code files have been changed.
        - [ ] Other reason <!-- Add your reason?  -->

- Behavior changed:
    - [ ] No.
    - [ ] Yes. <!-- Explain the behavior change -->

- Does this need documentation?
    - [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->
seawinde added a commit that referenced this pull request Jul 15, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jul 15, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jul 16, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jul 20, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Jul 31, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Aug 4, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Aug 4, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde added a commit that referenced this pull request Aug 17, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
seawinde pushed a commit that referenced this pull request Aug 24, 2026
… projected columns (apache#64372)

### What problem does this PR solve?
Problem Summary:
When a SQL query projects the same physical column multiple times with
different aliases (e.g., `SELECT col1 a, col1 b ... ORDER BY col3 DESC
LIMIT 50`), the TopN lazy materialization row-id fetch path crashes or
returns 0 rows with error:

```
*** Query id: eb262350ed06459c-a8ab4307823a1e5a ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1780931790 (unix time) try "date -d @1780931790" if you are using GNU date ***
*** Current BE git commitID: 1ccfbcc4e0 ***
*** SIGSEGV invalid permissions for mapped object (@0x7fa77d496000) received by PID 513 (TID 211603 OR 0x7f9df864d700) from PID 2101960704; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) in /etc/doris/be/lib/doris_be
 1# PosixSignals::chained_handler(int, siginfo*, void*) [clone .part.0] in /software/servers/jdk/lib/server/libjvm.so
 2# JVM_handle_linux_signal in /software/servers/jdk/lib/server/libjvm.so
 3# 0x00007FB56B00CC20 in /lib64/libpthread.so.0
 4# memcpy in /etc/doris/be/lib/doris_be
 5# doris::vectorized::ColumnStr<unsigned int>::insert_from(doris::vectorized::IColumn const&, unsigned long) in /etc/doris/be/lib/doris_be
 6# void doris::vectorized::IColumn::insert_from_multi_column_impl<doris::vectorized::ColumnNullable>(std::vector<doris::vectorized::IColumn const*, std::allocator<doris::vectorized::IColumn const*> > const&, std::vector<unsigned long, std::allocator<unsigned long> > const&) in /etc/doris/be/lib/doris_be
 7# doris::RowIdStorageReader::read_batch_external_row(unsigned long, doris::PRequestBlockDesc const&, std::shared_ptr<doris::IdFileMap>, std::vector<doris::SlotDescriptor, std::allocator<doris::SlotDescriptor> >&, std::shared_ptr<doris::FileMapping>, doris::TUniqueId const&, doris::vectorized::Block&, doris::PRuntimeProfileTree*, long*, long*, unsigned long*) in /etc/doris/be/lib/doris_be
 8# doris::RowIdStorageReader::read_by_rowids(doris::PMultiGetRequestV2 const&, doris::PMultiGetResponseV2*) in /etc/doris/be/lib/doris_be
 9# std::_Function_handler<bool (), doris::PInternalService::multiget_data_v2(google::protobuf::RpcController*, doris::PMultiGetRequestV2 const*, doris::PMultiGetResponseV2*, google::protobuf::Closure*)::$_0>::_M_invoke(std::_Any_data const&) in /etc/doris/be/lib/doris_be
10# doris::vectorized::TaskExecutorSimplifiedScanScheduler::submit_scan_task(doris::vectorized::SimplifiedScanTask, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)::{lambda()#2}::operator()() const in /etc/doris/be/lib/doris_be
11# doris::vectorized::ScannerSplitRunner::process_for(std::chrono::duration<long, std::ratio<1l, 1000000000l> >) in /etc/doris/be/lib/doris_be
12# doris::vectorized::PrioritizedSplitRunner::process() in /etc/doris/be/lib/doris_be
13# doris::vectorized::TimeSharingTaskExecutor::_dispatch_thread() in /etc/doris/be/lib/doris_be
14# doris::Thread::supervise_thread(void*) in /etc/doris/be/lib/doris_be
15# start_thread in /lib64/libpthread.so.0
16# __clone in /lib64/libc.so.6
```

Root cause: The row-id fetch code rebuilds scanner params using
name-keyed maps (`colname_to_slot_id`, `slot_name_to_schema_pos`). When
a column like `advert_name` appears twice, `emplace()` silently drops
the second entry, while `required_slots` and the result block still
contain both logical output slots. This creates an inconsistent schema
between the scanner and the result block.

Fix:
- Build a deduplicated `scan_slots` list with a
`source_column_to_scan_idx` map keyed by (col_name, column_idx,
col_unique_id, column_paths, access_paths), so the scanner sees each
physical column only once.
- Use a `result_column_to_scan_column` remap table so both result
columns copy from the same fetched scan column.


### Release note

Fixed a bug where TopN lazy materialization with duplicate projected
columns (same physical column aliased multiple times) caused the row-id
fetch path to return 0 rows or crash.
---------

Co-authored-by: caokaihua1 <[email protected]>
Co-authored-by: daidai <[email protected]>
seawinde added a commit that referenced this pull request Aug 28, 2026
…TAL/PARTITIONS (#2)

* [feature](fe) Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS

Issue Number: close #xxx

Problem Summary:
The REFRESH MATERIALIZED VIEW command only supported COMPLETE, AUTO, and
partitionSpec modes. For INCREMENTAL MVs, users need explicit INCREMENTAL
and PARTITIONS refresh modes. Additionally, RefreshMTMVInfo used a boolean
isComplete flag which could not express the new modes.

This PR:
1. Extends the grammar to accept INCREMENTAL and PARTITIONS keywords
2. Replaces boolean isComplete with a RefreshMode enum
   (AUTO, COMPLETE, INCREMENTAL, PARTITIONS, DEFAULT)
3. Adds analyze-time constraint validation:
   - Non-INCREMENTAL MV rejects INCREMENTAL/PARTITIONS refresh mode
   - INCREMENTAL MV rejects old-style partitionSpec (use PARTITIONS instead)
4. Propagates RefreshMode through MTMVTaskContext with backward-compat
   Gson serialization

Support explicit REFRESH MATERIALIZED VIEW ... INCREMENTAL and
REFRESH MATERIALIZED VIEW ... PARTITIONS syntax for INCREMENTAL MVs.

- Test: Unit Test (14 new tests + 18 existing regression tests pass)
- Behavior changed: Yes - REFRESH MATERIALIZED VIEW now accepts
  INCREMENTAL and PARTITIONS keywords; mode is now optional (defaults
  to DEFAULT which behaves like previous no-mode behavior)
- Does this need documentation: Yes (syntax doc update needed)

Co-authored-by: Copilot <[email protected]>

* fix ut and code style

---------

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants