Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
9021bfb2
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,发现更多精彩内容 >>
提交
9021bfb2
编写于
11月 15, 2018
作者:
A
Amos Bird
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix variant assignments
上级
e3b0cecd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
41 addition
and
139 deletion
+41
-139
dbms/src/Dictionaries/CacheDictionary.cpp
dbms/src/Dictionaries/CacheDictionary.cpp
+20
-69
dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp
...ies/ComplexKeyCacheDictionary_createAttributeWithType.cpp
+21
-70
未找到文件。
dbms/src/Dictionaries/CacheDictionary.cpp
浏览文件 @
9021bfb2
...
...
@@ -454,76 +454,27 @@ CacheDictionary::Attribute CacheDictionary::createAttributeWithType(const Attrib
switch
(
type
)
{
case
AttributeUnderlyingType
::
UInt8
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt8
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt8
);
break
;
case
AttributeUnderlyingType
::
UInt16
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt16
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt16
);
break
;
case
AttributeUnderlyingType
::
UInt32
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt32
);
break
;
case
AttributeUnderlyingType
::
UInt64
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt64
);
break
;
case
AttributeUnderlyingType
::
UInt128
:
attr
.
null_values
=
null_value
.
get
<
UInt128
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt128
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt128
);
break
;
case
AttributeUnderlyingType
::
Int8
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int8
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int8
);
break
;
case
AttributeUnderlyingType
::
Int16
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int16
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int16
);
break
;
case
AttributeUnderlyingType
::
Int32
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int32
);
break
;
case
AttributeUnderlyingType
::
Int64
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int64
);
break
;
case
AttributeUnderlyingType
::
Decimal32
:
attr
.
null_values
=
null_value
.
get
<
Decimal32
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal32
);
break
;
case
AttributeUnderlyingType
::
Decimal64
:
attr
.
null_values
=
null_value
.
get
<
Decimal64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal64
);
break
;
case
AttributeUnderlyingType
::
Decimal128
:
attr
.
null_values
=
null_value
.
get
<
Decimal128
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal128
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal128
);
break
;
case
AttributeUnderlyingType
::
Float32
:
attr
.
null_values
=
null_value
.
get
<
Float64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Float32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Float32
);
break
;
case
AttributeUnderlyingType
::
Float64
:
attr
.
null_values
=
null_value
.
get
<
Float64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Float64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Float64
);
#define DISPATCH(TYPE) \
case AttributeUnderlyingType::TYPE: \
attr.null_values = TYPE(null_value.get<typename NearestFieldType<TYPE>::Type>()); \
attr.arrays = std::make_unique<ContainerType<TYPE>>(size); \
bytes_allocated += size * sizeof(TYPE); \
break;
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
#undef DISPATCH
case
AttributeUnderlyingType
::
String
:
attr
.
null_values
=
null_value
.
get
<
String
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
StringRef
>>
(
size
);
...
...
dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp
浏览文件 @
9021bfb2
...
...
@@ -9,76 +9,27 @@ ComplexKeyCacheDictionary::Attribute ComplexKeyCacheDictionary::createAttributeW
switch
(
type
)
{
case
AttributeUnderlyingType
::
UInt8
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt8
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt8
);
break
;
case
AttributeUnderlyingType
::
UInt16
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt16
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt16
);
break
;
case
AttributeUnderlyingType
::
UInt32
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt32
);
break
;
case
AttributeUnderlyingType
::
UInt64
:
attr
.
null_values
=
null_value
.
get
<
UInt64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt64
);
break
;
case
AttributeUnderlyingType
::
UInt128
:
attr
.
null_values
=
null_value
.
get
<
UInt128
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
UInt128
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
UInt128
);
break
;
case
AttributeUnderlyingType
::
Int8
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int8
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int8
);
break
;
case
AttributeUnderlyingType
::
Int16
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int16
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int16
);
break
;
case
AttributeUnderlyingType
::
Int32
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int32
);
break
;
case
AttributeUnderlyingType
::
Int64
:
attr
.
null_values
=
null_value
.
get
<
Int64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Int64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Int64
);
break
;
case
AttributeUnderlyingType
::
Float32
:
attr
.
null_values
=
null_value
.
get
<
Float64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Float32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Float32
);
break
;
case
AttributeUnderlyingType
::
Float64
:
attr
.
null_values
=
null_value
.
get
<
Float64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Float64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Float64
);
break
;
case
AttributeUnderlyingType
::
Decimal32
:
attr
.
null_values
=
null_value
.
get
<
Decimal32
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal32
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal32
);
break
;
case
AttributeUnderlyingType
::
Decimal64
:
attr
.
null_values
=
null_value
.
get
<
Decimal64
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal64
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal64
);
break
;
case
AttributeUnderlyingType
::
Decimal128
:
attr
.
null_values
=
null_value
.
get
<
Decimal128
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
Decimal128
>>
(
size
);
bytes_allocated
+=
size
*
sizeof
(
Decimal128
);
break
;
#define DISPATCH(TYPE) \
case AttributeUnderlyingType::TYPE: \
attr.null_values = TYPE(null_value.get<typename NearestFieldType<TYPE>::Type>()); \
attr.arrays = std::make_unique<ContainerType<TYPE>>(size); \
bytes_allocated += size * sizeof(TYPE); \
break;
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
#undef DISPATCH
case
AttributeUnderlyingType
::
String
:
attr
.
null_values
=
null_value
.
get
<
String
>
();
attr
.
arrays
=
std
::
make_unique
<
ContainerType
<
StringRef
>>
(
size
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录