Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
23e2d17d
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,发现更多精彩内容 >>
提交
23e2d17d
编写于
8月 09, 2019
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added JSONEachRowWithProgressRowOutputFormat.
上级
2ae3db79
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
65 addition
and
48 deletion
+65
-48
dbms/src/Formats/JSONEachRowWithProgressRowOutputStream.cpp
dbms/src/Formats/JSONEachRowWithProgressRowOutputStream.cpp
+0
-47
dbms/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h
.../src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h
+2
-1
dbms/src/Processors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.cpp
...s/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.cpp
+43
-0
dbms/src/Processors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.h
...ors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.h
+20
-0
未找到文件。
dbms/src/Formats/JSONEachRowWithProgressRowOutputStream.cpp
已删除
100644 → 0
浏览文件 @
2ae3db79
#include <IO/WriteHelpers.h>
#include <IO/WriteBufferValidUTF8.h>
#include <Formats/JSONEachRowWithProgressRowOutputStream.h>
#include <Formats/FormatFactory.h>
#include <Formats/BlockOutputStreamFromRowOutputStream.h>
namespace
DB
{
void
JSONEachRowWithProgressRowOutputStream
::
writeRowStartDelimiter
()
{
writeCString
(
"{
\"
row
\"
:{"
,
ostr
);
}
void
JSONEachRowWithProgressRowOutputStream
::
writeRowEndDelimiter
()
{
writeCString
(
"}}
\n
"
,
ostr
);
field_number
=
0
;
}
void
JSONEachRowWithProgressRowOutputStream
::
onProgress
(
const
Progress
&
value
)
{
progress
.
incrementPiecewiseAtomically
(
value
);
writeCString
(
"{
\"
progress
\"
:"
,
ostr
);
progress
.
writeJSON
(
ostr
);
writeCString
(
"}
\n
"
,
ostr
);
}
void
registerOutputFormatJSONEachRowWithProgress
(
FormatFactory
&
factory
)
{
factory
.
registerOutputFormat
(
"JSONEachRowWithProgress"
,
[](
WriteBuffer
&
buf
,
const
Block
&
sample
,
const
Context
&
,
const
FormatSettings
&
format_settings
)
{
return
std
::
make_shared
<
BlockOutputStreamFromRowOutputStream
>
(
std
::
make_shared
<
JSONEachRowWithProgressRowOutputStream
>
(
buf
,
sample
,
format_settings
),
sample
);
});
}
}
dbms/src/Processors/Formats/Impl/JSONEachRowRowOutputFormat.h
浏览文件 @
23e2d17d
...
...
@@ -29,8 +29,9 @@ protected:
void
consumeTotals
(
Chunk
)
override
{}
void
consumeExtremes
(
Chunk
)
override
{}
private:
size_t
field_number
=
0
;
private:
Names
fields
;
FormatSettings
settings
;
...
...
dbms/src/Processors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.cpp
0 → 100644
浏览文件 @
23e2d17d
#include <IO/WriteHelpers.h>
#include <IO/WriteBufferValidUTF8.h>
#include <Processors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat.h>
#include <Formats/FormatFactory.h>
namespace
DB
{
void
JSONEachRowWithProgressRowOutputFormat
::
writeRowStartDelimiter
()
{
writeCString
(
"{
\"
row
\"
:{"
,
out
);
}
void
JSONEachRowWithProgressRowOutputFormat
::
writeRowEndDelimiter
()
{
writeCString
(
"}}
\n
"
,
out
);
field_number
=
0
;
}
void
JSONEachRowWithProgressRowOutputFormat
::
onProgress
(
const
Progress
&
value
)
{
progress
.
incrementPiecewiseAtomically
(
value
);
writeCString
(
"{
\"
progress
\"
:"
,
out
);
progress
.
writeJSON
(
out
);
writeCString
(
"}
\n
"
,
out
);
}
void
registerOutputFormatProcessorJSONEachRow
(
FormatFactory
&
factory
)
{
factory
.
registerOutputFormatProcessor
(
"JSONEachRowWithProgress"
,
[](
WriteBuffer
&
buf
,
const
Block
&
sample
,
const
Context
&
,
const
FormatSettings
&
format_settings
)
{
return
std
::
make_shared
<
JSONEachRowWithProgressRowOutputFormat
>
(
buf
,
sample
,
format_settings
);
});
}
}
dbms/src/
Formats/JSONEachRowWithProgressRowOutputStream
.h
→
dbms/src/
Processors/Formats/Impl/JSONEachRowWithProgressRowOutputFormat
.h
浏览文件 @
23e2d17d
#pragma once
#include <IO/Progress.h>
#include <Formats/JSONEachRowRowOutputStream.h>
#include <Processors/Formats/Impl/JSONEachRowRowOutputFormat.h>
namespace
DB
{
/** The stream for outputting data in JSON format, by object per line
* that includes progress rows. Does not validate UTF-8.
*/
class
JSONEachRowWithProgressRowOutputStream
:
public
JSONEachRowRowOutputStream
class
JSONEachRowWithProgressRowOutputFormat
:
public
JSONEachRowRowOutputFormat
{
public:
using
JSONEachRowRowOutput
Stream
::
JSONEachRowRowOutputStream
;
using
JSONEachRowRowOutput
Format
::
JSONEachRowRowOutputFormat
;
void
writeRowStartDelimiter
()
override
;
void
writeRowEndDelimiter
()
override
;
...
...
@@ -24,4 +18,3 @@ private:
};
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录