Skip to content

Logical error: Fourth argument of function transform must be a constant or a column at least as big as the second and third arguments #77805

@PedroTadim

Description

@PedroTadim

Describe the bug

This is a regression introduced in v24.3.

How to reproduce

Run Fiddle: https://fiddle.clickhouse.com/aedac458-89ec-46fb-abe5-af9047a9a7d5

Error message and/or stacktrace

Stack trace:

<Fatal> : Logical error: 'Fourth argument of function transform must be a constant or a column at least as big as the second and third arguments'.
<Fatal> : Stack trace (when copying this message, always include the lines below):

0. std::exception::exception[abi:ne190107]() @ 0x0000000017c90ab4
1. base/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(String const&, int) @ 0x00000000355fa8e0
2. src/Common/Exception.cpp:108: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x00000000236ead0b
3. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x0000000017b44316
4. DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x0000000017b58dcf
5. DB::(anonymous namespace)::FunctionTransform::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000020a9d131
6. src/Functions/IFunctionAdaptors.cpp:10: DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000002a9f5b4e
7. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9e9a77
8. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9ec47a
9. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9eda90
10. DB::IFunctionBase::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9ee5c7
11. DB::(anonymous namespace)::FunctionTransform::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000020a9ce9c
12. src/Functions/IFunctionAdaptors.cpp:10: DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000002a9f5b4e
13. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9e9a77
14. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9ec47a
15. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9eda90
16. DB::IFunctionBase::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9ee5c7
17. DB::(anonymous namespace)::FunctionCaseWithExpression::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000019d28493
18. DB::IFunction::executeImplDryRun(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000017b423ef
19. src/Functions/IFunctionAdaptors.cpp:16: DB::FunctionToExecutableFunctionAdaptor::executeDryRunImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x000000002a9f5c8e
20. DB::IExecutableFunction::executeWithoutLowCardinalityColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9e9a1f
21. DB::IExecutableFunction::executeWithoutSparseColumns(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9ec47a
22. DB::IExecutableFunction::execute(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long, bool) const @ 0x000000002a9eda90
23. src/Interpreters/ActionsDAG.cpp:413: DB::ActionsDAG::addFunctionImpl(std::shared_ptr<DB::IFunctionBase const> const&, std::vector<DB::ActionsDAG::Node const*, std::allocator<DB::ActionsDAG::Node const*>>, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>>, String, std::shared_ptr<DB::IDataType const>, bool) @ 0x000000002c7cbdab
24. src/Interpreters/ActionsDAG.cpp:346: DB::ActionsDAG::addFunction(DB::FunctionNode const&, std::vector<DB::ActionsDAG::Node const*, std::allocator<DB::ActionsDAG::Node const*>>, String) @ 0x000000002c7ccb0a
25. src/Planner/PlannerActionsVisitor.cpp:536: DB::(anonymous namespace)::PlannerActionsVisitorImpl::visitImpl(std::shared_ptr<DB::IQueryTreeNode>) @ 0x000000002c839930
26. src/Planner/PlannerActionsVisitor.cpp:651: DB::PlannerActionsVisitor::visit(DB::ActionsDAG&, std::shared_ptr<DB::IQueryTreeNode>) @ 0x000000002c82e931
27. src/Planner/Utils.cpp:252: DB::buildActionsDAGFromExpressionNode(std::shared_ptr<DB::IQueryTreeNode> const&, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::PlannerContext> const&) @ 0x000000002c84c704
28. src/Planner/PlannerExpressionAnalysis.cpp:55: DB::(anonymous namespace)::analyzeFilter(std::shared_ptr<DB::IQueryTreeNode> const&, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::PlannerContext> const&, DB::ActionsChain&) @ 0x000000002daadd27
29. src/Planner/PlannerExpressionAnalysis.cpp:558: DB::buildExpressionAnalysisResult(std::shared_ptr<DB::IQueryTreeNode> const&, std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::PlannerContext> const&, DB::PlannerQueryProcessingInfo const&) @ 0x000000002daa7124
30. src/Planner/Planner.cpp:1589: DB::Planner::buildPlanForQueryNode() @ 0x000000002da19d9e
31. src/Planner/Planner.cpp:1311: DB::Planner::buildQueryPlanIfNeeded() @ 0x000000002da1346a

Metadata

Metadata

Assignees

Labels

bugConfirmed user-visible misbehaviour in official releasefuzzProblem found by one of the fuzzersv25.2-affectedv25.3-affected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions