Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
ddbfe0ce
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,发现更多精彩内容 >>
提交
ddbfe0ce
编写于
8月 18, 2020
作者:
H
hexiaoting
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deprecate ODBCDriver format
上级
17eb8d24
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
0 addition
and
130 deletion
+0
-130
src/Formats/FormatFactory.cpp
src/Formats/FormatFactory.cpp
+0
-1
src/Formats/FormatFactory.h
src/Formats/FormatFactory.h
+0
-1
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.cpp
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.cpp
+0
-79
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.h
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.h
+0
-48
src/Processors/ya.make
src/Processors/ya.make
+0
-1
未找到文件。
src/Formats/FormatFactory.cpp
浏览文件 @
ddbfe0ce
...
...
@@ -381,7 +381,6 @@ FormatFactory::FormatFactory()
registerOutputFormatProcessorJSON
(
*
this
);
registerOutputFormatProcessorJSONCompact
(
*
this
);
registerOutputFormatProcessorXML
(
*
this
);
registerOutputFormatProcessorODBCDriver
(
*
this
);
registerOutputFormatProcessorODBCDriver2
(
*
this
);
registerOutputFormatProcessorNull
(
*
this
);
registerOutputFormatProcessorMySQLWire
(
*
this
);
...
...
src/Formats/FormatFactory.h
浏览文件 @
ddbfe0ce
...
...
@@ -199,7 +199,6 @@ void registerOutputFormatProcessorJSON(FormatFactory & factory);
void
registerOutputFormatProcessorJSONCompact
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorJSONEachRowWithProgress
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorXML
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorODBCDriver
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorODBCDriver2
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorNull
(
FormatFactory
&
factory
);
void
registerOutputFormatProcessorMySQLWire
(
FormatFactory
&
factory
);
...
...
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.cpp
已删除
100644 → 0
浏览文件 @
17eb8d24
#include <IO/WriteBuffer.h>
#include <IO/WriteHelpers.h>
#include <Core/Block.h>
#include <Processors/Formats/Impl/ODBCDriverBlockOutputFormat.h>
#include <Formats/FormatFactory.h>
namespace
DB
{
ODBCDriverBlockOutputFormat
::
ODBCDriverBlockOutputFormat
(
WriteBuffer
&
out_
,
const
Block
&
header_
,
const
FormatSettings
&
format_settings_
)
:
IOutputFormat
(
header_
,
out_
),
format_settings
(
format_settings_
)
{
}
void
ODBCDriverBlockOutputFormat
::
consume
(
Chunk
chunk
)
{
writePrefixIfNot
();
const
size_t
num_rows
=
chunk
.
getNumRows
();
const
size_t
num_columns
=
chunk
.
getNumColumns
();
const
auto
&
columns
=
chunk
.
getColumns
();
const
auto
&
header
=
getPort
(
PortKind
::
Main
).
getHeader
();
String
text_value
;
for
(
size_t
i
=
0
;
i
<
num_rows
;
++
i
)
{
for
(
size_t
j
=
0
;
j
<
num_columns
;
++
j
)
{
text_value
.
resize
(
0
);
const
auto
&
column
=
columns
[
j
];
const
auto
&
type
=
header
.
getByPosition
(
j
).
type
;
{
WriteBufferFromString
text_out
(
text_value
);
type
->
serializeAsText
(
*
column
,
i
,
text_out
,
format_settings
);
}
writeStringBinary
(
text_value
,
out
);
}
}
}
void
ODBCDriverBlockOutputFormat
::
writePrefix
()
{
const
auto
&
header
=
getPort
(
PortKind
::
Main
).
getHeader
();
const
size_t
columns
=
header
.
columns
();
/// Number of columns.
writeVarUInt
(
columns
,
out
);
/// Names and types of columns.
for
(
size_t
i
=
0
;
i
<
columns
;
++
i
)
{
const
ColumnWithTypeAndName
&
col
=
header
.
getByPosition
(
i
);
writeStringBinary
(
col
.
name
,
out
);
writeStringBinary
(
col
.
type
->
getName
(),
out
);
}
}
void
ODBCDriverBlockOutputFormat
::
finalize
()
{
writePrefixIfNot
();
}
void
registerOutputFormatProcessorODBCDriver
(
FormatFactory
&
factory
)
{
factory
.
registerOutputFormatProcessor
(
"ODBCDriver"
,
[](
WriteBuffer
&
buf
,
const
Block
&
sample
,
FormatFactory
::
WriteCallback
,
const
FormatSettings
&
format_settings
)
{
return
std
::
make_shared
<
ODBCDriverBlockOutputFormat
>
(
buf
,
sample
,
format_settings
);
});
}
}
src/Processors/Formats/Impl/ODBCDriverBlockOutputFormat.h
已删除
100644 → 0
浏览文件 @
17eb8d24
#pragma once
#include <string>
#include <Processors/Formats/IOutputFormat.h>
#include <Formats/FormatSettings.h>
#include <Core/Block.h>
namespace
DB
{
class
WriteBuffer
;
/** A data format designed to simplify the implementation of the ODBC driver.
* ODBC driver is designed to be build for different platforms without dependencies from the main code,
* so the format is made that way so that it can be as easy as possible to parse it.
* A header is displayed with the required information.
* The data is then output in the order of the rows. Each value is displayed as follows: length in VarUInt format, then data in text form.
*/
class
ODBCDriverBlockOutputFormat
:
public
IOutputFormat
{
public:
ODBCDriverBlockOutputFormat
(
WriteBuffer
&
out_
,
const
Block
&
header_
,
const
FormatSettings
&
format_settings_
);
String
getName
()
const
override
{
return
"ODBCDriverBlockOutputFormat"
;
}
void
consume
(
Chunk
)
override
;
void
finalize
()
override
;
std
::
string
getContentType
()
const
override
{
return
"application/octet-stream"
;
}
private:
const
FormatSettings
format_settings
;
bool
prefix_written
=
false
;
void
writePrefixIfNot
()
{
if
(
!
prefix_written
)
writePrefix
();
prefix_written
=
true
;
}
void
writePrefix
();
};
}
src/Processors/ya.make
浏览文件 @
ddbfe0ce
...
...
@@ -38,7 +38,6 @@ SRCS(
Formats/Impl/NativeFormat.cpp
Formats/Impl/NullFormat.cpp
Formats/Impl/ODBCDriver2BlockOutputFormat.cpp
Formats/Impl/ODBCDriverBlockOutputFormat.cpp
Formats/Impl/PostgreSQLOutputFormat.cpp
Formats/Impl/PrettyBlockOutputFormat.cpp
Formats/Impl/PrettyCompactBlockOutputFormat.cpp
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录