Fixed typo [#CLICKHOUSE-2].

This commit is contained in:
Alexey Milovidov 2017-12-24 02:06:59 +03:00
parent 3a7a6d6318
commit 1ba80c6768
2 changed files with 9 additions and 9 deletions

View File

@ -25,11 +25,11 @@ class AggregateFunctionArray final : public IAggregateFunctionHelper<AggregateFu
{
private:
AggregateFunctionPtr nested_func;
size_t num_agruments;
size_t num_arguments;
public:
AggregateFunctionArray(AggregateFunctionPtr nested_, const DataTypes & arguments)
: nested_func(nested_), num_agruments(arguments.size())
: nested_func(nested_), num_arguments(arguments.size())
{
for (const auto & type : arguments)
if (!typeid_cast<const DataTypeArray *>(type.get()))
@ -73,9 +73,9 @@ public:
void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena * arena) const override
{
const IColumn * nested[num_agruments];
const IColumn * nested[num_arguments];
for (size_t i = 0; i < num_agruments; ++i)
for (size_t i = 0; i < num_arguments; ++i)
nested[i] = &static_cast<const ColumnArray &>(*columns[i]).getData();
const ColumnArray & first_array_column = static_cast<const ColumnArray &>(*columns[0]);
@ -85,7 +85,7 @@ public:
size_t end = offsets[row_num];
/// Sanity check. NOTE We can implement specialization for a case with single argument, if the check will hurt performance.
for (size_t i = 1; i < num_agruments; ++i)
for (size_t i = 1; i < num_arguments; ++i)
{
const ColumnArray & ith_column = static_cast<const ColumnArray &>(*columns[i]);
const IColumn::Offsets & ith_offsets = ith_column.getOffsets();

View File

@ -25,13 +25,13 @@ class AggregateFunctionIf final : public IAggregateFunctionHelper<AggregateFunct
{
private:
AggregateFunctionPtr nested_func;
size_t num_agruments;
size_t num_arguments;
public:
AggregateFunctionIf(AggregateFunctionPtr nested, const DataTypes & types)
: nested_func(nested), num_agruments(types.size())
: nested_func(nested), num_arguments(types.size())
{
if (num_agruments == 0)
if (num_arguments == 0)
throw Exception("Aggregate function " + getName() + " require at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
if (!typeid_cast<const DataTypeUInt8 *>(types.back().get()))
@ -75,7 +75,7 @@ public:
void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena * arena) const override
{
if (static_cast<const ColumnUInt8 &>(*columns[num_agruments - 1]).getData()[row_num])
if (static_cast<const ColumnUInt8 &>(*columns[num_arguments - 1]).getData()[row_num])
nested_func->add(place, columns, row_num, arena);
}