Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
0dd06118
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0dd06118
编写于
5月 03, 2019
作者:
A
alexey-milovidov
提交者:
GitHub
5月 03, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5173 from yandex/rename-method
Rename method for consistency
上级
9e3c80d2
270a31ab
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
26 addition
and
26 deletion
+26
-26
dbms/src/Interpreters/InterpreterCreateQuery.cpp
dbms/src/Interpreters/InterpreterCreateQuery.cpp
+1
-1
dbms/src/Storages/IStorage.cpp
dbms/src/Storages/IStorage.cpp
+1
-1
dbms/src/Storages/ITableDeclaration.cpp
dbms/src/Storages/ITableDeclaration.cpp
+1
-1
dbms/src/Storages/ITableDeclaration.h
dbms/src/Storages/ITableDeclaration.h
+2
-2
dbms/src/Storages/MergeTree/MergeTreeData.cpp
dbms/src/Storages/MergeTree/MergeTreeData.cpp
+6
-6
dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp
...src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp
+1
-1
dbms/src/Storages/MergeTree/ReplicatedMergeTreeTableMetadata.cpp
...c/Storages/MergeTree/ReplicatedMergeTreeTableMetadata.cpp
+1
-1
dbms/src/Storages/StorageBuffer.cpp
dbms/src/Storages/StorageBuffer.cpp
+1
-1
dbms/src/Storages/StorageDistributed.cpp
dbms/src/Storages/StorageDistributed.cpp
+1
-1
dbms/src/Storages/StorageMerge.cpp
dbms/src/Storages/StorageMerge.cpp
+1
-1
dbms/src/Storages/StorageMergeTree.cpp
dbms/src/Storages/StorageMergeTree.cpp
+3
-3
dbms/src/Storages/StorageMergeTree.h
dbms/src/Storages/StorageMergeTree.h
+2
-2
dbms/src/Storages/StorageNull.cpp
dbms/src/Storages/StorageNull.cpp
+1
-1
dbms/src/Storages/StorageReplicatedMergeTree.cpp
dbms/src/Storages/StorageReplicatedMergeTree.cpp
+4
-4
未找到文件。
dbms/src/Interpreters/InterpreterCreateQuery.cpp
浏览文件 @
0dd06118
...
...
@@ -383,7 +383,7 @@ ColumnsDescription InterpreterCreateQuery::setColumns(
else
if
(
!
create
.
as_table
.
empty
())
{
columns
=
as_storage
->
getColumns
();
indices
=
as_storage
->
getIndices
Description
();
indices
=
as_storage
->
getIndices
();
}
else
if
(
create
.
select
)
{
...
...
dbms/src/Storages/IStorage.cpp
浏览文件 @
0dd06118
...
...
@@ -15,7 +15,7 @@ void IStorage::alter(const AlterCommands & params, const String & database_name,
lockStructureExclusively
(
table_lock_holder
,
context
.
getCurrentQueryId
());
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
database_name
)
->
alterTable
(
context
,
table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
std
::
move
(
new_columns
));
...
...
dbms/src/Storages/ITableDeclaration.cpp
浏览文件 @
0dd06118
...
...
@@ -31,7 +31,7 @@ void ITableDeclaration::setColumns(ColumnsDescription columns_)
columns
=
std
::
move
(
columns_
);
}
void
ITableDeclaration
::
setIndices
Description
(
IndicesDescription
indices_
)
void
ITableDeclaration
::
setIndices
(
IndicesDescription
indices_
)
{
indices
=
std
::
move
(
indices_
);
}
...
...
dbms/src/Storages/ITableDeclaration.h
浏览文件 @
0dd06118
...
...
@@ -16,8 +16,8 @@ public:
virtual
const
ColumnsDescription
&
getColumns
()
const
{
return
columns
;
}
virtual
void
setColumns
(
ColumnsDescription
columns_
);
virtual
const
IndicesDescription
&
getIndices
Description
()
const
{
return
indices
;
}
virtual
void
setIndices
Description
(
IndicesDescription
indices_
);
virtual
const
IndicesDescription
&
getIndices
()
const
{
return
indices
;
}
virtual
void
setIndices
(
IndicesDescription
indices_
);
/// NOTE: These methods should include virtual columns, but should NOT include ALIAS columns
/// (they are treated separately).
...
...
dbms/src/Storages/MergeTree/MergeTreeData.cpp
浏览文件 @
0dd06118
...
...
@@ -420,7 +420,7 @@ void MergeTreeData::setPrimaryKeyIndicesAndColumns(
primary_key_sample
=
std
::
move
(
new_primary_key_sample
);
primary_key_data_types
=
std
::
move
(
new_primary_key_data_types
);
setIndices
Description
(
indices_description
);
setIndices
(
indices_description
);
skip_indices
=
std
::
move
(
new_indices
);
primary_key_and_skip_indices_expr
=
new_indices_with_primary_key_expr
;
...
...
@@ -1177,13 +1177,13 @@ void MergeTreeData::checkAlter(const AlterCommands & commands, const Context & c
{
/// Check that needed transformations can be applied to the list of columns without considering type conversions.
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
ASTPtr
new_order_by_ast
=
order_by_ast
;
ASTPtr
new_primary_key_ast
=
primary_key_ast
;
ASTPtr
new_ttl_table_ast
=
ttl_table_ast
;
commands
.
apply
(
new_columns
,
new_indices
,
new_order_by_ast
,
new_primary_key_ast
,
new_ttl_table_ast
);
if
(
getIndices
Description
().
empty
()
&&
!
new_indices
.
empty
()
&&
if
(
getIndices
().
empty
()
&&
!
new_indices
.
empty
()
&&
!
context
.
getSettingsRef
().
allow_experimental_data_skipping_indices
)
throw
Exception
(
"You must set the setting `allow_experimental_data_skipping_indices` to 1 "
\
"before using data skipping indices."
,
ErrorCodes
::
BAD_ARGUMENTS
);
...
...
@@ -1274,7 +1274,7 @@ void MergeTreeData::checkAlter(const AlterCommands & commands, const Context & c
NameToNameMap
unused_map
;
bool
unused_bool
;
createConvertExpression
(
nullptr
,
getColumns
().
getAllPhysical
(),
new_columns
.
getAllPhysical
(),
getIndices
Description
().
indices
,
new_indices
.
indices
,
unused_expression
,
unused_map
,
unused_bool
);
getIndices
().
indices
,
new_indices
.
indices
,
unused_expression
,
unused_map
,
unused_bool
);
}
void
MergeTreeData
::
createConvertExpression
(
const
DataPartPtr
&
part
,
const
NamesAndTypesList
&
old_columns
,
const
NamesAndTypesList
&
new_columns
,
...
...
@@ -1445,7 +1445,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart(
AlterDataPartTransactionPtr
transaction
(
new
AlterDataPartTransaction
(
part
));
/// Blocks changes to the part.
bool
force_update_metadata
;
createConvertExpression
(
part
,
part
->
columns
,
new_columns
,
getIndices
Description
().
indices
,
new_indices
,
getIndices
().
indices
,
new_indices
,
expression
,
transaction
->
rename_map
,
force_update_metadata
);
size_t
num_files_to_modify
=
transaction
->
rename_map
.
size
();
...
...
@@ -1597,7 +1597,7 @@ void MergeTreeData::removeEmptyColumnsFromPart(MergeTreeData::MutableDataPartPtr
LOG_INFO
(
log
,
"Removing empty columns: "
<<
log_message
.
str
()
<<
" from part "
<<
data_part
->
name
);
if
(
auto
transaction
=
alterDataPart
(
data_part
,
new_columns
,
getIndices
Description
().
indices
,
false
))
if
(
auto
transaction
=
alterDataPart
(
data_part
,
new_columns
,
getIndices
().
indices
,
false
))
transaction
->
commit
();
empty_columns
.
clear
();
}
...
...
dbms/src/Storages/MergeTree/ReplicatedMergeTreeAlterThread.cpp
浏览文件 @
0dd06118
...
...
@@ -143,7 +143,7 @@ void ReplicatedMergeTreeAlterThread::run()
parts
=
storage
.
data
.
getDataParts
();
const
auto
columns_for_parts
=
storage
.
getColumns
().
getAllPhysical
();
const
auto
indices_for_parts
=
storage
.
getIndices
Description
();
const
auto
indices_for_parts
=
storage
.
getIndices
();
for
(
const
MergeTreeData
::
DataPartPtr
&
part
:
parts
)
{
...
...
dbms/src/Storages/MergeTree/ReplicatedMergeTreeTableMetadata.cpp
浏览文件 @
0dd06118
...
...
@@ -45,7 +45,7 @@ ReplicatedMergeTreeTableMetadata::ReplicatedMergeTreeTableMetadata(const MergeTr
if
(
data
.
format_version
>=
MERGE_TREE_DATA_MIN_FORMAT_VERSION_WITH_CUSTOM_PARTITIONING
)
partition_key
=
formattedAST
(
MergeTreeData
::
extractKeyExpressionList
(
data
.
partition_by_ast
));
skip_indices
=
data
.
getIndices
Description
().
toString
();
skip_indices
=
data
.
getIndices
().
toString
();
index_granularity_bytes
=
data
.
index_granularity_info
.
index_granularity_bytes
;
ttl_table
=
formattedAST
(
data
.
ttl_table_ast
);
}
...
...
dbms/src/Storages/StorageBuffer.cpp
浏览文件 @
0dd06118
...
...
@@ -700,7 +700,7 @@ void StorageBuffer::alter(const AlterCommands & params, const String & database_
optimize
({}
/*query*/
,
{}
/*partition_id*/
,
false
/*final*/
,
false
/*deduplicate*/
,
context
);
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
database_name
)
->
alterTable
(
context
,
table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
std
::
move
(
new_columns
));
...
...
dbms/src/Storages/StorageDistributed.cpp
浏览文件 @
0dd06118
...
...
@@ -344,7 +344,7 @@ void StorageDistributed::alter(
lockStructureExclusively
(
table_lock_holder
,
context
.
getCurrentQueryId
());
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
database_name
)
->
alterTable
(
context
,
current_table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
std
::
move
(
new_columns
));
...
...
dbms/src/Storages/StorageMerge.cpp
浏览文件 @
0dd06118
...
...
@@ -402,7 +402,7 @@ void StorageMerge::alter(
lockStructureExclusively
(
table_lock_holder
,
context
.
getCurrentQueryId
());
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
database_name
)
->
alterTable
(
context
,
table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
new_columns
);
...
...
dbms/src/Storages/StorageMergeTree.cpp
浏览文件 @
0dd06118
...
...
@@ -204,7 +204,7 @@ void StorageMergeTree::alter(
{
lockStructureExclusively
(
table_lock_holder
,
context
.
getCurrentQueryId
());
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
current_database_name
)
->
alterTable
(
context
,
current_table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
std
::
move
(
new_columns
));
...
...
@@ -219,7 +219,7 @@ void StorageMergeTree::alter(
data
.
checkAlter
(
params
,
context
);
auto
new_columns
=
data
.
getColumns
();
auto
new_indices
=
data
.
getIndices
Description
();
auto
new_indices
=
data
.
getIndices
();
ASTPtr
new_order_by_ast
=
data
.
order_by_ast
;
ASTPtr
new_primary_key_ast
=
data
.
primary_key_ast
;
ASTPtr
new_ttl_table_ast
=
data
.
ttl_table_ast
;
...
...
@@ -800,7 +800,7 @@ void StorageMergeTree::clearColumnInPartition(const ASTPtr & partition, const Fi
alter_command
.
column_name
=
get
<
String
>
(
column_name
);
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
ASTPtr
ignored_order_by_ast
;
ASTPtr
ignored_primary_key_ast
;
ASTPtr
ignored_ttl_table_ast
;
...
...
dbms/src/Storages/StorageMergeTree.h
浏览文件 @
0dd06118
...
...
@@ -43,8 +43,8 @@ public:
const
ColumnsDescription
&
getColumns
()
const
override
{
return
data
.
getColumns
();
}
void
setColumns
(
ColumnsDescription
columns_
)
override
{
return
data
.
setColumns
(
std
::
move
(
columns_
));
}
virtual
const
IndicesDescription
&
getIndices
Description
()
const
override
{
return
data
.
getIndicesDescription
();
}
virtual
void
setIndices
Description
(
IndicesDescription
indices_
)
override
{
data
.
setIndicesDescription
(
std
::
move
(
indices_
));
}
virtual
const
IndicesDescription
&
getIndices
()
const
override
{
return
data
.
getIndices
();
}
virtual
void
setIndices
(
IndicesDescription
indices_
)
override
{
data
.
setIndices
(
std
::
move
(
indices_
));
}
NameAndTypePair
getColumn
(
const
String
&
column_name
)
const
override
{
return
data
.
getColumn
(
column_name
);
}
bool
hasColumn
(
const
String
&
column_name
)
const
override
{
return
data
.
hasColumn
(
column_name
);
}
...
...
dbms/src/Storages/StorageNull.cpp
浏览文件 @
0dd06118
...
...
@@ -37,7 +37,7 @@ void StorageNull::alter(
lockStructureExclusively
(
table_lock_holder
,
context
.
getCurrentQueryId
());
ColumnsDescription
new_columns
=
getColumns
();
IndicesDescription
new_indices
=
getIndices
Description
();
IndicesDescription
new_indices
=
getIndices
();
params
.
apply
(
new_columns
);
context
.
getDatabase
(
current_database_name
)
->
alterTable
(
context
,
current_table_name
,
new_columns
,
new_indices
,
{});
setColumns
(
std
::
move
(
new_columns
));
...
...
dbms/src/Storages/StorageReplicatedMergeTree.cpp
浏览文件 @
0dd06118
...
...
@@ -426,7 +426,7 @@ void StorageReplicatedMergeTree::setTableStructure(ColumnsDescription new_column
{
ASTPtr
new_primary_key_ast
=
data
.
primary_key_ast
;
ASTPtr
new_order_by_ast
=
data
.
order_by_ast
;
auto
new_indices
=
data
.
getIndices
Description
();
auto
new_indices
=
data
.
getIndices
();
ASTPtr
new_ttl_table_ast
=
data
.
ttl_table_ast
;
IDatabase
::
ASTModifier
storage_modifier
;
if
(
!
metadata_diff
.
empty
())
...
...
@@ -1511,7 +1511,7 @@ void StorageReplicatedMergeTree::executeClearColumnInPartition(const LogEntry &
alter_command
.
column_name
=
entry
.
column_name
;
auto
new_columns
=
getColumns
();
auto
new_indices
=
getIndices
Description
();
auto
new_indices
=
getIndices
();
ASTPtr
ignored_order_by_ast
;
ASTPtr
ignored_primary_key_ast
;
ASTPtr
ignored_ttl_table_ast
;
...
...
@@ -3117,7 +3117,7 @@ void StorageReplicatedMergeTree::alter(
data
.
checkAlter
(
params
,
query_context
);
ColumnsDescription
new_columns
=
data
.
getColumns
();
IndicesDescription
new_indices
=
data
.
getIndices
Description
();
IndicesDescription
new_indices
=
data
.
getIndices
();
ASTPtr
new_order_by_ast
=
data
.
order_by_ast
;
ASTPtr
new_primary_key_ast
=
data
.
primary_key_ast
;
ASTPtr
new_ttl_table_ast
=
data
.
ttl_table_ast
;
...
...
@@ -3135,7 +3135,7 @@ void StorageReplicatedMergeTree::alter(
new_metadata
.
ttl_table
=
serializeAST
(
*
new_ttl_table_ast
);
String
new_indices_str
=
new_indices
.
toString
();
if
(
new_indices_str
!=
data
.
getIndices
Description
().
toString
())
if
(
new_indices_str
!=
data
.
getIndices
().
toString
())
new_metadata
.
skip_indices
=
new_indices_str
;
String
new_metadata_str
=
new_metadata
.
toString
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录