diff --git a/dbms/src/Processors/QueryPipeline.cpp b/dbms/src/Processors/QueryPipeline.cpp index b91ca56b4c4..d8c2da7186d 100644 --- a/dbms/src/Processors/QueryPipeline.cpp +++ b/dbms/src/Processors/QueryPipeline.cpp @@ -597,7 +597,7 @@ void QueryPipeline::calcRowsBeforeLimit() } /// Skip totals and extremes port for output format. - if (auto * format = typeid_cast(processor)) + if (auto * format = dynamic_cast(processor)) { auto * child_processor = &format->getPort(IOutputFormat::PortKind::Main).getOutputPort().getProcessor(); if (visited.emplace(child_processor).second)