Do not build compiled functions

This commit is contained in:
alesapin 2018-10-25 19:52:28 +03:00
parent 3a9311d3ad
commit a4dd489165
2 changed files with 11 additions and 2 deletions

View File

@ -314,7 +314,15 @@ bool PreparedFunctionImpl::defaultImplementationForConstantArguments(Block & blo
executeWithoutLowCardinalityColumns(temporary_block, temporary_argument_numbers, arguments_size, temporary_block.rows());
block.getByPosition(result).column = ColumnConst::create(temporary_block.getByPosition(arguments_size).column->cloneResized(1), input_rows_count);
ColumnPtr result_column;
/// extremely rare case, when we have function with completely const arguments
/// but some of them produced by non isDeterministic function
if (temporary_block.getByPosition(arguments_size).column->size() > 1)
result_column = temporary_block.getByPosition(arguments_size).column->cloneResized(1);
else
result_column = temporary_block.getByPosition(arguments_size).column;
block.getByPosition(result).column = ColumnConst::create(result_column, input_rows_count);
return true;
}

View File

@ -677,7 +677,8 @@ void ExpressionActions::addImpl(ExpressionAction action, Names & new_names)
new_names.push_back(action.result_name);
new_names.insert(new_names.end(), action.array_joined_columns.begin(), action.array_joined_columns.end());
if (action.type == ExpressionAction::APPLY_FUNCTION)
/// Compiled functions are custom functions and them don't need building
if (action.type == ExpressionAction::APPLY_FUNCTION && !action.is_function_compiled)
{
if (sample_block.has(action.result_name))
throw Exception("Column '" + action.result_name + "' already exists", ErrorCodes::DUPLICATE_COLUMN);