From c1ea15f0bb04c5b722947d6c688e3a0871d07493 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Tue, 26 Mar 2019 00:54:19 +0300 Subject: [PATCH] Update DataTypeDomainSimpleAggregateFunction.cpp --- .../DataTypes/DataTypeDomainSimpleAggregateFunction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp index 570310c1312..ee524f76ec9 100644 --- a/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeDomainSimpleAggregateFunction.cpp @@ -70,18 +70,18 @@ static std::pair create(const ASTPtr & arguments throw Exception("Data type SimpleAggregateFunction requires parameters: " "name of aggregate function and list of data types for arguments", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH); - if (const ASTFunction * parametric = typeid_cast(arguments->children[0].get())) + if (const ASTFunction * parametric = arguments->children[0]->as()) { if (parametric->parameters) throw Exception("Unexpected level of parameters to aggregate function", ErrorCodes::SYNTAX_ERROR); function_name = parametric->name; - const ASTs & parameters = typeid_cast(*parametric->arguments).children; + const ASTs & parameters = parametric->arguments->as().children; params_row.resize(parameters.size()); for (size_t i = 0; i < parameters.size(); ++i) { - const ASTLiteral * lit = typeid_cast(parameters[i].get()); + const ASTLiteral * lit = parameters[i]->as(); if (!lit) throw Exception("Parameters to aggregate functions must be literals", ErrorCodes::PARAMETERS_TO_AGGREGATE_FUNCTIONS_MUST_BE_LITERALS); @@ -93,7 +93,7 @@ static std::pair create(const ASTPtr & arguments { function_name = *opt_name; } - else if (typeid_cast(arguments->children[0].get())) + else if (arguments->children[0]->as()) { throw Exception("Aggregate function name for data type SimpleAggregateFunction must be passed as identifier (without quotes) or function", ErrorCodes::BAD_ARGUMENTS);