Rename functions.

This commit is contained in:
Nikolai Kochetov 2021-02-05 18:11:26 +03:00
parent 872d2a8ad5
commit 85c175883e
5 changed files with 9 additions and 10 deletions

View File

@ -171,7 +171,7 @@ Block AddingDefaultsBlockInputStream::readImpl()
if (!evaluate_block.columns()) if (!evaluate_block.columns())
evaluate_block.insert({ColumnConst::create(ColumnUInt8::create(1, 0), res.rows()), std::make_shared<DataTypeUInt8>(), "_dummy"}); evaluate_block.insert({ColumnConst::create(ColumnUInt8::create(1, 0), res.rows()), std::make_shared<DataTypeUInt8>(), "_dummy"});
auto dag = createFillingMissingDefaultsExpression(evaluate_block, header.getNamesAndTypesList(), columns, context, false); auto dag = evaluateMissingDefaults(evaluate_block, header.getNamesAndTypesList(), columns, context, false);
if (dag) if (dag)
{ {
auto actions = std::make_shared<ExpressionActions>(std::move(dag)); auto actions = std::make_shared<ExpressionActions>(std::move(dag));

View File

@ -91,7 +91,7 @@ ActionsDAGPtr addMissingDefaults(
} }
/// Computes explicitly specified values by default and materialized columns. /// Computes explicitly specified values by default and materialized columns.
if (auto dag = createFillingMissingDefaultsExpression(header, required_columns, columns, context)) if (auto dag = evaluateMissingDefaults(header, required_columns, columns, context))
actions = ActionsDAG::merge(std::move(*actions), std::move(*dag)); actions = ActionsDAG::merge(std::move(*actions), std::move(*dag));
return actions; return actions;

View File

@ -87,7 +87,7 @@ ASTPtr convertRequiredExpressions(Block & block, const NamesAndTypesList & requi
return conversion_expr_list; return conversion_expr_list;
} }
ActionsDAGPtr createFillingMissingDefaultsExpression( ActionsDAGPtr createExpressions(
const Block & header, const Block & header,
ASTPtr expr_list, ASTPtr expr_list,
bool save_unneeded_columns, bool save_unneeded_columns,
@ -125,14 +125,14 @@ void performRequiredConversions(Block & block, const NamesAndTypesList & require
if (conversion_expr_list->children.empty()) if (conversion_expr_list->children.empty())
return; return;
if (auto dag = createFillingMissingDefaultsExpression(block, conversion_expr_list, true, required_columns, context)) if (auto dag = createExpressions(block, conversion_expr_list, true, required_columns, context))
{ {
auto expression = std::make_shared<ExpressionActions>(std::move(dag)); auto expression = std::make_shared<ExpressionActions>(std::move(dag));
expression->execute(block); expression->execute(block);
} }
} }
ActionsDAGPtr createFillingMissingDefaultsExpression( ActionsDAGPtr evaluateMissingDefaults(
const Block & header, const Block & header,
const NamesAndTypesList & required_columns, const NamesAndTypesList & required_columns,
const ColumnsDescription & columns, const ColumnsDescription & columns,
@ -142,7 +142,7 @@ ActionsDAGPtr createFillingMissingDefaultsExpression(
return nullptr; return nullptr;
ASTPtr expr_list = defaultRequiredExpressions(header, required_columns, columns); ASTPtr expr_list = defaultRequiredExpressions(header, required_columns, columns);
return createFillingMissingDefaultsExpression(header, expr_list, save_unneeded_columns, required_columns, context); return createExpressions(header, expr_list, save_unneeded_columns, required_columns, context);
} }
} }

View File

@ -15,9 +15,8 @@ class ColumnsDescription;
class ActionsDAG; class ActionsDAG;
using ActionsDAGPtr = std::shared_ptr<ActionsDAG>; using ActionsDAGPtr = std::shared_ptr<ActionsDAG>;
/// Adds missing defaults to block according to required_columns /// Create actions which adds missing defaults to block according to required_columns using columns description.
/// using columns description ActionsDAGPtr evaluateMissingDefaults(
ActionsDAGPtr createFillingMissingDefaultsExpression(
const Block & header, const Block & header,
const NamesAndTypesList & required_columns, const NamesAndTypesList & required_columns,
const ColumnsDescription & columns, const ColumnsDescription & columns,

View File

@ -186,7 +186,7 @@ void IMergeTreeReader::evaluateMissingDefaults(Block additional_columns, Columns
additional_columns.insert({res_columns[pos], name_and_type->type, name_and_type->name}); additional_columns.insert({res_columns[pos], name_and_type->type, name_and_type->name});
} }
auto dag = DB::createFillingMissingDefaultsExpression( auto dag = DB::evaluateMissingDefaults(
additional_columns, columns, metadata_snapshot->getColumns(), storage.global_context); additional_columns, columns, metadata_snapshot->getColumns(), storage.global_context);
if (dag) if (dag)
{ {