dbms: development [#CONV-2944].

This commit is contained in:
Alexey Milovidov 2012-07-18 20:14:41 +00:00
parent 1c682cdf6d
commit fc50b0a07e
3 changed files with 7 additions and 5 deletions

View File

@ -94,7 +94,7 @@ private:
String date_column_name;
size_t index_granularity;
Expression primary_expr;
SharedPtr<Expression> primary_expr;
SortDescription sort_descr;
Increment increment;

View File

@ -127,7 +127,7 @@ StoragePtr StorageFactory::get(
UInt64 index_granularity = boost::get<UInt64>(dynamic_cast<ASTLiteral &>(*args[2]).value);
ASTFunction & primary_expr_func = dynamic_cast<ASTFunction &>(*args[1]);
if (primary_expr_func.name != "makeTuple")
if (primary_expr_func.name != "tuple")
throw Exception("Primary expression for storage MergeTree must be in parentheses.",
ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);

View File

@ -119,7 +119,7 @@ private:
Poco::File(part_tmp_path).createDirectories();
/// Если для сортировки надо вычислить некоторые столбцы - делаем это.
storage.primary_expr.execute(block);
storage.primary_expr->execute(block);
/// Сортируем.
sortBlock(block, storage.sort_descr);
@ -189,7 +189,6 @@ StorageMergeTree::StorageMergeTree(
: path(path_), name(name_), full_path(path + escapeForFileName(name) + '/'), columns(columns_),
context(context_), primary_expr_ast(primary_expr_ast_->clone()),
date_column_name(date_column_name_), index_granularity(index_granularity_),
primary_expr(primary_expr_ast, context),
increment(full_path + "increment.txt")
{
/// создаём директорию, если её нет
@ -201,9 +200,12 @@ StorageMergeTree::StorageMergeTree(
it != primary_expr_ast->children.end();
++it)
{
String name = (*it)->children.front()->getColumnName();
String name = (*it)->getColumnName();
sort_descr.push_back(SortColumnDescription(name, 1));
}
context.columns = *columns;
primary_expr = new Expression(primary_expr_ast, context);
}