Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
a249fc77
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,发现更多精彩内容 >>
提交
a249fc77
编写于
2月 05, 2019
作者:
N
Nikolai Kochetov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Do nut use Arena in ColumnsHashing for string in functions arrayUniq and arrayEnumerate.
上级
44a46825
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
18 deletion
+25
-18
dbms/src/Common/ColumnsHashing.h
dbms/src/Common/ColumnsHashing.h
+17
-10
dbms/src/Functions/arrayEnumerateExtended.h
dbms/src/Functions/arrayEnumerateExtended.h
+2
-2
dbms/src/Functions/arrayUniq.cpp
dbms/src/Functions/arrayUniq.cpp
+2
-2
dbms/src/Interpreters/Join.cpp
dbms/src/Interpreters/Join.cpp
+2
-2
dbms/src/Interpreters/SetVariants.h
dbms/src/Interpreters/SetVariants.h
+2
-2
未找到文件。
dbms/src/Common/ColumnsHashing.h
浏览文件 @
a249fc77
...
...
@@ -62,11 +62,11 @@ struct HashMethodOneNumber
/// For the case where there is one string key.
template
<
typename
Value
,
typename
Mapped
,
bool
use_cache
=
true
>
template
<
typename
Value
,
typename
Mapped
,
bool
place_string_to_arena
=
true
,
bool
use_cache
=
true
>
struct
HashMethodString
:
public
columns_hashing_impl
::
HashMethodBase
<
HashMethodString
<
Value
,
Mapped
,
use_cache
>
,
Value
,
Mapped
,
use_cache
>
:
public
columns_hashing_impl
::
HashMethodBase
<
HashMethodString
<
Value
,
Mapped
,
place_string_to_arena
,
use_cache
>
,
Value
,
Mapped
,
use_cache
>
{
using
Self
=
HashMethodString
<
Value
,
Mapped
,
use_cache
>
;
using
Self
=
HashMethodString
<
Value
,
Mapped
,
place_string_to_arena
,
use_cache
>
;
using
Base
=
columns_hashing_impl
::
HashMethodBase
<
Self
,
Value
,
Mapped
,
use_cache
>
;
const
IColumn
::
Offset
*
offsets
;
...
...
@@ -90,20 +90,23 @@ struct HashMethodString
protected:
friend
class
columns_hashing_impl
::
HashMethodBase
<
Self
,
Value
,
Mapped
,
use_cache
>
;
static
ALWAYS_INLINE
void
onNewKey
(
StringRef
&
key
,
Arena
&
pool
)
static
ALWAYS_INLINE
void
onNewKey
(
[[
maybe_unused
]]
StringRef
&
key
,
[[
maybe_unused
]]
Arena
&
pool
)
{
if
(
key
.
size
)
key
.
data
=
pool
.
insert
(
key
.
data
,
key
.
size
);
if
constexpr
(
place_string_to_arena
)
{
if
(
key
.
size
)
key
.
data
=
pool
.
insert
(
key
.
data
,
key
.
size
);
}
}
};
/// For the case where there is one fixed-length string key.
template
<
typename
Value
,
typename
Mapped
,
bool
use_cache
=
true
>
template
<
typename
Value
,
typename
Mapped
,
bool
place_string_to_arena
=
true
,
bool
use_cache
=
true
>
struct
HashMethodFixedString
:
public
columns_hashing_impl
::
HashMethodBase
<
HashMethodFixedString
<
Value
,
Mapped
,
use_cache
>
,
Value
,
Mapped
,
use_cache
>
:
public
columns_hashing_impl
::
HashMethodBase
<
HashMethodFixedString
<
Value
,
Mapped
,
place_string_to_arena
,
use_cache
>
,
Value
,
Mapped
,
use_cache
>
{
using
Self
=
HashMethodFixedString
<
Value
,
Mapped
,
use_cache
>
;
using
Self
=
HashMethodFixedString
<
Value
,
Mapped
,
place_string_to_arena
,
use_cache
>
;
using
Base
=
columns_hashing_impl
::
HashMethodBase
<
Self
,
Value
,
Mapped
,
use_cache
>
;
size_t
n
;
...
...
@@ -123,7 +126,11 @@ struct HashMethodFixedString
protected:
friend
class
columns_hashing_impl
::
HashMethodBase
<
Self
,
Value
,
Mapped
,
use_cache
>
;
static
ALWAYS_INLINE
void
onNewKey
(
StringRef
&
key
,
Arena
&
pool
)
{
key
.
data
=
pool
.
insert
(
key
.
data
,
key
.
size
);
}
static
ALWAYS_INLINE
void
onNewKey
([[
maybe_unused
]]
StringRef
&
key
,
[[
maybe_unused
]]
Arena
&
pool
)
{
if
constexpr
(
place_string_to_arena
)
key
.
data
=
pool
.
insert
(
key
.
data
,
key
.
size
);
}
};
...
...
dbms/src/Functions/arrayEnumerateExtended.h
浏览文件 @
a249fc77
...
...
@@ -73,14 +73,14 @@ private:
{
using
Set
=
ClearableHashMap
<
StringRef
,
UInt32
,
StringRefHash
,
HashTableGrower
<
INITIAL_SIZE_DEGREE
>
,
HashTableAllocatorWithStackMemory
<
(
1ULL
<<
INITIAL_SIZE_DEGREE
)
*
sizeof
(
StringRef
)
>>
;
using
Method
=
ColumnsHashing
::
HashMethodString
<
typename
Set
::
value_type
,
UInt32
,
false
>
;
using
Method
=
ColumnsHashing
::
HashMethodString
<
typename
Set
::
value_type
,
UInt32
,
false
,
false
>
;
};
struct
MethodFixedString
{
using
Set
=
ClearableHashMap
<
StringRef
,
UInt32
,
StringRefHash
,
HashTableGrower
<
INITIAL_SIZE_DEGREE
>
,
HashTableAllocatorWithStackMemory
<
(
1ULL
<<
INITIAL_SIZE_DEGREE
)
*
sizeof
(
StringRef
)
>>
;
using
Method
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Set
::
value_type
,
UInt32
,
false
>
;
using
Method
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Set
::
value_type
,
UInt32
,
false
,
false
>
;
};
struct
MethodFixed
...
...
dbms/src/Functions/arrayUniq.cpp
浏览文件 @
a249fc77
...
...
@@ -75,14 +75,14 @@ private:
{
using
Set
=
ClearableHashSet
<
StringRef
,
StringRefHash
,
HashTableGrower
<
INITIAL_SIZE_DEGREE
>
,
HashTableAllocatorWithStackMemory
<
(
1ULL
<<
INITIAL_SIZE_DEGREE
)
*
sizeof
(
StringRef
)
>>
;
using
Method
=
ColumnsHashing
::
HashMethodString
<
typename
Set
::
value_type
,
void
,
false
>
;
using
Method
=
ColumnsHashing
::
HashMethodString
<
typename
Set
::
value_type
,
void
,
false
,
false
>
;
};
struct
MethodFixedString
{
using
Set
=
ClearableHashSet
<
StringRef
,
StringRefHash
,
HashTableGrower
<
INITIAL_SIZE_DEGREE
>
,
HashTableAllocatorWithStackMemory
<
(
1ULL
<<
INITIAL_SIZE_DEGREE
)
*
sizeof
(
StringRef
)
>>
;
using
Method
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Set
::
value_type
,
void
,
false
>
;
using
Method
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Set
::
value_type
,
void
,
false
,
false
>
;
};
struct
MethodFixed
...
...
dbms/src/Interpreters/Join.cpp
浏览文件 @
a249fc77
...
...
@@ -191,11 +191,11 @@ template <typename Value, typename Mapped> struct KeyGetterForTypeImpl<Join::Typ
};
template
<
typename
Value
,
typename
Mapped
>
struct
KeyGetterForTypeImpl
<
Join
::
Type
::
key_string
,
Value
,
Mapped
>
{
using
Type
=
ColumnsHashing
::
HashMethodString
<
Value
,
Mapped
,
false
>
;
using
Type
=
ColumnsHashing
::
HashMethodString
<
Value
,
Mapped
,
true
,
false
>
;
};
template
<
typename
Value
,
typename
Mapped
>
struct
KeyGetterForTypeImpl
<
Join
::
Type
::
key_fixed_string
,
Value
,
Mapped
>
{
using
Type
=
ColumnsHashing
::
HashMethodFixedString
<
Value
,
Mapped
,
false
>
;
using
Type
=
ColumnsHashing
::
HashMethodFixedString
<
Value
,
Mapped
,
true
,
false
>
;
};
template
<
typename
Value
,
typename
Mapped
>
struct
KeyGetterForTypeImpl
<
Join
::
Type
::
keys128
,
Value
,
Mapped
>
{
...
...
dbms/src/Interpreters/SetVariants.h
浏览文件 @
a249fc77
...
...
@@ -40,7 +40,7 @@ struct SetMethodString
Data
data
;
using
State
=
ColumnsHashing
::
HashMethodString
<
typename
Data
::
value_type
,
void
,
false
>
;
using
State
=
ColumnsHashing
::
HashMethodString
<
typename
Data
::
value_type
,
void
,
true
,
false
>
;
};
/// For the case when there is one fixed-length string key.
...
...
@@ -52,7 +52,7 @@ struct SetMethodFixedString
Data
data
;
using
State
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Data
::
value_type
,
void
,
false
>
;
using
State
=
ColumnsHashing
::
HashMethodFixedString
<
typename
Data
::
value_type
,
void
,
true
,
false
>
;
};
namespace
set_impl
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录