Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
cb486da9
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,发现更多精彩内容 >>
未验证
提交
cb486da9
编写于
3月 29, 2019
作者:
A
alexey-milovidov
提交者:
GitHub
3月 29, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4852 from zhang2014/improvement/const_interpreter
Const context for insert interpreter
上级
b8a7d78e
aab314f1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
7 deletion
+9
-7
dbms/src/DataStreams/InputStreamFromASTInsertQuery.cpp
dbms/src/DataStreams/InputStreamFromASTInsertQuery.cpp
+1
-3
dbms/src/DataStreams/InputStreamFromASTInsertQuery.h
dbms/src/DataStreams/InputStreamFromASTInsertQuery.h
+1
-1
dbms/src/Interpreters/InterpreterInsertQuery.cpp
dbms/src/Interpreters/InterpreterInsertQuery.cpp
+1
-1
dbms/src/Interpreters/InterpreterInsertQuery.h
dbms/src/Interpreters/InterpreterInsertQuery.h
+2
-2
dbms/src/Interpreters/executeQuery.cpp
dbms/src/Interpreters/executeQuery.cpp
+4
-0
未找到文件。
dbms/src/DataStreams/InputStreamFromASTInsertQuery.cpp
浏览文件 @
cb486da9
...
...
@@ -18,7 +18,7 @@ namespace ErrorCodes
InputStreamFromASTInsertQuery
::
InputStreamFromASTInsertQuery
(
const
ASTPtr
&
ast
,
ReadBuffer
*
input_buffer_tail_part
,
const
Block
&
header
,
Context
&
context
)
const
ASTPtr
&
ast
,
ReadBuffer
*
input_buffer_tail_part
,
const
Block
&
header
,
const
Context
&
context
)
{
const
auto
*
ast_insert_query
=
ast
->
as
<
ASTInsertQuery
>
();
...
...
@@ -28,8 +28,6 @@ InputStreamFromASTInsertQuery::InputStreamFromASTInsertQuery(
String
format
=
ast_insert_query
->
format
;
if
(
format
.
empty
())
format
=
"Values"
;
if
(
ast_insert_query
->
settings_ast
)
InterpreterSetQuery
(
ast_insert_query
->
settings_ast
,
context
).
executeForCurrentContext
();
/// Data could be in parsed (ast_insert_query.data) and in not parsed yet (input_buffer_tail_part) part of query.
...
...
dbms/src/DataStreams/InputStreamFromASTInsertQuery.h
浏览文件 @
cb486da9
...
...
@@ -19,7 +19,7 @@ class Context;
class
InputStreamFromASTInsertQuery
:
public
IBlockInputStream
{
public:
InputStreamFromASTInsertQuery
(
const
ASTPtr
&
ast
,
ReadBuffer
*
input_buffer_tail_part
,
const
Block
&
header
,
Context
&
context
);
InputStreamFromASTInsertQuery
(
const
ASTPtr
&
ast
,
ReadBuffer
*
input_buffer_tail_part
,
const
Block
&
header
,
const
Context
&
context
);
Block
readImpl
()
override
{
return
res_stream
->
read
();
}
void
readPrefixImpl
()
override
{
return
res_stream
->
readPrefix
();
}
...
...
dbms/src/Interpreters/InterpreterInsertQuery.cpp
浏览文件 @
cb486da9
...
...
@@ -36,7 +36,7 @@ namespace ErrorCodes
InterpreterInsertQuery
::
InterpreterInsertQuery
(
const
ASTPtr
&
query_ptr_
,
Context
&
context_
,
bool
allow_materialized_
)
const
ASTPtr
&
query_ptr_
,
const
Context
&
context_
,
bool
allow_materialized_
)
:
query_ptr
(
query_ptr_
),
context
(
context_
),
allow_materialized
(
allow_materialized_
)
{
}
...
...
dbms/src/Interpreters/InterpreterInsertQuery.h
浏览文件 @
cb486da9
...
...
@@ -15,7 +15,7 @@ namespace DB
class
InterpreterInsertQuery
:
public
IInterpreter
{
public:
InterpreterInsertQuery
(
const
ASTPtr
&
query_ptr_
,
Context
&
context_
,
bool
allow_materialized_
=
false
);
InterpreterInsertQuery
(
const
ASTPtr
&
query_ptr_
,
const
Context
&
context_
,
bool
allow_materialized_
=
false
);
/** Prepare a request for execution. Return block streams
* - the stream into which you can write data to execute the query, if INSERT;
...
...
@@ -32,7 +32,7 @@ private:
void
checkAccess
(
const
ASTInsertQuery
&
query
);
ASTPtr
query_ptr
;
Context
&
context
;
const
Context
&
context
;
bool
allow_materialized
;
};
...
...
dbms/src/Interpreters/executeQuery.cpp
浏览文件 @
cb486da9
...
...
@@ -170,6 +170,10 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
ast
=
parseQuery
(
parser
,
begin
,
end
,
""
,
max_query_size
);
auto
*
insert_query
=
ast
->
as
<
ASTInsertQuery
>
();
if
(
insert_query
&&
insert_query
->
settings_ast
)
InterpreterSetQuery
(
insert_query
->
settings_ast
,
context
).
executeForCurrentContext
();
if
(
insert_query
&&
insert_query
->
data
)
{
query_end
=
insert_query
->
data
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录