Update ActionsVisitor.cpp

This commit is contained in:
Nikolai Kochetov 2020-10-02 12:13:26 +03:00 committed by GitHub
parent 0f92f60ab2
commit 56141a1e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -509,10 +509,10 @@ void ActionsMatcher::visit(const ASTIdentifier & identifier, const ASTPtr & ast,
{
/// The requested column is not in the block.
/// If such a column exists in the table, then the user probably forgot to surround it with an aggregate function or add it to GROUP BY.
for (const auto & column_name_type : data.source_columns)
for (const auto & column_name_type : data.source_columns)
{
if (column_name_type.name == column_name.get(ast))
if (column_name_type.name == column_name.get(ast))
{
throw Exception("Column " + backQuote(column_name.get(ast)) + " is not under aggregate function and not in GROUP BY",
ErrorCodes::NOT_AN_AGGREGATE);