Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
9e587fb1
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,发现更多精彩内容 >>
提交
9e587fb1
编写于
9月 02, 2019
作者:
Z
Zhichang Yu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix DataTypeAggregateFunction deserialization
上级
6cf53272
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
8 deletion
+25
-8
dbms/src/Common/FieldVisitors.cpp
dbms/src/Common/FieldVisitors.cpp
+1
-1
dbms/src/DataTypes/DataTypeAggregateFunction.cpp
dbms/src/DataTypes/DataTypeAggregateFunction.cpp
+4
-2
dbms/src/Functions/FunctionsConversion.h
dbms/src/Functions/FunctionsConversion.h
+19
-4
dbms/src/IO/ReadHelpers.h
dbms/src/IO/ReadHelpers.h
+1
-1
未找到文件。
dbms/src/Common/FieldVisitors.cpp
浏览文件 @
9e587fb1
...
...
@@ -130,7 +130,7 @@ String FieldVisitorToString::operator() (const DecimalField<Decimal128> & x) con
String
FieldVisitorToString
::
operator
()
(
const
UInt128
&
x
)
const
{
return
formatQuoted
(
UUID
(
x
));
}
String
FieldVisitorToString
::
operator
()
(
const
AggregateFunctionStateData
&
x
)
const
{
return
"("
+
formatQuoted
(
x
.
name
)
+
")"
+
formatQuoted
(
x
.
data
);
return
formatQuoted
(
x
.
data
);
}
String
FieldVisitorToString
::
operator
()
(
const
Array
&
x
)
const
...
...
dbms/src/DataTypes/DataTypeAggregateFunction.cpp
浏览文件 @
9e587fb1
...
...
@@ -218,9 +218,11 @@ void DataTypeAggregateFunction::deserializeTextQuoted(IColumn & column, ReadBuff
}
void
DataTypeAggregateFunction
::
deserializeWholeText
(
IColumn
&
,
ReadBuffer
&
,
const
FormatSettings
&
)
const
void
DataTypeAggregateFunction
::
deserializeWholeText
(
IColumn
&
column
,
ReadBuffer
&
istr
,
const
FormatSettings
&
)
const
{
throw
Exception
(
"AggregateFunction data type cannot be read from text"
,
ErrorCodes
::
NOT_IMPLEMENTED
);
String
s
;
readStringUntilEOF
(
s
,
istr
);
deserializeFromString
(
function
,
column
,
s
);
}
...
...
dbms/src/Functions/FunctionsConversion.h
浏览文件 @
9e587fb1
...
...
@@ -23,6 +23,7 @@
#include <DataTypes/DataTypeNothing.h>
#include <DataTypes/DataTypeUUID.h>
#include <DataTypes/DataTypeInterval.h>
#include <DataTypes/DataTypeAggregateFunction.h>
#include <Formats/FormatSettings.h>
#include <Columns/ColumnString.h>
#include <Columns/ColumnFixedString.h>
...
...
@@ -636,7 +637,7 @@ struct ConvertImplGenericFromString
{
ReadBufferFromMemory
read_buffer
(
&
chars
[
current_offset
],
offsets
[
i
]
-
current_offset
-
1
);
data_type_to
.
deserializeAs
TextEscaped
(
column_to
,
read_buffer
,
format_settings
);
data_type_to
.
deserializeAs
WholeText
(
column_to
,
read_buffer
,
format_settings
);
if
(
!
read_buffer
.
eof
())
throwExceptionForIncompletelyParsedValue
(
read_buffer
,
block
,
result
);
...
...
@@ -1668,6 +1669,21 @@ private:
}
};
}
WrapperType
createAggregateFunctionWrapper
(
const
DataTypePtr
&
from_type_untyped
,
const
DataTypeAggregateFunction
*
to_type
)
const
{
/// Conversion from String through parsing.
if
(
checkAndGetDataType
<
DataTypeString
>
(
from_type_untyped
.
get
()))
{
return
[]
(
Block
&
block
,
const
ColumnNumbers
&
arguments
,
const
size_t
result
,
size_t
/*input_rows_count*/
)
{
ConvertImplGenericFromString
::
execute
(
block
,
arguments
,
result
);
};
}
else
throw
Exception
{
"Conversion from "
+
from_type_untyped
->
getName
()
+
" to "
+
to_type
->
getName
()
+
" is not supported"
,
ErrorCodes
::
CANNOT_CONVERT_TYPE
};
}
WrapperType
createArrayWrapper
(
const
DataTypePtr
&
from_type_untyped
,
const
DataTypeArray
*
to_type
)
const
{
...
...
@@ -2145,13 +2161,12 @@ private:
case
TypeIndex
::
Tuple
:
return
createTupleWrapper
(
from_type
,
checkAndGetDataType
<
DataTypeTuple
>
(
to_type
.
get
()));
case
TypeIndex
::
AggregateFunction
:
return
createAggregateFunctionWrapper
(
from_type
,
checkAndGetDataType
<
DataTypeAggregateFunction
>
(
to_type
.
get
()));
default:
break
;
}
/// It's possible to use ConvertImplGenericFromString to convert from String to AggregateFunction,
/// but it is disabled because deserializing aggregate functions state might be unsafe.
throw
Exception
{
"Conversion from "
+
from_type
->
getName
()
+
" to "
+
to_type
->
getName
()
+
" is not supported"
,
ErrorCodes
::
CANNOT_CONVERT_TYPE
};
}
...
...
dbms/src/IO/ReadHelpers.h
浏览文件 @
9e587fb1
...
...
@@ -39,7 +39,7 @@
#endif
#define DEFAULT_MAX_STRING_SIZE 0x
00
FFFFFFULL
#define DEFAULT_MAX_STRING_SIZE 0x
3F
FFFFFFULL
namespace
DB
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录