Skip to content

Commit 502d039

Browse files
Backport ClickHouse#75757 to 24.8: Fix normalizing function names inside ASTTTLElement (ClickHouse#76367)
Co-authored-by: robot-clickhouse <[email protected]>
1 parent d5cea61 commit 502d039

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Interpreters/FunctionNameNormalizer.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Parsers/ASTColumnDeclaration.h>
44
#include <Parsers/ASTCreateQuery.h>
55
#include <Parsers/ASTFunction.h>
6+
#include <Parsers/ASTTTLElement.h>
67

78
#include <Functions/FunctionFactory.h>
89
#include <AggregateFunctions/AggregateFunctionFactory.h>
@@ -41,6 +42,14 @@ void FunctionNameNormalizer::visit(IAST * ast)
4142

4243
for (auto & child : ast->children)
4344
visit(child.get());
45+
46+
if (auto * ttl_elem = ast->as<ASTTTLElement>())
47+
{
48+
for (const auto & a : ttl_elem->group_by_key)
49+
visit(a.get());
50+
for (const auto & a : ttl_elem->group_by_assignments)
51+
visit(a.get());
52+
}
4453
}
4554

4655
}

tests/integration/helpers/test_tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def exec_query_with_retry(
153153
res = instance.query(query, timeout=timeout, settings=settings)
154154
if not silent:
155155
logging.debug(f"Result of {query} on {cnt} try is {res}")
156-
break
156+
return res
157157
except Exception as ex:
158158
exception = ex
159159
if not silent:

0 commit comments

Comments
 (0)