uchenily opened a new pull request, #60826:
URL: https://github.com/apache/doris/pull/60826

   ### What problem does this PR solve?
   
   Previously, the nullable -> non-nullable projections were not handled 
correctly, the wrong type was passed in, leading to a bad cast and BE core dump.
   
   ```sql
   DROP TABLE IF EXISTS tbl;
   CREATE TABLE IF NOT EXISTS tbl
   (
       k INT NOT NULL,
   )
   DUPLICATE KEY(k)
   DISTRIBUTED BY HASH(k) BUCKETS 1
   PROPERTIES(
       "replication_num" = "1"
   );
   INSERT INTO tbl select * from numbers("number" = "10");
   ```
   
   ```
   RuntimeLogger F20260225 14:05:31.695003 200516 status.h:467] Bad cast from 
type:doris::vectorized::ColumnNullable to 
doris::vectorized::ColumnVector<(doris::PrimitiveType)5>
   F20260225 14:05:31.695003 200047 status.h:467] Bad cast from 
type:doris::vectorized::ColumnNullable to 
doris::vectorized::ColumnVector<(doris::PrimitiveType)5>
   *** Check failure stack trace: ***
   I20260225 14:05:31.695480 200047 vtablet_writer_v2.cpp:264] opening olap 
table sink, load_id=cf1bf7c76db3421d-bc99ef3848f57508, txn_id=7, sink_id=0
   I20260225 14:05:31.700487 200047 workload_group_manager.cpp:243]
   Process Memory Summary: process memory used 793.99 MB(= 793.02 MB[vm/rss] + 
1000.00 KB[reserved] + 0B[waiting_refresh]), sys available memory 41.14 GB(= 
41.14 GB[proc/available] - 1000.00 KB[reserved] - 0B[waiting_refresh]), all 
workload groups memory usage: 1000.00 KB
   I20260225 14:05:31.700625 200047 workload_group_manager.cpp:877]
   Query Memory Summary:
   TaskId=cf1bf7c76db3421d-bc99ef3848f57508, Memory(Used=1000.00 KB, 
Limit=42.34 GB, Peak=1000.00 KB), Spill(RunningSpillTaskCnt=0, 
TotalPausedPeriodSecs=0, LatestPausedReason=[OK])
   I20260225 14:05:31.701527 200047 internal_service.cpp:417] open load stream, 
load_id=cf1bf7c76db3421d-bc99ef3848f57508, src_id=1771991457028
   I20260225 14:05:31.702103 200047 load_stream.cpp:496] succeed to init load 
stream load_id=cf1bf7c76db3421d-bc99ef3848f57508, txn_id=7
   I20260225 14:05:31.703848 200047 load_stream_stub.cpp:212] open load stream 
to host=127.0.0.1, port=8060, LoadStreamStub 
load_id=cf1bf7c76db3421d-bc99ef3848f57508, src_id=1771991457028, 
dst_id=1771991457028, stream_id=204
   I20260225 14:05:31.704720 200047 internal_service.cpp:417] open load stream, 
load_id=cf1bf7c76db3421d-bc99ef3848f57508, src_id=1771991457028
   I20260225 14:05:31.705595 200047 load_stream_stub.cpp:212] open load stream 
to host=127.0.0.1, port=8060, LoadStreamStub 
load_id=cf1bf7c76db3421d-bc99ef3848f57508, src_id=1771991457028, 
dst_id=1771991457028, stream_id=207
       @     0x62eca069350f  google::LogMessage::SendToLog()
       @     0x62eca0689b20  google::LogMessage::Flush()
       @     0x62eca068d219  google::LogMessageFatal::~LogMessageFatal()
       @     0x62ec953a97a3  doris::Status::FatalError<>()
       @     0x62ec955fcb36  
_ZZ11assert_castIRKN5doris10vectorized12ColumnVectorILNS0_13PrimitiveTypeE5EEEL18TypeCheckOnRelease1ERKNS1_7IColumnEET_OT1_ENKUlOSB_E_clISA_EES6_SE_
       @     0x62ec955fc97d  assert_cast<>()
       @     0x62ec9c577e0c  
doris::vectorized::ColumnVector<>::insert_range_from()
       @     0x62ec9f2ba9be  
_ZZNK5doris8pipeline13OperatorXBase14do_projectionsEPNS_12RuntimeStateEPNS_10vectorized5BlockES6_ENK3$_0clINS_3COWINS4_7IColumnEE11mutable_ptrISA_EEEEDaRT_RNSB_13immutable_ptrISA_EEm
       @     0x62ec9f2ba5ae  doris::pipeline::OperatorXBase::do_projections()
       @     0x62ec9f2baeb1  
doris::pipeline::OperatorXBase::get_block_after_projects()
       @     0x62eca046dda4  doris::pipeline::PipelineTask::execute()
       @     0x62eca04a7b0d  doris::pipeline::TaskScheduler::_do_work()
       @     0x62eca04a8bab  
doris::pipeline::TaskScheduler::start()::$_0::operator()()
       @     0x62eca04a8b85  std::__invoke_impl<>()
       @     0x62eca04a8b35  
_ZSt10__invoke_rIvRZN5doris8pipeline13TaskScheduler5startEvE3$_0JEENSt9enable_ifIX16is_invocable_r_vIT_T0_DpT1_EES6_E4typeEOS7_DpOS8_
       @     0x62eca04a8a4d  std::_Function_handler<>::_M_invoke()
       @     0x62ec951cdafe  std::function<>::operator()()
       @     0x62ec973d7479  doris::FunctionRunnable::run()
   I20260225 14:05:32.015940 200047 olap_server.cpp:1326] cooldown producer get 
tablet num: 0
       @     0x62ec973cf435  doris::ThreadPool::dispatch_thread()
       @     0x62ec973de2e2  std::__invoke_impl<>()
       @     0x62ec973de22d  std::__invoke<>()
       @     0x62ec973de1fd  
_ZNSt5_BindIFMN5doris10ThreadPoolEFvvEPS1_EE6__callIvJEJLm0EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE
       @     0x62ec973de1b6  std::_Bind<>::operator()<>()
       @     0x62ec973de185  std::__invoke_impl<>()
       @     0x62ec973de145  
_ZSt10__invoke_rIvRSt5_BindIFMN5doris10ThreadPoolEFvvEPS2_EEJEENSt9enable_ifIX16is_invocable_r_vIT_T0_DpT1_EESA_E4typeEOSB_DpOSC_
       @     0x62ec973ddfad  std::_Function_handler<>::_M_invoke()
       @     0x62ec951cdafe  std::function<>::operator()()
       @     0x62ec973bb500  doris::Thread::supervise_thread()
       @     0x73687ce9caa4  (unknown)
       @     0x73687cf29c3c  (unknown)
       @              (nil)  (unknown)
   ```
   
   This PR explicitly handles the nullable to non-nullable projection path to 
prevent the above issue.
   
   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. -->
       - [x] 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: 
https://github.com/apache/doris-website/pull/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 -->
   
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to