moved indices

This commit is contained in:
Nikita Vasilev 2019-01-20 23:03:17 +03:00
parent 3f5447f471
commit 977b1e20d0
4 changed files with 12 additions and 3 deletions

View File

@ -31,6 +31,11 @@ void ITableDeclaration::setColumns(ColumnsDescription columns_)
columns = std::move(columns_);
}
void ITableDeclaration::setIndicesDescription(IndicesDescription indices_)
{
indices = std::move(indices_);
}
bool ITableDeclaration::hasColumn(const String & column_name) const
{

View File

@ -1,6 +1,7 @@
#pragma once
#include <Storages/ColumnsDescription.h>
#include <Storages/IndicesDescription.h>
namespace DB
@ -15,6 +16,9 @@ public:
virtual const ColumnsDescription & getColumns() const { return columns; }
virtual void setColumns(ColumnsDescription columns_);
virtual const IndicesDescription & getIndicesDescription() const { return indices; }
virtual void setIndicesDescription(IndicesDescription indices_);
/// NOTE: These methods should include virtual columns, but should NOT include ALIAS columns
/// (they are treated separately).
virtual NameAndTypePair getColumn(const String & column_name) const;
@ -52,6 +56,7 @@ public:
private:
ColumnsDescription columns;
IndicesDescription indices;
};
}

View File

@ -355,7 +355,7 @@ void MergeTreeData::setSkipIndices(const IndicesDescription & indices, bool only
{
if (!only_check)
{
skip_indices_description = indices;
setIndicesDescription(indices);
skip_indices_expr = nullptr;
skip_indices.clear();
}
@ -395,7 +395,7 @@ void MergeTreeData::setSkipIndices(const IndicesDescription & indices, bool only
if (!only_check)
{
skip_indices_description = indices;
setIndicesDescription(indices);
skip_indices_expr = new_skip_indices_expr;
skip_indices = std::move(new_indices);
}

View File

@ -588,7 +588,6 @@ public:
/// Secondary (data skipping) indices for MergeTree
MergeTreeIndices skip_indices;
ASTPtr skip_indices_ast;
IndicesDescription skip_indices_description;
ExpressionActionsPtr skip_indices_expr;
/// Names of columns for primary key + secondary sorting columns.