Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
8ad04d4f
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,发现更多精彩内容 >>
提交
8ad04d4f
编写于
4月 15, 2020
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove useless code
上级
4110130e
变更
37
隐藏空白更改
内联
并排
Showing
37 changed file
with
84 addition
and
140 deletion
+84
-140
src/DataStreams/ConvertingBlockInputStream.cpp
src/DataStreams/ConvertingBlockInputStream.cpp
+5
-6
src/DataStreams/ConvertingBlockInputStream.h
src/DataStreams/ConvertingBlockInputStream.h
+0
-2
src/DataStreams/PushingToViewsBlockOutputStream.cpp
src/DataStreams/PushingToViewsBlockOutputStream.cpp
+1
-1
src/DataStreams/RemoteBlockInputStream.cpp
src/DataStreams/RemoteBlockInputStream.cpp
+4
-4
src/Dictionaries/ClickHouseDictionarySource.cpp
src/Dictionaries/ClickHouseDictionarySource.cpp
+3
-3
src/Functions/FunctionsComparison.h
src/Functions/FunctionsComparison.h
+2
-2
src/Functions/FunctionsRound.h
src/Functions/FunctionsRound.h
+3
-7
src/Functions/array/array.cpp
src/Functions/array/array.cpp
+3
-11
src/Functions/array/arrayConcat.cpp
src/Functions/array/arrayConcat.cpp
+2
-6
src/Functions/array/arrayIntersect.cpp
src/Functions/array/arrayIntersect.cpp
+4
-4
src/Functions/array/arrayPush.h
src/Functions/array/arrayPush.h
+4
-5
src/Functions/array/arrayPushBack.cpp
src/Functions/array/arrayPushBack.cpp
+2
-2
src/Functions/array/arrayPushFront.cpp
src/Functions/array/arrayPushFront.cpp
+2
-2
src/Functions/array/arrayResize.cpp
src/Functions/array/arrayResize.cpp
+3
-7
src/Functions/array/hasAll.cpp
src/Functions/array/hasAll.cpp
+2
-2
src/Functions/array/hasAllAny.h
src/Functions/array/hasAllAny.h
+3
-4
src/Functions/array/hasAny.cpp
src/Functions/array/hasAny.cpp
+2
-2
src/Functions/array/range.cpp
src/Functions/array/range.cpp
+3
-5
src/Functions/if.cpp
src/Functions/if.cpp
+3
-6
src/Functions/multiIf.cpp
src/Functions/multiIf.cpp
+2
-6
src/Functions/neighbor.cpp
src/Functions/neighbor.cpp
+3
-8
src/Interpreters/ClusterProxy/SelectStreamFactory.cpp
src/Interpreters/ClusterProxy/SelectStreamFactory.cpp
+2
-3
src/Interpreters/InterpreterInsertQuery.cpp
src/Interpreters/InterpreterInsertQuery.cpp
+1
-1
src/Interpreters/InterpreterSelectQuery.cpp
src/Interpreters/InterpreterSelectQuery.cpp
+2
-2
src/Interpreters/InterpreterSelectWithUnionQuery.cpp
src/Interpreters/InterpreterSelectWithUnionQuery.cpp
+2
-2
src/Interpreters/castColumn.cpp
src/Interpreters/castColumn.cpp
+0
-5
src/Interpreters/castColumn.h
src/Interpreters/castColumn.h
+0
-3
src/Processors/QueryPipeline.cpp
src/Processors/QueryPipeline.cpp
+5
-5
src/Processors/QueryPipeline.h
src/Processors/QueryPipeline.h
+1
-1
src/Processors/Transforms/ConvertingTransform.cpp
src/Processors/Transforms/ConvertingTransform.cpp
+5
-8
src/Processors/Transforms/ConvertingTransform.h
src/Processors/Transforms/ConvertingTransform.h
+1
-4
src/Storages/Distributed/DistributedBlockOutputStream.cpp
src/Storages/Distributed/DistributedBlockOutputStream.cpp
+4
-4
src/Storages/Kafka/KafkaBlockInputStream.cpp
src/Storages/Kafka/KafkaBlockInputStream.cpp
+0
-1
src/Storages/MergeTree/MergeTreeIndexConditionBloomFilter.cpp
...Storages/MergeTree/MergeTreeIndexConditionBloomFilter.cpp
+1
-1
src/Storages/StorageBuffer.cpp
src/Storages/StorageBuffer.cpp
+2
-2
src/Storages/StorageMerge.cpp
src/Storages/StorageMerge.cpp
+1
-2
src/Storages/StorageView.cpp
src/Storages/StorageView.cpp
+1
-1
未找到文件。
src/DataStreams/ConvertingBlockInputStream.cpp
浏览文件 @
8ad04d4f
...
...
@@ -17,11 +17,11 @@ namespace ErrorCodes
}
static
ColumnPtr
castColumnWithDiagnostic
(
const
ColumnWithTypeAndName
&
src_elem
,
const
ColumnWithTypeAndName
&
res_elem
,
const
Context
&
context
)
static
ColumnPtr
castColumnWithDiagnostic
(
const
ColumnWithTypeAndName
&
src_elem
,
const
ColumnWithTypeAndName
&
res_elem
)
{
try
{
return
castColumn
(
src_elem
,
res_elem
.
type
,
context
);
return
castColumn
(
src_elem
,
res_elem
.
type
);
}
catch
(
Exception
&
e
)
{
...
...
@@ -32,11 +32,10 @@ static ColumnPtr castColumnWithDiagnostic(const ColumnWithTypeAndName & src_elem
ConvertingBlockInputStream
::
ConvertingBlockInputStream
(
const
Context
&
context_
,
const
BlockInputStreamPtr
&
input
,
const
Block
&
result_header
,
MatchColumnsMode
mode
)
:
context
(
context_
),
header
(
result_header
),
conversion
(
header
.
columns
())
:
header
(
result_header
),
conversion
(
header
.
columns
())
{
children
.
emplace_back
(
input
);
...
...
@@ -85,7 +84,7 @@ ConvertingBlockInputStream::ConvertingBlockInputStream(
/// Check conversion by dry run CAST function.
castColumnWithDiagnostic
(
src_elem
,
res_elem
,
context
);
castColumnWithDiagnostic
(
src_elem
,
res_elem
);
}
}
...
...
@@ -107,7 +106,7 @@ Block ConvertingBlockInputStream::readImpl()
const
auto
&
src_elem
=
src
.
getByPosition
(
conversion
[
res_pos
]);
auto
&
res_elem
=
res
.
getByPosition
(
res_pos
);
ColumnPtr
converted
=
castColumnWithDiagnostic
(
src_elem
,
res_elem
,
context
);
ColumnPtr
converted
=
castColumnWithDiagnostic
(
src_elem
,
res_elem
);
if
(
isColumnConst
(
*
src_elem
.
column
)
&&
!
isColumnConst
(
*
res_elem
.
column
))
converted
=
converted
->
convertToFullColumnIfConst
();
...
...
src/DataStreams/ConvertingBlockInputStream.h
浏览文件 @
8ad04d4f
...
...
@@ -32,7 +32,6 @@ public:
};
ConvertingBlockInputStream
(
const
Context
&
context
,
const
BlockInputStreamPtr
&
input
,
const
Block
&
result_header
,
MatchColumnsMode
mode
);
...
...
@@ -43,7 +42,6 @@ public:
private:
Block
readImpl
()
override
;
const
Context
&
context
;
Block
header
;
/// How to construct result block. Position in source block, where to get each column.
...
...
src/DataStreams/PushingToViewsBlockOutputStream.cpp
浏览文件 @
8ad04d4f
...
...
@@ -250,7 +250,7 @@ void PushingToViewsBlockOutputStream::process(const Block & block, size_t view_n
/// and two-level aggregation is triggered).
in
=
std
::
make_shared
<
SquashingBlockInputStream
>
(
in
,
context
.
getSettingsRef
().
min_insert_block_size_rows
,
context
.
getSettingsRef
().
min_insert_block_size_bytes
);
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
context
,
in
,
view
.
out
->
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
);
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
in
,
view
.
out
->
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
);
}
else
in
=
std
::
make_shared
<
OneBlockInputStream
>
(
block
);
...
...
src/DataStreams/RemoteBlockInputStream.cpp
浏览文件 @
8ad04d4f
...
...
@@ -177,7 +177,7 @@ void RemoteBlockInputStream::sendExternalTables()
/** If we receive a block with slightly different column types, or with excessive columns,
* we will adapt it to expected structure.
*/
static
Block
adaptBlockStructure
(
const
Block
&
block
,
const
Block
&
header
,
const
Context
&
context
)
static
Block
adaptBlockStructure
(
const
Block
&
block
,
const
Block
&
header
)
{
/// Special case when reader doesn't care about result structure. Deprecated and used only in Benchmark, PerformanceTest.
if
(
!
header
)
...
...
@@ -204,7 +204,7 @@ static Block adaptBlockStructure(const Block & block, const Block & header, cons
auto
col
=
block
.
getByName
(
elem
.
name
);
col
.
column
=
block
.
getByName
(
elem
.
name
).
column
->
cut
(
0
,
1
);
column
=
castColumn
(
col
,
elem
.
type
,
context
);
column
=
castColumn
(
col
,
elem
.
type
);
if
(
!
isColumnConst
(
*
column
))
column
=
ColumnConst
::
create
(
column
,
block
.
rows
());
...
...
@@ -216,7 +216,7 @@ static Block adaptBlockStructure(const Block & block, const Block & header, cons
column
=
elem
.
column
->
cloneResized
(
block
.
rows
());
}
else
column
=
castColumn
(
block
.
getByName
(
elem
.
name
),
elem
.
type
,
context
);
column
=
castColumn
(
block
.
getByName
(
elem
.
name
),
elem
.
type
);
res
.
insert
({
column
,
elem
.
type
,
elem
.
name
});
}
...
...
@@ -246,7 +246,7 @@ Block RemoteBlockInputStream::readImpl()
case
Protocol
::
Server
::
Data
:
/// If the block is not empty and is not a header block
if
(
packet
.
block
&&
(
packet
.
block
.
rows
()
>
0
))
return
adaptBlockStructure
(
packet
.
block
,
header
,
context
);
return
adaptBlockStructure
(
packet
.
block
,
header
);
break
;
/// If the block is empty - we will receive other packets before EndOfStream.
case
Protocol
::
Server
::
Exception
:
...
...
src/Dictionaries/ClickHouseDictionarySource.cpp
浏览文件 @
8ad04d4f
...
...
@@ -132,7 +132,7 @@ BlockInputStreamPtr ClickHouseDictionarySource::loadAll()
{
BlockIO
res
=
executeQuery
(
load_all_query
,
context
,
true
);
/// FIXME res.in may implicitly use some objects owned be res, but them will be destructed after return
res
.
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
context
,
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
res
.
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
return
res
.
in
;
}
return
std
::
make_shared
<
RemoteBlockInputStream
>
(
pool
,
load_all_query
,
sample_block
,
context
);
...
...
@@ -144,7 +144,7 @@ BlockInputStreamPtr ClickHouseDictionarySource::loadUpdatedAll()
if
(
is_local
)
{
auto
res
=
executeQuery
(
load_update_query
,
context
,
true
);
res
.
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
context
,
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
res
.
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
return
res
.
in
;
}
return
std
::
make_shared
<
RemoteBlockInputStream
>
(
pool
,
load_update_query
,
sample_block
,
context
);
...
...
@@ -192,7 +192,7 @@ BlockInputStreamPtr ClickHouseDictionarySource::createStreamForSelectiveLoad(con
{
auto
res
=
executeQuery
(
query
,
context
,
true
);
res
.
in
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
context
,
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
res
.
in
,
sample_block
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
return
res
.
in
;
}
...
...
src/Functions/FunctionsComparison.h
浏览文件 @
8ad04d4f
...
...
@@ -1105,8 +1105,8 @@ private:
{
DataTypePtr
common_type
=
getLeastSupertype
({
c0
.
type
,
c1
.
type
});
ColumnPtr
c0_converted
=
castColumn
(
c0
,
common_type
,
context
);
ColumnPtr
c1_converted
=
castColumn
(
c1
,
common_type
,
context
);
ColumnPtr
c0_converted
=
castColumn
(
c0
,
common_type
);
ColumnPtr
c1_converted
=
castColumn
(
c1
,
common_type
);
executeGenericIdenticalTypes
(
block
,
result
,
c0_converted
.
get
(),
c1_converted
.
get
());
}
...
...
src/Functions/FunctionsRound.h
浏览文件 @
8ad04d4f
...
...
@@ -596,8 +596,7 @@ class FunctionRoundDown : public IFunction
{
public:
static
constexpr
auto
name
=
"roundDown"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionRoundDown
>
(
context
);
}
FunctionRoundDown
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionRoundDown
>
();
}
public:
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -645,10 +644,10 @@ public:
auto
out
=
column_result
.
get
();
if
(
!
in_type
->
equals
(
*
return_type
))
in_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
,
context
);
in_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
);
if
(
!
array_type
->
equals
(
*
return_type
))
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
1
]),
std
::
make_shared
<
DataTypeArray
>
(
return_type
)
,
context
);
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
1
]),
std
::
make_shared
<
DataTypeArray
>
(
return_type
));
const
auto
in
=
in_column
.
get
();
auto
boundaries
=
typeid_cast
<
const
ColumnConst
&>
(
*
array_column
).
getValue
<
Array
>
();
...
...
@@ -764,9 +763,6 @@ private:
}
}
}
private:
const
Context
&
context
;
};
...
...
src/Functions/array/array.cpp
浏览文件 @
8ad04d4f
...
...
@@ -14,14 +14,9 @@ class FunctionArray : public IFunction
{
public:
static
constexpr
auto
name
=
"array"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArray
>
(
context
);
}
explicit
FunctionArray
(
const
Context
&
context_
)
:
context
(
context_
)
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArray
>
();
}
bool
useDefaultImplementationForNulls
()
const
override
{
return
false
;
}
...
...
@@ -67,7 +62,7 @@ public:
ColumnPtr
preprocessed_column
=
arg
.
column
;
if
(
!
arg
.
type
->
equals
(
*
elem_type
))
preprocessed_column
=
castColumn
(
arg
,
elem_type
,
context
);
preprocessed_column
=
castColumn
(
arg
,
elem_type
);
preprocessed_column
=
preprocessed_column
->
convertToFullColumnIfConst
();
...
...
@@ -104,9 +99,6 @@ private:
}
bool
addField
(
DataTypePtr
type_res
,
const
Field
&
f
,
Array
&
arr
)
const
;
private:
const
Context
&
context
;
};
...
...
src/Functions/array/arrayConcat.cpp
浏览文件 @
8ad04d4f
...
...
@@ -26,8 +26,7 @@ class FunctionArrayConcat : public IFunction
{
public:
static
constexpr
auto
name
=
"arrayConcat"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayConcat
>
(
context
);
}
explicit
FunctionArrayConcat
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayConcat
>
();
}
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -73,7 +72,7 @@ public:
ColumnPtr
preprocessed_column
=
arg
.
column
;
if
(
!
arg
.
type
->
equals
(
*
return_type
))
preprocessed_column
=
castColumn
(
arg
,
return_type
,
context
);
preprocessed_column
=
castColumn
(
arg
,
return_type
);
preprocessed_columns
[
i
]
=
std
::
move
(
preprocessed_column
);
}
...
...
@@ -103,9 +102,6 @@ public:
}
bool
useDefaultImplementationForConstants
()
const
override
{
return
true
;
}
private:
const
Context
&
context
;
};
...
...
src/Functions/array/arrayIntersect.cpp
浏览文件 @
8ad04d4f
...
...
@@ -245,7 +245,7 @@ FunctionArrayIntersect::CastArgumentsResult FunctionArrayIntersect::castColumns(
{
if
(
!
arg
.
type
->
equals
(
*
return_type
))
{
column
.
column
=
castColumn
(
arg
,
return_type
,
context
);
column
.
column
=
castColumn
(
arg
,
return_type
);
column
.
type
=
return_type
;
}
}
...
...
@@ -258,12 +258,12 @@ FunctionArrayIntersect::CastArgumentsResult FunctionArrayIntersect::castColumns(
/// because cannot cast Nullable(T) to T.
if
(
static_cast
<
const
DataTypeArray
&>
(
*
arg
.
type
).
getNestedType
()
->
isNullable
())
{
column
.
column
=
castColumn
(
arg
,
nullable_return_type
,
context
);
column
.
column
=
castColumn
(
arg
,
nullable_return_type
);
column
.
type
=
nullable_return_type
;
}
else
{
column
.
column
=
castColumn
(
arg
,
return_type
,
context
);
column
.
column
=
castColumn
(
arg
,
return_type
);
column
.
type
=
return_type
;
}
}
...
...
@@ -274,7 +274,7 @@ FunctionArrayIntersect::CastArgumentsResult FunctionArrayIntersect::castColumns(
/// return_type_with_nulls is the most common subtype with possible nullable parts.
if
(
!
arg
.
type
->
equals
(
*
return_type_with_nulls
))
{
column
.
column
=
castColumn
(
arg
,
return_type_with_nulls
,
context
);
column
.
column
=
castColumn
(
arg
,
return_type_with_nulls
);
column
.
type
=
return_type_with_nulls
;
}
}
...
...
src/Functions/array/arrayPush.h
浏览文件 @
8ad04d4f
...
...
@@ -21,8 +21,8 @@ namespace ErrorCodes
class
FunctionArrayPush
:
public
IFunction
{
public:
FunctionArrayPush
(
const
Context
&
context_
,
bool
push_front_
,
const
char
*
name_
)
:
context
(
context_
),
push_front
(
push_front_
),
name
(
name_
)
{}
FunctionArrayPush
(
bool
push_front_
,
const
char
*
name_
)
:
push_front
(
push_front_
),
name
(
name_
)
{}
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -62,11 +62,11 @@ public:
auto
appended_column
=
block
.
getByPosition
(
arguments
[
1
]).
column
;
if
(
!
block
.
getByPosition
(
arguments
[
0
]).
type
->
equals
(
*
return_type
))
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
,
context
);
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
);
const
DataTypePtr
&
return_nested_type
=
typeid_cast
<
const
DataTypeArray
&>
(
*
return_type
).
getNestedType
();
if
(
!
block
.
getByPosition
(
arguments
[
1
]).
type
->
equals
(
*
return_nested_type
))
appended_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
1
]),
return_nested_type
,
context
);
appended_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
1
]),
return_nested_type
);
std
::
unique_ptr
<
GatherUtils
::
IArraySource
>
array_source
;
std
::
unique_ptr
<
GatherUtils
::
IValueSource
>
value_source
;
...
...
@@ -106,7 +106,6 @@ public:
bool
useDefaultImplementationForNulls
()
const
override
{
return
false
;
}
private:
const
Context
&
context
;
bool
push_front
;
const
char
*
name
;
};
...
...
src/Functions/array/arrayPushBack.cpp
浏览文件 @
8ad04d4f
...
...
@@ -9,8 +9,8 @@ class FunctionArrayPushBack : public FunctionArrayPush
{
public:
static
constexpr
auto
name
=
"arrayPushBack"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayPushBack
>
(
context
);
}
explicit
FunctionArrayPushBack
(
const
Context
&
context_
)
:
FunctionArrayPush
(
context_
,
false
,
name
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayPushBack
>
(
);
}
FunctionArrayPushBack
()
:
FunctionArrayPush
(
false
,
name
)
{}
};
void
registerFunctionArrayPushBack
(
FunctionFactory
&
factory
)
...
...
src/Functions/array/arrayPushFront.cpp
浏览文件 @
8ad04d4f
...
...
@@ -10,8 +10,8 @@ class FunctionArrayPushFront : public FunctionArrayPush
{
public:
static
constexpr
auto
name
=
"arrayPushFront"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayPushFront
>
(
context
);
}
explicit
FunctionArrayPushFront
(
const
Context
&
context_
)
:
FunctionArrayPush
(
context_
,
true
,
name
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayPushFront
>
(
);
}
FunctionArrayPushFront
()
:
FunctionArrayPush
(
true
,
name
)
{}
};
...
...
src/Functions/array/arrayResize.cpp
浏览文件 @
8ad04d4f
...
...
@@ -25,8 +25,7 @@ class FunctionArrayResize : public IFunction
{
public:
static
constexpr
auto
name
=
"arrayResize"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayResize
>
(
context
);
}
explicit
FunctionArrayResize
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayResize
>
();
}
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -80,7 +79,7 @@ public:
auto
size_column
=
block
.
getByPosition
(
arguments
[
1
]).
column
;
if
(
!
block
.
getByPosition
(
arguments
[
0
]).
type
->
equals
(
*
return_type
))
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
,
context
);
array_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
0
]),
return_type
);
const
DataTypePtr
&
return_nested_type
=
typeid_cast
<
const
DataTypeArray
&>
(
*
return_type
).
getNestedType
();
size_t
size
=
array_column
->
size
();
...
...
@@ -90,7 +89,7 @@ public:
{
appended_column
=
block
.
getByPosition
(
arguments
[
2
]).
column
;
if
(
!
block
.
getByPosition
(
arguments
[
2
]).
type
->
equals
(
*
return_nested_type
))
appended_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
2
]),
return_nested_type
,
context
);
appended_column
=
castColumn
(
block
.
getByPosition
(
arguments
[
2
]),
return_nested_type
);
}
else
appended_column
=
return_nested_type
->
createColumnConstWithDefaultValue
(
size
);
...
...
@@ -133,9 +132,6 @@ public:
bool
useDefaultImplementationForConstants
()
const
override
{
return
true
;
}
bool
useDefaultImplementationForNulls
()
const
override
{
return
false
;
}
private:
const
Context
&
context
;
};
...
...
src/Functions/array/hasAll.cpp
浏览文件 @
8ad04d4f
...
...
@@ -9,8 +9,8 @@ class FunctionArrayHasAll : public FunctionArrayHasAllAny
{
public:
static
constexpr
auto
name
=
"hasAll"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayHasAll
>
(
context
);
}
explicit
FunctionArrayHasAll
(
const
Context
&
context_
)
:
FunctionArrayHasAllAny
(
context_
,
true
,
name
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayHasAll
>
(
);
}
FunctionArrayHasAll
()
:
FunctionArrayHasAllAny
(
true
,
name
)
{}
};
void
registerFunctionHasAll
(
FunctionFactory
&
factory
)
...
...
src/Functions/array/hasAllAny.h
浏览文件 @
8ad04d4f
...
...
@@ -27,8 +27,8 @@ namespace ErrorCodes
class
FunctionArrayHasAllAny
:
public
IFunction
{
public:
FunctionArrayHasAllAny
(
const
Context
&
context_
,
bool
all_
,
const
char
*
name_
)
:
context
(
context_
),
all
(
all_
),
name
(
name_
)
{}
FunctionArrayHasAllAny
(
bool
all_
,
const
char
*
name_
)
:
all
(
all_
),
name
(
name_
)
{}
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -81,7 +81,7 @@ public:
/// Converts Array(Nothing) or Array(Nullable(Nothing) to common type. Example: hasAll([Null, 1], [Null]) -> 1
if
(
typeid_cast
<
const
DataTypeNothing
*>
(
removeNullable
(
nested_type
).
get
()))
preprocessed_column
=
castColumn
(
argument
,
commonType
()
,
context
);
preprocessed_column
=
castColumn
(
argument
,
commonType
());
preprocessed_columns
[
i
]
=
std
::
move
(
preprocessed_column
);
}
...
...
@@ -114,7 +114,6 @@ public:
bool
useDefaultImplementationForConstants
()
const
override
{
return
true
;
}
private:
const
Context
&
context
;
bool
all
;
const
char
*
name
;
};
...
...
src/Functions/array/hasAny.cpp
浏览文件 @
8ad04d4f
...
...
@@ -9,8 +9,8 @@ class FunctionArrayHasAny : public FunctionArrayHasAllAny
{
public:
static
constexpr
auto
name
=
"hasAny"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionArrayHasAny
>
(
context
);
}
explicit
FunctionArrayHasAny
(
const
Context
&
context_
)
:
FunctionArrayHasAllAny
(
context_
,
false
,
name
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionArrayHasAny
>
(
);
}
FunctionArrayHasAny
()
:
FunctionArrayHasAllAny
(
false
,
name
)
{}
};
void
registerFunctionHasAny
(
FunctionFactory
&
factory
)
...
...
src/Functions/array/range.cpp
浏览文件 @
8ad04d4f
...
...
@@ -27,11 +27,9 @@ class FunctionRange : public IFunction
public:
static
constexpr
auto
name
=
"range"
;
static
constexpr
size_t
max_elements
=
100'000'000
;
static
FunctionPtr
create
(
const
Context
&
context_
)
{
return
std
::
make_shared
<
FunctionRange
>
(
context_
);
}
explicit
FunctionRange
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionRange
>
();
}
private:
const
Context
&
context
;
String
getName
()
const
override
{
return
name
;
}
size_t
getNumberOfArguments
()
const
override
{
return
0
;
}
...
...
@@ -347,9 +345,9 @@ private:
for
(
size_t
i
=
0
;
i
<
arguments
.
size
();
++
i
)
{
if
(
i
==
1
)
columns_holder
[
i
]
=
castColumn
(
block
.
getByPosition
(
arguments
[
i
]),
return_type
,
context
)
->
convertToFullColumnIfConst
();
columns_holder
[
i
]
=
castColumn
(
block
.
getByPosition
(
arguments
[
i
]),
return_type
)
->
convertToFullColumnIfConst
();
else
columns_holder
[
i
]
=
castColumn
(
block
.
getByPosition
(
arguments
[
i
]),
return_type
,
context
);
columns_holder
[
i
]
=
castColumn
(
block
.
getByPosition
(
arguments
[
i
]),
return_type
);
columns
[
i
]
=
columns_holder
[
i
].
get
();
}
...
...
src/Functions/if.cpp
浏览文件 @
8ad04d4f
...
...
@@ -172,8 +172,7 @@ class FunctionIf : public FunctionIfBase</*null_is_false=*/false>
{
public:
static
constexpr
auto
name
=
"if"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionIf
>
(
context
);
}
explicit
FunctionIf
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionIf
>
();
}
private:
template
<
typename
T0
,
typename
T1
>
...
...
@@ -600,8 +599,8 @@ private:
DataTypePtr
common_type
=
getLeastSupertype
({
arg1
.
type
,
arg2
.
type
});
ColumnPtr
col_then
=
castColumn
(
arg1
,
common_type
,
context
);
ColumnPtr
col_else
=
castColumn
(
arg2
,
common_type
,
context
);
ColumnPtr
col_then
=
castColumn
(
arg1
,
common_type
);
ColumnPtr
col_else
=
castColumn
(
arg2
,
common_type
);
MutableColumnPtr
result_column
=
common_type
->
createColumn
();
result_column
->
reserve
(
input_rows_count
);
...
...
@@ -988,8 +987,6 @@ public:
executeGeneric
(
cond_col
,
block
,
arguments
,
result
,
input_rows_count
);
}
}
const
Context
&
context
;
};
void
registerFunctionIf
(
FunctionFactory
&
factory
)
...
...
src/Functions/multiIf.cpp
浏览文件 @
8ad04d4f
...
...
@@ -33,8 +33,7 @@ class FunctionMultiIf final : public FunctionIfBase</*null_is_false=*/true>
{
public:
static
constexpr
auto
name
=
"multiIf"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionMultiIf
>
(
context
);
}
explicit
FunctionMultiIf
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionMultiIf
>
();
}
public:
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -176,7 +175,7 @@ public:
else
{
/// Cast all columns to result type.
converted_columns_holder
.
emplace_back
(
castColumn
(
source_col
,
return_type
,
context
));
converted_columns_holder
.
emplace_back
(
castColumn
(
source_col
,
return_type
));
instruction
.
source
=
converted_columns_holder
.
back
().
get
();
}
...
...
@@ -225,9 +224,6 @@ public:
block
.
getByPosition
(
result
).
column
=
std
::
move
(
res
);
}
private:
const
Context
&
context
;
};
void
registerFunctionMultiIf
(
FunctionFactory
&
factory
)
...
...
src/Functions/neighbor.cpp
浏览文件 @
8ad04d4f
...
...
@@ -27,9 +27,7 @@ class FunctionNeighbor : public IFunction
{
public:
static
constexpr
auto
name
=
"neighbor"
;
static
FunctionPtr
create
(
const
Context
&
context
)
{
return
std
::
make_shared
<
FunctionNeighbor
>
(
context
);
}
explicit
FunctionNeighbor
(
const
Context
&
context_
)
:
context
(
context_
)
{}
static
FunctionPtr
create
(
const
Context
&
)
{
return
std
::
make_shared
<
FunctionNeighbor
>
();
}
/// Get the name of the function.
String
getName
()
const
override
{
return
name
;
}
...
...
@@ -83,14 +81,14 @@ public:
const
ColumnWithTypeAndName
&
offset_elem
=
block
.
getByPosition
(
arguments
[
1
]);
bool
has_defaults
=
arguments
.
size
()
==
3
;
ColumnPtr
source_column_casted
=
castColumn
(
source_elem
,
result_type
,
context
);
ColumnPtr
source_column_casted
=
castColumn
(
source_elem
,
result_type
);
ColumnPtr
offset_column
=
offset_elem
.
column
;
ColumnPtr
default_column_casted
;
if
(
has_defaults
)
{
const
ColumnWithTypeAndName
&
default_elem
=
block
.
getByPosition
(
arguments
[
2
]);
default_column_casted
=
castColumn
(
default_elem
,
result_type
,
context
);
default_column_casted
=
castColumn
(
default_elem
,
result_type
);
}
bool
source_is_constant
=
isColumnConst
(
*
source_column_casted
);
...
...
@@ -181,9 +179,6 @@ public:
block
.
getByPosition
(
result
).
column
=
std
::
move
(
result_column
);
}
}
private:
const
Context
&
context
;
};
void
registerFunctionNeighbor
(
FunctionFactory
&
factory
)
...
...
src/Interpreters/ClusterProxy/SelectStreamFactory.cpp
浏览文件 @
8ad04d4f
...
...
@@ -11,7 +11,6 @@
#include <TableFunctions/TableFunctionFactory.h>
#include <common/logger_useful.h>
#include <DataStreams/ConvertingBlockInputStream.h>
#include <Processors/Pipe.h>
#include <Processors/Transforms/ConvertingTransform.h>
#include <Processors/Sources/SourceFromInputStream.h>
...
...
@@ -94,7 +93,7 @@ Pipe createLocalStream(const ASTPtr & query_ast, const Block & header, const Con
Pipe
pipe
(
std
::
move
(
source
));
pipe
.
addSimpleTransform
(
std
::
make_shared
<
ConvertingTransform
>
(
pipe
.
getHeader
(),
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
,
context
));
pipe
.
getHeader
(),
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
));
return
pipe
;
}
...
...
@@ -104,7 +103,7 @@ Pipe createLocalStream(const ASTPtr & query_ast, const Block & header, const Con
pipeline
.
addSimpleTransform
([
&
](
const
Block
&
source_header
)
{
return
std
::
make_shared
<
ConvertingTransform
>
(
source_header
,
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
,
context
);
source_header
,
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
);
});
/** Materialization is needed, since from remote servers the constants come materialized.
...
...
src/Interpreters/InterpreterInsertQuery.cpp
浏览文件 @
8ad04d4f
...
...
@@ -252,7 +252,7 @@ BlockIO InterpreterInsertQuery::execute()
for
(
auto
&
in_stream
:
in_streams
)
{
in_stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
context
,
in_stream
,
out_streams
.
at
(
0
)
->
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
in_stream
,
out_streams
.
at
(
0
)
->
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
}
Block
in_header
=
in_streams
.
at
(
0
)
->
getHeader
();
...
...
src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
8ad04d4f
...
...
@@ -1550,7 +1550,7 @@ void InterpreterSelectQuery::executeFetchColumns(
auto
header
=
stream
->
getHeader
();
auto
mode
=
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
;
if
(
!
blocksHaveEqualStructure
(
first_header
,
header
))
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
*
context
,
stream
,
first_header
,
mode
);
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
stream
,
first_header
,
mode
);
}
}
...
...
@@ -2591,7 +2591,7 @@ void InterpreterSelectQuery::unifyStreams(Pipeline & pipeline, Block header)
auto
mode
=
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
;
if
(
!
blocksHaveEqualStructure
(
header
,
stream_header
))
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
*
context
,
stream
,
header
,
mode
);
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
stream
,
header
,
mode
);
}
}
...
...
src/Interpreters/InterpreterSelectWithUnionQuery.cpp
浏览文件 @
8ad04d4f
...
...
@@ -193,7 +193,7 @@ BlockInputStreams InterpreterSelectWithUnionQuery::executeWithMultipleStreams(Qu
if
(
nested_interpreters
.
size
()
>
1
)
{
for
(
auto
&
stream
:
nested_streams
)
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
*
context
,
stream
,
result_header
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
stream
=
std
::
make_shared
<
ConvertingBlockInputStream
>
(
stream
,
result_header
,
ConvertingBlockInputStream
::
MatchColumnsMode
::
Position
);
parent_pipeline
.
addInterpreterContext
(
context
);
}
...
...
@@ -269,7 +269,7 @@ QueryPipeline InterpreterSelectWithUnionQuery::executeWithProcessors()
if
(
!
pipelines
.
empty
())
{
auto
common_header
=
getCommonHeaderForUnion
(
headers
);
main_pipeline
.
unitePipelines
(
std
::
move
(
pipelines
),
common_header
,
*
context
);
main_pipeline
.
unitePipelines
(
std
::
move
(
pipelines
),
common_header
);
}
main_pipeline
.
addInterpreterContext
(
context
);
...
...
src/Interpreters/castColumn.cpp
浏览文件 @
8ad04d4f
...
...
@@ -38,9 +38,4 @@ ColumnPtr castColumn(const ColumnWithTypeAndName & arg, const DataTypePtr & type
return
temporary_block
.
getByPosition
(
2
).
column
;
}
ColumnPtr
castColumn
(
const
ColumnWithTypeAndName
&
arg
,
const
DataTypePtr
&
type
,
const
Context
&
)
{
return
castColumn
(
arg
,
type
);
}
}
src/Interpreters/castColumn.h
浏览文件 @
8ad04d4f
#pragma once
#include <Core/ColumnWithTypeAndName.h>
#include <Interpreters/Context.h>
namespace
DB
{
ColumnPtr
castColumn
(
const
ColumnWithTypeAndName
&
arg
,
const
DataTypePtr
&
type
);
ColumnPtr
castColumn
(
const
ColumnWithTypeAndName
&
arg
,
const
DataTypePtr
&
type
,
const
Context
&
context
);
}
src/Processors/QueryPipeline.cpp
浏览文件 @
8ad04d4f
...
...
@@ -505,14 +505,14 @@ void QueryPipeline::setOutput(ProcessorPtr output)
}
void
QueryPipeline
::
unitePipelines
(
std
::
vector
<
QueryPipeline
>
&&
pipelines
,
const
Block
&
common_header
,
const
Context
&
context
)
std
::
vector
<
QueryPipeline
>
&&
pipelines
,
const
Block
&
common_header
)
{
checkInitialized
();
addSimpleTransform
([
&
](
const
Block
&
header
)
{
return
std
::
make_shared
<
ConvertingTransform
>
(
header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
,
context
);
header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
);
});
std
::
vector
<
OutputPort
*>
extremes
;
...
...
@@ -531,13 +531,13 @@ void QueryPipeline::unitePipelines(
pipeline
.
addSimpleTransform
([
&
](
const
Block
&
header
)
{
return
std
::
make_shared
<
ConvertingTransform
>
(
header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
,
context
);
header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
);
});
if
(
pipeline
.
extremes_port
)
{
auto
converting
=
std
::
make_shared
<
ConvertingTransform
>
(
pipeline
.
current_header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
,
context
);
pipeline
.
current_header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
);
connect
(
*
pipeline
.
extremes_port
,
converting
->
getInputPort
());
extremes
.
push_back
(
&
converting
->
getOutputPort
());
...
...
@@ -548,7 +548,7 @@ void QueryPipeline::unitePipelines(
if
(
pipeline
.
totals_having_port
)
{
auto
converting
=
std
::
make_shared
<
ConvertingTransform
>
(
pipeline
.
current_header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
,
context
);
pipeline
.
current_header
,
common_header
,
ConvertingTransform
::
MatchColumnsMode
::
Position
);
connect
(
*
pipeline
.
totals_having_port
,
converting
->
getInputPort
());
totals
.
push_back
(
&
converting
->
getOutputPort
());
...
...
src/Processors/QueryPipeline.h
浏览文件 @
8ad04d4f
...
...
@@ -121,7 +121,7 @@ public:
void
enableQuotaForCurrentStreams
();
void
unitePipelines
(
std
::
vector
<
QueryPipeline
>
&&
pipelines
,
const
Block
&
common_header
,
const
Context
&
context
);
void
unitePipelines
(
std
::
vector
<
QueryPipeline
>
&&
pipelines
,
const
Block
&
common_header
);
PipelineExecutorPtr
execute
();
...
...
src/Processors/Transforms/ConvertingTransform.cpp
浏览文件 @
8ad04d4f
...
...
@@ -18,12 +18,11 @@ namespace ErrorCodes
static
ColumnPtr
castColumnWithDiagnostic
(
const
ColumnWithTypeAndName
&
src_elem
,
const
ColumnWithTypeAndName
&
res_elem
,
const
Context
&
context
)
const
ColumnWithTypeAndName
&
res_elem
)
{
try
{
return
castColumn
(
src_elem
,
res_elem
.
type
,
context
);
return
castColumn
(
src_elem
,
res_elem
.
type
);
}
catch
(
Exception
&
e
)
{
...
...
@@ -36,10 +35,8 @@ static ColumnPtr castColumnWithDiagnostic(
ConvertingTransform
::
ConvertingTransform
(
Block
source_header_
,
Block
result_header_
,
MatchColumnsMode
mode_
,
const
Context
&
context_
)
MatchColumnsMode
mode_
)
:
ISimpleTransform
(
std
::
move
(
source_header_
),
std
::
move
(
result_header_
),
false
)
,
context
(
context_
)
,
conversion
(
getOutputPort
().
getHeader
().
columns
())
{
auto
&
source
=
getInputPort
().
getHeader
();
...
...
@@ -91,7 +88,7 @@ ConvertingTransform::ConvertingTransform(
/// Check conversion by dry run CAST function.
castColumnWithDiagnostic
(
src_elem
,
res_elem
,
context
);
castColumnWithDiagnostic
(
src_elem
,
res_elem
);
}
}
...
...
@@ -114,7 +111,7 @@ void ConvertingTransform::transform(Chunk & chunk)
src_elem
.
column
=
src_columns
[
conversion
[
res_pos
]];
auto
res_elem
=
result
.
getByPosition
(
res_pos
);
ColumnPtr
converted
=
castColumnWithDiagnostic
(
src_elem
,
res_elem
,
context
);
ColumnPtr
converted
=
castColumnWithDiagnostic
(
src_elem
,
res_elem
);
if
(
!
isColumnConst
(
*
res_elem
.
column
))
converted
=
converted
->
convertToFullColumnIfConst
();
...
...
src/Processors/Transforms/ConvertingTransform.h
浏览文件 @
8ad04d4f
...
...
@@ -31,8 +31,7 @@ public:
ConvertingTransform
(
Block
source_header_
,
Block
result_header_
,
MatchColumnsMode
mode_
,
const
Context
&
context_
);
MatchColumnsMode
mode_
);
String
getName
()
const
override
{
return
"Converting"
;
}
...
...
@@ -40,8 +39,6 @@ protected:
void
transform
(
Chunk
&
chunk
)
override
;
private:
const
Context
&
context
;
/// How to construct result block. Position in source block, where to get each column.
ColumnNumbers
conversion
;
};
...
...
src/Storages/Distributed/DistributedBlockOutputStream.cpp
浏览文件 @
8ad04d4f
...
...
@@ -61,11 +61,11 @@ namespace ErrorCodes
extern
const
int
CANNOT_LINK
;
}
static
void
writeBlockConvert
(
const
Context
&
context
,
const
BlockOutputStreamPtr
&
out
,
const
Block
&
block
,
const
size_t
repeats
)
static
void
writeBlockConvert
(
const
BlockOutputStreamPtr
&
out
,
const
Block
&
block
,
const
size_t
repeats
)
{
if
(
!
blocksHaveEqualStructure
(
out
->
getHeader
(),
block
))
{
ConvertingBlockInputStream
convert
(
context
,
ConvertingBlockInputStream
convert
(
std
::
make_shared
<
OneBlockInputStream
>
(
block
),
out
->
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
);
...
...
@@ -333,7 +333,7 @@ ThreadPool::Job DistributedBlockOutputStream::runWritingJob(DistributedBlockOutp
job
.
stream
->
writePrefix
();
}
writeBlockConvert
(
context
,
job
.
stream
,
shard_block
,
shard_info
.
getLocalNodeCount
());
writeBlockConvert
(
job
.
stream
,
shard_block
,
shard_info
.
getLocalNodeCount
());
}
job
.
blocks_written
+=
1
;
...
...
@@ -568,7 +568,7 @@ void DistributedBlockOutputStream::writeToLocal(const Block & block, const size_
auto
block_io
=
interp
.
execute
();
block_io
.
out
->
writePrefix
();
writeBlockConvert
(
context
,
block_io
.
out
,
block
,
repeats
);
writeBlockConvert
(
block_io
.
out
,
block
,
repeats
);
block_io
.
out
->
writeSuffix
();
}
...
...
src/Storages/Kafka/KafkaBlockInputStream.cpp
浏览文件 @
8ad04d4f
...
...
@@ -190,7 +190,6 @@ Block KafkaBlockInputStream::readImpl()
result_block
.
insert
(
column
);
return
ConvertingBlockInputStream
(
context
,
std
::
make_shared
<
OneBlockInputStream
>
(
result_block
),
getHeader
(),
ConvertingBlockInputStream
::
MatchColumnsMode
::
Name
)
...
...
src/Storages/MergeTree/MergeTreeIndexConditionBloomFilter.cpp
浏览文件 @
8ad04d4f
...
...
@@ -259,7 +259,7 @@ bool MergeTreeIndexConditionBloomFilter::traverseASTIn(
size_t
row_size
=
column
->
size
();
size_t
position
=
header
.
getPositionByName
(
key_ast
->
getColumnName
());
const
DataTypePtr
&
index_type
=
header
.
getByPosition
(
position
).
type
;
const
auto
&
converted_column
=
castColumn
(
ColumnWithTypeAndName
{
column
,
type
,
""
},
index_type
,
context
);
const
auto
&
converted_column
=
castColumn
(
ColumnWithTypeAndName
{
column
,
type
,
""
},
index_type
);
out
.
predicate
.
emplace_back
(
std
::
make_pair
(
position
,
BloomFilterHash
::
hashWithColumn
(
index_type
,
converted_column
,
0
,
row_size
)));
if
(
function_name
==
"in"
||
function_name
==
"globalIn"
)
...
...
src/Storages/StorageBuffer.cpp
浏览文件 @
8ad04d4f
...
...
@@ -225,7 +225,7 @@ Pipes StorageBuffer::read(
pipe
.
getHeader
(),
header_after_adding_defaults
,
getColumns
().
getDefaults
(),
context
));
pipe
.
addSimpleTransform
(
std
::
make_shared
<
ConvertingTransform
>
(
pipe
.
getHeader
(),
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
,
context
));
pipe
.
getHeader
(),
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
));
}
}
}
...
...
@@ -663,7 +663,7 @@ void StorageBuffer::writeBlockToDestination(const Block & block, StoragePtr tabl
<<
" have different type of column "
<<
backQuoteIfNeed
(
column
.
name
)
<<
" ("
<<
dst_col
.
type
->
getName
()
<<
" != "
<<
column
.
type
->
getName
()
<<
"). Block of data is converted."
);
column
.
column
=
castColumn
(
column
,
dst_col
.
type
,
global_context
);
column
.
column
=
castColumn
(
column
,
dst_col
.
type
);
column
.
type
=
dst_col
.
type
;
}
...
...
src/Storages/StorageMerge.cpp
浏览文件 @
8ad04d4f
...
...
@@ -2,7 +2,6 @@
#include <DataStreams/narrowBlockInputStreams.h>
#include <DataStreams/LazyBlockInputStream.h>
#include <DataStreams/NullBlockInputStream.h>
#include <DataStreams/ConvertingBlockInputStream.h>
#include <DataStreams/OneBlockInputStream.h>
#include <DataStreams/ConcatBlockInputStream.h>
#include <DataStreams/materializeBlock.h>
...
...
@@ -478,7 +477,7 @@ void StorageMerge::convertingSourceStream(const Block & header, const Context &
Pipe
&
pipe
,
QueryProcessingStage
::
Enum
processed_stage
)
{
Block
before_block_header
=
pipe
.
getHeader
();
pipe
.
addSimpleTransform
(
std
::
make_shared
<
ConvertingTransform
>
(
before_block_header
,
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
,
context
));
pipe
.
addSimpleTransform
(
std
::
make_shared
<
ConvertingTransform
>
(
before_block_header
,
header
,
ConvertingTransform
::
MatchColumnsMode
::
Name
));
auto
where_expression
=
query
->
as
<
ASTSelectQuery
>
()
->
where
();
...
...
src/Storages/StorageView.cpp
浏览文件 @
8ad04d4f
...
...
@@ -83,7 +83,7 @@ Pipes StorageView::read(
/// And also convert to expected structure.
pipe
.
addSimpleTransform
(
std
::
make_shared
<
ConvertingTransform
>
(
pipe
.
getHeader
(),
getSampleBlockForColumns
(
column_names
),
ConvertingTransform
::
MatchColumnsMode
::
Name
,
context
));
ConvertingTransform
::
MatchColumnsMode
::
Name
));
}
return
pipes
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录