Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
bbaa0d36
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,发现更多精彩内容 >>
提交
bbaa0d36
编写于
8月 03, 2018
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'uuid-fix' of
https://github.com/simPod/ClickHouse
into simPod-uuid-fix
上级
6c3d7805
6c7ba03d
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
88 addition
and
33 deletion
+88
-33
dbms/src/Common/FieldVisitors.cpp
dbms/src/Common/FieldVisitors.cpp
+7
-0
dbms/src/Common/FieldVisitors.h
dbms/src/Common/FieldVisitors.h
+75
-33
dbms/src/DataTypes/FieldToDataType.cpp
dbms/src/DataTypes/FieldToDataType.cpp
+5
-0
dbms/src/DataTypes/FieldToDataType.h
dbms/src/DataTypes/FieldToDataType.h
+1
-0
未找到文件。
dbms/src/Common/FieldVisitors.cpp
浏览文件 @
bbaa0d36
...
...
@@ -155,6 +155,13 @@ void FieldVisitorHash::operator() (const UInt64 & x) const
hash
.
update
(
x
);
}
void
FieldVisitorHash
::
operator
()
(
const
UInt128
&
x
)
const
{
UInt8
type
=
Field
::
Types
::
UInt128
;
hash
.
update
(
type
);
hash
.
update
(
x
);
}
void
FieldVisitorHash
::
operator
()
(
const
Int64
&
x
)
const
{
UInt8
type
=
Field
::
Types
::
Int64
;
...
...
dbms/src/Common/FieldVisitors.h
浏览文件 @
bbaa0d36
...
...
@@ -38,6 +38,7 @@ typename std::decay_t<Visitor>::ResultType applyVisitor(Visitor && visitor, F &&
{
case
Field
::
Types
::
Null
:
return
visitor
(
field
.
template
get
<
Null
>());
case
Field
::
Types
::
UInt64
:
return
visitor
(
field
.
template
get
<
UInt64
>());
case
Field
::
Types
::
UInt128
:
return
visitor
(
field
.
template
get
<
UInt128
>());
case
Field
::
Types
::
Int64
:
return
visitor
(
field
.
template
get
<
Int64
>());
case
Field
::
Types
::
Float64
:
return
visitor
(
field
.
template
get
<
Float64
>());
case
Field
::
Types
::
String
:
return
visitor
(
field
.
template
get
<
String
>());
...
...
@@ -57,6 +58,7 @@ static typename std::decay_t<Visitor>::ResultType applyBinaryVisitorImpl(Visitor
{
case
Field
::
Types
::
Null
:
return
visitor
(
field1
,
field2
.
template
get
<
Null
>());
case
Field
::
Types
::
UInt64
:
return
visitor
(
field1
,
field2
.
template
get
<
UInt64
>());
case
Field
::
Types
::
UInt128
:
return
visitor
(
field1
,
field2
.
template
get
<
UInt128
>());
case
Field
::
Types
::
Int64
:
return
visitor
(
field1
,
field2
.
template
get
<
Int64
>());
case
Field
::
Types
::
Float64
:
return
visitor
(
field1
,
field2
.
template
get
<
Float64
>());
case
Field
::
Types
::
String
:
return
visitor
(
field1
,
field2
.
template
get
<
String
>());
...
...
@@ -79,6 +81,9 @@ typename std::decay_t<Visitor>::ResultType applyVisitor(Visitor && visitor, F1 &
case
Field
::
Types
::
UInt64
:
return
applyBinaryVisitorImpl
(
std
::
forward
<
Visitor
>
(
visitor
),
field1
.
template
get
<
UInt64
>(),
std
::
forward
<
F2
>
(
field2
));
case
Field
::
Types
::
UInt128
:
return
applyBinaryVisitorImpl
(
std
::
forward
<
Visitor
>
(
visitor
),
field1
.
template
get
<
UInt128
>(),
std
::
forward
<
F2
>
(
field2
));
case
Field
::
Types
::
Int64
:
return
applyBinaryVisitorImpl
(
std
::
forward
<
Visitor
>
(
visitor
),
field1
.
template
get
<
Int64
>(),
std
::
forward
<
F2
>
(
field2
));
...
...
@@ -107,6 +112,7 @@ class FieldVisitorToString : public StaticVisitor<String>
public:
String
operator
()
(
const
Null
&
x
)
const
;
String
operator
()
(
const
UInt64
&
x
)
const
;
String
operator
()
(
const
UInt128
&
x
)
const
;
String
operator
()
(
const
Int64
&
x
)
const
;
String
operator
()
(
const
Float64
&
x
)
const
;
String
operator
()
(
const
String
&
x
)
const
;
...
...
@@ -121,6 +127,7 @@ class FieldVisitorDump : public StaticVisitor<String>
public:
String
operator
()
(
const
Null
&
x
)
const
;
String
operator
()
(
const
UInt64
&
x
)
const
;
String
operator
()
(
const
UInt128
&
x
)
const
;
String
operator
()
(
const
Int64
&
x
)
const
;
String
operator
()
(
const
Float64
&
x
)
const
;
String
operator
()
(
const
String
&
x
)
const
;
...
...
@@ -155,6 +162,7 @@ public:
}
T
operator
()
(
const
UInt64
&
x
)
const
{
return
x
;
}
T
operator
()
(
const
UInt128
&
x
)
const
{
return
x
;
}
T
operator
()
(
const
Int64
&
x
)
const
{
return
x
;
}
T
operator
()
(
const
Float64
&
x
)
const
{
return
x
;
}
};
...
...
@@ -170,6 +178,7 @@ public:
void
operator
()
(
const
Null
&
x
)
const
;
void
operator
()
(
const
UInt64
&
x
)
const
;
void
operator
()
(
const
UInt128
&
x
)
const
;
void
operator
()
(
const
Int64
&
x
)
const
;
void
operator
()
(
const
Float64
&
x
)
const
;
void
operator
()
(
const
String
&
x
)
const
;
...
...
@@ -186,6 +195,7 @@ class FieldVisitorAccurateEquals : public StaticVisitor<bool>
public:
bool
operator
()
(
const
Null
&
,
const
Null
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Null
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Null
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Null
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Null
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -194,14 +204,25 @@ public:
bool
operator
()
(
const
UInt64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
l
,
const
UInt64
&
r
)
const
{
return
l
==
r
;
}
bool
operator
()
(
const
UInt64
&
,
const
UInt128
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
l
,
const
Int64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
UInt64
&
l
,
const
Float64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
UInt64
&
,
const
String
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
,
const
Array
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
,
const
Tuple
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
UInt64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
l
,
const
UInt128
&
r
)
const
{
return
l
==
r
;
}
bool
operator
()
(
const
UInt128
&
,
const
Int64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Float64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
String
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Array
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Tuple
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
l
,
const
UInt64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
Int64
&
,
const
UInt128
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
l
,
const
Int64
&
r
)
const
{
return
l
==
r
;
}
bool
operator
()
(
const
Int64
&
l
,
const
Float64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
Int64
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -210,6 +231,7 @@ public:
bool
operator
()
(
const
Float64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Float64
&
l
,
const
UInt64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
Float64
&
,
const
UInt128
)
const
{
return
false
;
}
bool
operator
()
(
const
Float64
&
l
,
const
Int64
&
r
)
const
{
return
accurate
::
equalsOp
(
l
,
r
);
}
bool
operator
()
(
const
Float64
&
l
,
const
Float64
&
r
)
const
{
return
l
==
r
;
}
bool
operator
()
(
const
Float64
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -218,6 +240,7 @@ public:
bool
operator
()
(
const
String
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
l
,
const
String
&
r
)
const
{
return
l
==
r
;
}
...
...
@@ -226,6 +249,7 @@ public:
bool
operator
()
(
const
Array
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -234,6 +258,7 @@ public:
bool
operator
()
(
const
Tuple
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -247,6 +272,7 @@ public:
bool
operator
()
(
const
Null
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Null
&
,
const
UInt64
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
Int64
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
UInt128
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
Float64
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
String
&
)
const
{
return
true
;
}
bool
operator
()
(
const
Null
&
,
const
Array
&
)
const
{
return
true
;
}
...
...
@@ -254,14 +280,25 @@ public:
bool
operator
()
(
const
UInt64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
l
,
const
UInt64
&
r
)
const
{
return
l
<
r
;
}
bool
operator
()
(
const
UInt64
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt64
&
l
,
const
Int64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
UInt64
&
l
,
const
Float64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
UInt64
&
,
const
String
&
)
const
{
return
true
;
}
bool
operator
()
(
const
UInt64
&
,
const
Array
&
)
const
{
return
true
;
}
bool
operator
()
(
const
UInt64
&
,
const
Tuple
&
)
const
{
return
true
;
}
bool
operator
()
(
const
UInt128
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
UInt64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
l
,
const
UInt128
&
r
)
const
{
return
l
<
r
;
}
bool
operator
()
(
const
UInt128
&
,
const
Int64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Float64
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
String
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Array
&
)
const
{
return
false
;
}
bool
operator
()
(
const
UInt128
&
,
const
Tuple
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
l
,
const
UInt64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
Int64
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Int64
&
l
,
const
Int64
&
r
)
const
{
return
l
<
r
;
}
bool
operator
()
(
const
Int64
&
l
,
const
Float64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
Int64
&
,
const
String
&
)
const
{
return
true
;
}
...
...
@@ -270,6 +307,7 @@ public:
bool
operator
()
(
const
Float64
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Float64
&
l
,
const
UInt64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
Float64
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Float64
&
l
,
const
Int64
&
r
)
const
{
return
accurate
::
lessOp
(
l
,
r
);
}
bool
operator
()
(
const
Float64
&
l
,
const
Float64
&
r
)
const
{
return
l
<
r
;
}
bool
operator
()
(
const
Float64
&
,
const
String
&
)
const
{
return
true
;
}
...
...
@@ -278,6 +316,7 @@ public:
bool
operator
()
(
const
String
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
String
&
l
,
const
String
&
r
)
const
{
return
l
<
r
;
}
...
...
@@ -286,6 +325,7 @@ public:
bool
operator
()
(
const
Array
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Array
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -294,6 +334,7 @@ public:
bool
operator
()
(
const
Tuple
&
,
const
Null
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
UInt64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
UInt128
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
Int64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
Float64
&
)
const
{
return
false
;
}
bool
operator
()
(
const
Tuple
&
,
const
String
&
)
const
{
return
false
;
}
...
...
@@ -318,6 +359,7 @@ public:
bool
operator
()
(
Null
&
)
const
{
throw
Exception
(
"Cannot sum Nulls"
,
ErrorCodes
::
LOGICAL_ERROR
);
}
bool
operator
()
(
String
&
)
const
{
throw
Exception
(
"Cannot sum Strings"
,
ErrorCodes
::
LOGICAL_ERROR
);
}
bool
operator
()
(
Array
&
)
const
{
throw
Exception
(
"Cannot sum Arrays"
,
ErrorCodes
::
LOGICAL_ERROR
);
}
bool
operator
()
(
UInt128
&
)
const
{
throw
Exception
(
"Cannot sum UUIDs"
,
ErrorCodes
::
LOGICAL_ERROR
);
}
};
}
dbms/src/DataTypes/FieldToDataType.cpp
浏览文件 @
bbaa0d36
...
...
@@ -34,6 +34,11 @@ DataTypePtr FieldToDataType::operator() (const UInt64 & x) const
return
std
::
make_shared
<
DataTypeUInt64
>
();
}
DataTypePtr
FieldToDataType
::
operator
()
(
const
Uint128
&
x
)
const
{
return
std
::
make_shared
<
DataTypeUInt128
>
();
}
DataTypePtr
FieldToDataType
::
operator
()
(
const
Int64
&
x
)
const
{
if
(
x
<=
std
::
numeric_limits
<
Int8
>::
max
()
&&
x
>=
std
::
numeric_limits
<
Int8
>::
min
())
return
std
::
make_shared
<
DataTypeInt8
>
();
...
...
dbms/src/DataTypes/FieldToDataType.h
浏览文件 @
bbaa0d36
...
...
@@ -19,6 +19,7 @@ class FieldToDataType : public StaticVisitor<DataTypePtr>
public:
DataTypePtr
operator
()
(
const
Null
&
x
)
const
;
DataTypePtr
operator
()
(
const
UInt64
&
x
)
const
;
DataTypePtr
operator
()
(
const
UInt128
&
x
)
const
;
DataTypePtr
operator
()
(
const
Int64
&
x
)
const
;
DataTypePtr
operator
()
(
const
Float64
&
x
)
const
;
DataTypePtr
operator
()
(
const
String
&
x
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录