2020-05-21 19:07:18 +00:00
|
|
|
#include <Storages/StorageInMemoryMetadata.h>
|
|
|
|
|
2020-02-14 13:17:50 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-21 19:07:18 +00:00
|
|
|
|
2020-02-14 13:17:50 +00:00
|
|
|
StorageInMemoryMetadata::StorageInMemoryMetadata(
|
|
|
|
const ColumnsDescription & columns_,
|
2020-06-01 12:11:23 +00:00
|
|
|
const IndicesDescription & secondary_indices_,
|
2020-02-14 13:17:50 +00:00
|
|
|
const ConstraintsDescription & constraints_)
|
|
|
|
: columns(columns_)
|
2020-06-01 12:11:23 +00:00
|
|
|
, secondary_indices(secondary_indices_)
|
2020-02-14 13:17:50 +00:00
|
|
|
, constraints(constraints_)
|
|
|
|
{
|
|
|
|
}
|
2020-06-08 14:18:38 +00:00
|
|
|
|
|
|
|
StorageInMemoryMetadata::StorageInMemoryMetadata(const StorageInMemoryMetadata & other)
|
|
|
|
: columns(other.columns)
|
|
|
|
, secondary_indices(other.secondary_indices)
|
|
|
|
, constraints(other.constraints)
|
|
|
|
, partition_key(other.partition_key)
|
|
|
|
, primary_key(other.primary_key)
|
|
|
|
, sorting_key(other.sorting_key)
|
|
|
|
, sampling_key(other.sampling_key)
|
|
|
|
, column_ttls_by_name(other.column_ttls_by_name)
|
|
|
|
, table_ttl(other.table_ttl)
|
|
|
|
, settings_changes(other.settings_changes ? other.settings_changes->clone() : nullptr)
|
|
|
|
, select(other.select)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
StorageInMemoryMetadata & StorageInMemoryMetadata::operator=(const StorageInMemoryMetadata & other)
|
|
|
|
{
|
2020-06-09 17:42:04 +00:00
|
|
|
if (&other == this)
|
|
|
|
return *this;
|
|
|
|
|
2020-06-08 14:18:38 +00:00
|
|
|
columns = other.columns;
|
|
|
|
secondary_indices = other.secondary_indices;
|
|
|
|
constraints = other.constraints;
|
|
|
|
partition_key = other.partition_key;
|
|
|
|
primary_key = other.primary_key;
|
|
|
|
sorting_key = other.sorting_key;
|
|
|
|
sampling_key = other.sampling_key;
|
|
|
|
column_ttls_by_name = other.column_ttls_by_name;
|
|
|
|
table_ttl = other.table_ttl;
|
|
|
|
if (other.settings_changes)
|
|
|
|
settings_changes = other.settings_changes->clone();
|
|
|
|
else
|
|
|
|
settings_changes.reset();
|
|
|
|
select = other.select;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2020-06-12 09:37:52 +00:00
|
|
|
|
2020-06-15 16:55:33 +00:00
|
|
|
void StorageInMemoryMetadata::setColumns(ColumnsDescription columns_)
|
|
|
|
{
|
|
|
|
columns = std::move(columns_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StorageInMemoryMetadata::setSecondaryIndices(IndicesDescription secondary_indices_)
|
|
|
|
{
|
|
|
|
secondary_indices = std::move(secondary_indices_);
|
|
|
|
}
|
|
|
|
|
|
|
|
void StorageInMemoryMetadata::setConstraints(ConstraintsDescription constraints_)
|
|
|
|
{
|
|
|
|
constraints = std::move(constraints_);
|
|
|
|
}
|
|
|
|
|
2020-06-15 17:50:53 +00:00
|
|
|
void StorageInMemoryMetadata::setTableTTLs(const TTLTableDescription & table_ttl_)
|
|
|
|
{
|
|
|
|
table_ttl = table_ttl_;
|
|
|
|
}
|
|
|
|
|
|
|
|
void StorageInMemoryMetadata::setColumnTTLs(const TTLColumnsDescription & column_ttls_by_name_)
|
|
|
|
{
|
|
|
|
column_ttls_by_name = column_ttls_by_name_;
|
|
|
|
}
|
|
|
|
|
2020-06-15 18:08:05 +00:00
|
|
|
void StorageInMemoryMetadata::setSettingsChanges(const ASTPtr & settings_changes_)
|
|
|
|
{
|
|
|
|
if (settings_changes_)
|
|
|
|
settings_changes = settings_changes_;
|
|
|
|
else
|
|
|
|
settings_changes = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
void StorageInMemoryMetadata::setSelectQuery(const SelectQueryDescription & select_)
|
|
|
|
{
|
|
|
|
select = select_;
|
|
|
|
}
|
|
|
|
|
2020-02-14 13:17:50 +00:00
|
|
|
}
|