Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
4e3a0f0a
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,发现更多精彩内容 >>
提交
4e3a0f0a
编写于
2月 21, 2018
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed error [#CLICKHOUSE-2]
上级
aad0c62e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
45 addition
and
33 deletion
+45
-33
dbms/src/Interpreters/Aggregator.cpp
dbms/src/Interpreters/Aggregator.cpp
+2
-1
dbms/src/Interpreters/InterpreterSelectQuery.cpp
dbms/src/Interpreters/InterpreterSelectQuery.cpp
+43
-32
未找到文件。
dbms/src/Interpreters/Aggregator.cpp
浏览文件 @
4e3a0f0a
...
...
@@ -14,6 +14,7 @@
#include <DataStreams/IProfilingBlockInputStream.h>
#include <DataStreams/NativeBlockOutputStream.h>
#include <DataStreams/NullBlockInputStream.h>
#include <DataStreams/materializeBlock.h>
#include <IO/WriteBufferFromFile.h>
#include <IO/CompressedWriteBuffer.h>
...
...
@@ -130,7 +131,7 @@ Block Aggregator::getHeader(bool final) const
}
}
return
res
;
return
materializeBlock
(
res
)
;
}
...
...
dbms/src/Interpreters/InterpreterSelectQuery.cpp
浏览文件 @
4e3a0f0a
...
...
@@ -64,6 +64,7 @@ namespace ErrorCodes
extern
const
int
ILLEGAL_FINAL
;
extern
const
int
ILLEGAL_PREWHERE
;
extern
const
int
TOO_MUCH_COLUMNS
;
extern
const
int
LOGICAL_ERROR
;
}
...
...
@@ -329,7 +330,8 @@ Block InterpreterSelectQuery::getSampleBlock()
{
Pipeline
pipeline
;
executeWithoutUnionImpl
(
pipeline
,
std
::
make_shared
<
OneBlockInputStream
>
(
source_header
));
return
pipeline
.
firstStream
()
->
getHeader
();
auto
res
=
pipeline
.
firstStream
()
->
getHeader
();
return
res
;
}
...
...
@@ -785,9 +787,20 @@ QueryProcessingStage::Enum InterpreterSelectQuery::executeFetchColumns(Pipeline
query_analyzer
->
makeSetsForIndex
();
/// Initialize the initial data streams to which the query transforms are superimposed. Table or subquery?
if
(
!
interpreter_subquery
)
/// Initialize the initial data streams to which the query transforms are superimposed. Table or subquery or prepared input?
if
(
!
pipeline
.
streams
.
empty
())
{
/// Prepared input.
}
else
if
(
interpreter_subquery
)
{
/// Subquery.
interpreter_subquery
->
executeWithoutUnionImpl
(
pipeline
,
{});
}
else
if
(
storage
)
{
/// Table.
if
(
max_streams
==
0
)
throw
Exception
(
"Logical error: zero number of streams requested"
,
ErrorCodes
::
LOGICAL_ERROR
);
...
...
@@ -834,39 +847,37 @@ QueryProcessingStage::Enum InterpreterSelectQuery::executeFetchColumns(Pipeline
{
stream
->
addTableLock
(
table_lock
);
});
}
else
{
interpreter_subquery
->
executeWithoutUnionImpl
(
pipeline
,
input
);
}
/** Set the limits and quota for reading data, the speed and time of the query.
* Such restrictions are checked on the initiating server of the request, and not on remote servers.
* Because the initiating server has a summary of the execution of the request on all servers.
*/
if
(
storage
&&
to_stage
==
QueryProcessingStage
::
Complete
)
{
IProfilingBlockInputStream
::
LocalLimits
limits
;
limits
.
mode
=
IProfilingBlockInputStream
::
LIMITS_TOTAL
;
limits
.
max_rows_to_read
=
settings
.
limits
.
max_rows_to_read
;
limits
.
max_bytes_to_read
=
settings
.
limits
.
max_bytes_to_read
;
limits
.
read_overflow_mode
=
settings
.
limits
.
read_overflow_mode
;
limits
.
max_execution_time
=
settings
.
limits
.
max_execution_time
;
limits
.
timeout_overflow_mode
=
settings
.
limits
.
timeout_overflow_mode
;
limits
.
min_execution_speed
=
settings
.
limits
.
min_execution_speed
;
limits
.
timeout_before_checking_execution_speed
=
settings
.
limits
.
timeout_before_checking_execution_speed
;
QuotaForIntervals
&
quota
=
context
.
getQuota
();
pipeline
.
transform
([
&
](
auto
&
stream
)
/** Set the limits and quota for reading data, the speed and time of the query.
* Such restrictions are checked on the initiating server of the request, and not on remote servers.
* Because the initiating server has a summary of the execution of the request on all servers.
*/
if
(
to_stage
==
QueryProcessingStage
::
Complete
)
{
if
(
IProfilingBlockInputStream
*
p_stream
=
dynamic_cast
<
IProfilingBlockInputStream
*>
(
stream
.
get
()))
IProfilingBlockInputStream
::
LocalLimits
limits
;
limits
.
mode
=
IProfilingBlockInputStream
::
LIMITS_TOTAL
;
limits
.
max_rows_to_read
=
settings
.
limits
.
max_rows_to_read
;
limits
.
max_bytes_to_read
=
settings
.
limits
.
max_bytes_to_read
;
limits
.
read_overflow_mode
=
settings
.
limits
.
read_overflow_mode
;
limits
.
max_execution_time
=
settings
.
limits
.
max_execution_time
;
limits
.
timeout_overflow_mode
=
settings
.
limits
.
timeout_overflow_mode
;
limits
.
min_execution_speed
=
settings
.
limits
.
min_execution_speed
;
limits
.
timeout_before_checking_execution_speed
=
settings
.
limits
.
timeout_before_checking_execution_speed
;
QuotaForIntervals
&
quota
=
context
.
getQuota
();
pipeline
.
transform
([
&
](
auto
&
stream
)
{
p_stream
->
setLimits
(
limits
);
p_stream
->
setQuota
(
quota
);
}
});
if
(
IProfilingBlockInputStream
*
p_stream
=
dynamic_cast
<
IProfilingBlockInputStream
*>
(
stream
.
get
()))
{
p_stream
->
setLimits
(
limits
);
p_stream
->
setQuota
(
quota
);
}
});
}
}
else
throw
Exception
(
"Logical error in InterpreterSelectQuery: nowhere to read"
,
ErrorCodes
::
LOGICAL_ERROR
);
return
from_stage
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录