Skip to content

Invalid number of rows in Chunk with lazy materialization between v25.8 to v25.11 #97771

@PedroTadim

Description

@PedroTadim

Describe the bug

Easy to reproduce. Happens in every release from v25.8 to v25.11

How to reproduce

Run Fiddle: https://fiddle.clickhouse.com/ba83d480-7fb5-4b7a-afbf-b1ca1d9f7aa9

Error message and/or stacktrace

Stack trace is different when I run locally:

<Fatal> : Logical error: 'res_columns.empty()'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. src/Common/StackTrace.cpp:397: StackTrace::StackTrace() @ 0x000000001514fa24
1. src/Common/Exception.cpp:57: DB::abortOnFailedAssertion(String const&) @ 0x00000000150af555
2. src/Storages/MergeTree/MergeTreeLazilyReader.cpp:257: DB::MergeTreeLazilyReader::transformLazyColumns(DB::ColumnLazy const&, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>&) @ 0x000000001f29944f
3. src/Processors/Transforms/ColumnLazyTransform.cpp:43: DB::ColumnLazyTransform::transform(DB::Chunk&) @ 0x000000001f29c235
4. src/Processors/ISimpleTransform.h:33: DB::ISimpleTransform::transform(DB::Chunk&, DB::Chunk&) @ 0x000000001777ef53
5. src/Processors/ISimpleTransform.cpp:98: DB::ISimpleTransform::work() @ 0x000000001ec05a4a
6. src/Processors/Executors/ExecutionThreadContext.cpp:53: DB::ExecutionThreadContext::executeTask() @ 0x000000001ec23470
7. src/Processors/Executors/PipelineExecutor.cpp:351: DB::PipelineExecutor::executeStepImpl(unsigned long, DB::IAcquiredSlot*, std::atomic<bool>*) @ 0x000000001ec15e98
8. src/Processors/Executors/PipelineExecutor.cpp:279: DB::PipelineExecutor::executeSingleThread(unsigned long, DB::IAcquiredSlot*) @ 0x000000001ec164a9
9. src/Processors/Executors/PipelineExecutor.cpp:602: DB::PipelineExecutor::executeImpl(unsigned long, bool) @ 0x000000001ec14c21
10. src/Processors/Executors/PipelineExecutor.cpp:136: DB::PipelineExecutor::execute(unsigned long, bool) @ 0x000000001ec1437f
11. src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:76: void std::__function::__policy_func<void ()>::__call_func[abi:se210105]<ThreadFromGlobalPoolImpl<true, true>::ThreadFromGlobalPoolImpl<DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0>(DB::PullingAsyncPipelineExecutor::pull(DB::Chunk&, unsigned long)::$_0&&)::'lambda'()>(std::__function::__policy_storage const*) @ 0x000000001ec2b462
12. contrib/llvm-project/libcxx/include/__functional/function.h:508: ? @ 0x00000000151facb2
13. contrib/llvm-project/libcxx/include/__type_traits/invoke.h:217: void* std::__thread_proxy[abi:se210105]<std::tuple<std::unique_ptr<std::__thread_struct, std::default_delete<std::__thread_struct>>, void (ThreadPoolImpl<std::thread>::ThreadFromThreadPool::*)(), ThreadPoolImpl<std::thread>::ThreadFromThreadPool*>>(void*) @ 0x00000000152017c0
14. start_thread @ 0x000000000009caa4
15. clone3 @ 0x0000000000129c6c

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasest-fixedThe problem is fixed, but pending a test.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions