Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
49e12eaa
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,发现更多精彩内容 >>
提交
49e12eaa
编写于
5月 28, 2019
作者:
C
chertus
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused specializations in dictionaries
上级
c5d18dfd
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
21 addition
and
213 deletion
+21
-213
dbms/src/Dictionaries/CacheDictionary.cpp
dbms/src/Dictionaries/CacheDictionary.cpp
+1
-1
dbms/src/Dictionaries/CacheDictionary.h
dbms/src/Dictionaries/CacheDictionary.h
+0
-5
dbms/src/Dictionaries/CacheDictionary.inc.h
dbms/src/Dictionaries/CacheDictionary.inc.h
+0
-28
dbms/src/Dictionaries/CacheDictionary_generate1.cpp.in
dbms/src/Dictionaries/CacheDictionary_generate1.cpp.in
+1
-1
dbms/src/Dictionaries/CacheDictionary_generate2.cpp.in
dbms/src/Dictionaries/CacheDictionary_generate2.cpp.in
+1
-1
dbms/src/Dictionaries/CacheDictionary_generate3.cpp.in
dbms/src/Dictionaries/CacheDictionary_generate3.cpp.in
+1
-1
dbms/src/Dictionaries/ComplexKeyCacheDictionary.h
dbms/src/Dictionaries/ComplexKeyCacheDictionary.h
+0
-28
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate1.cpp.in
...c/Dictionaries/ComplexKeyCacheDictionary_generate1.cpp.in
+1
-1
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate2.cpp.in
...c/Dictionaries/ComplexKeyCacheDictionary_generate2.cpp.in
+1
-1
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate3.cpp.in
...c/Dictionaries/ComplexKeyCacheDictionary_generate3.cpp.in
+1
-1
dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp
dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp
+3
-31
dbms/src/Dictionaries/ComplexKeyHashedDictionary.h
dbms/src/Dictionaries/ComplexKeyHashedDictionary.h
+0
-6
dbms/src/Dictionaries/FlatDictionary.cpp
dbms/src/Dictionaries/FlatDictionary.cpp
+4
-33
dbms/src/Dictionaries/FlatDictionary.h
dbms/src/Dictionaries/FlatDictionary.h
+0
-4
dbms/src/Dictionaries/HashedDictionary.cpp
dbms/src/Dictionaries/HashedDictionary.cpp
+4
-32
dbms/src/Dictionaries/HashedDictionary.h
dbms/src/Dictionaries/HashedDictionary.h
+0
-4
dbms/src/Dictionaries/TrieDictionary.cpp
dbms/src/Dictionaries/TrieDictionary.cpp
+3
-31
dbms/src/Dictionaries/TrieDictionary.h
dbms/src/Dictionaries/TrieDictionary.h
+0
-4
未找到文件。
dbms/src/Dictionaries/CacheDictionary.cpp
浏览文件 @
49e12eaa
...
...
@@ -86,7 +86,7 @@ void CacheDictionary::toParent(const PaddedPODArray<Key> & ids, PaddedPODArray<K
{
const
auto
null_value
=
std
::
get
<
UInt64
>
(
hierarchical_attribute
->
null_values
);
getItemsNumber
<
UInt64
>
(
*
hierarchical_attribute
,
ids
,
out
,
[
&
](
const
size_t
)
{
return
null_value
;
});
getItemsNumber
Impl
<
UInt64
,
UInt64
>
(
*
hierarchical_attribute
,
ids
,
out
,
[
&
](
const
size_t
)
{
return
null_value
;
});
}
...
...
dbms/src/Dictionaries/CacheDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -221,11 +221,6 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
DefaultGetter
>
void
getItemsNumber
(
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ResultArrayType
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
AttributeType
,
typename
OutputType
,
typename
DefaultGetter
>
void
getItemsNumberImpl
(
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ResultArrayType
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
;
...
...
dbms/src/Dictionaries/CacheDictionary.inc.h
浏览文件 @
49e12eaa
...
...
@@ -34,34 +34,6 @@ namespace ErrorCodes
extern
const
int
TYPE_MISMATCH
;
}
template
<
typename
OutputType
,
typename
DefaultGetter
>
void
CacheDictionary
::
getItemsNumber
(
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ResultArrayType
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) \
getItemsNumberImpl<TYPE, OutputType>(attribute, ids, out, std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
DefaultGetter
>
void
CacheDictionary
::
getItemsNumberImpl
(
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ResultArrayType
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/CacheDictionary_generate1.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -16,7 +16,7 @@ void CacheDictionary::get@NAME@(const std::string & attribute_name, const Padded
const auto null_value = std::get<TYPE>(attribute.null_values);
getItemsNumber
<
TYPE>(attribute, ids, out, [&](const size_t) { return null_value; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, ids, out, [&](const size_t) { return null_value; });
}
}
dbms/src/Dictionaries/CacheDictionary_generate2.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -17,7 +17,7 @@ void CacheDictionary::get@NAME@(const std::string & attribute_name,
auto & attribute = getAttribute(attribute_name);
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::@NAME@);
getItemsNumber
<
TYPE>(attribute, ids, out, [&](const size_t row) { return def[row]; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, ids, out, [&](const size_t row) { return def[row]; });
}
}
dbms/src/Dictionaries/CacheDictionary_generate3.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -14,7 +14,7 @@ void CacheDictionary::get@NAME@(const std::string & attribute_name, const Padded
auto & attribute = getAttribute(attribute_name);
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::@NAME@);
getItemsNumber
<
TYPE>(attribute, ids, out, [&](const size_t) { return def; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, ids, out, [&](const size_t) { return def; });
}
}
dbms/src/Dictionaries/ComplexKeyCacheDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -256,34 +256,6 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
DefaultGetter
>
void
getItemsNumber
(
Attribute
&
attribute
,
const
Columns
&
key_columns
,
PaddedPODArray
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) \
getItemsNumberImpl<TYPE, OutputType>(attribute, key_columns, out, std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
DefaultGetter
>
void
getItemsNumberImpl
(
Attribute
&
attribute
,
const
Columns
&
key_columns
,
PaddedPODArray
<
OutputType
>
&
out
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate1.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -17,6 +17,6 @@ void ComplexKeyCacheDictionary::get@NAME@(const std::string & attribute_name, co
const auto null_value = std::get<TYPE>(attribute.null_values);
getItemsNumber
<
TYPE>(attribute, key_columns, out, [&](const size_t) { return null_value; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, key_columns, out, [&](const size_t) { return null_value; });
}
}
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate2.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -20,6 +20,6 @@ void ComplexKeyCacheDictionary::get@NAME@(const std::string & attribute_name,
auto & attribute = getAttribute(attribute_name);
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::@NAME@);
getItemsNumber
<
TYPE>(attribute, key_columns, out, [&](const size_t row) { return def[row]; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, key_columns, out, [&](const size_t row) { return def[row]; });
}
}
dbms/src/Dictionaries/ComplexKeyCacheDictionary_generate3.cpp.in
浏览文件 @
49e12eaa
...
...
@@ -20,6 +20,6 @@ void ComplexKeyCacheDictionary::get@NAME@(const std::string & attribute_name,
auto & attribute = getAttribute(attribute_name);
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::@NAME@);
getItemsNumber
<
TYPE>(attribute, key_columns, out, [&](const size_t) { return def; });
getItemsNumber
Impl<TYPE,
TYPE>(attribute, key_columns, out, [&](const size_t) { return def; });
}
}
dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp
浏览文件 @
49e12eaa
...
...
@@ -54,7 +54,7 @@ ComplexKeyHashedDictionary::ComplexKeyHashedDictionary(
\
const auto null_value = std::get<TYPE>(attribute.null_values); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, \
key_columns, \
[&](const size_t row, const auto value) { out[row] = value; }, \
...
...
@@ -106,7 +106,7 @@ void ComplexKeyHashedDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, \
key_columns, \
[&](const size_t row, const auto value) { out[row] = value; }, \
...
...
@@ -160,7 +160,7 @@ void ComplexKeyHashedDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, key_columns, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return def; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -554,34 +554,6 @@ ComplexKeyHashedDictionary::createAttributeWithType(const AttributeUnderlyingTyp
}
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
ComplexKeyHashedDictionary
::
getItemsNumber
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) getItemsImpl<TYPE, OutputType>( \
attribute, key_columns, std::forward<ValueSetter>(set_value), std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
ComplexKeyHashedDictionary
::
getItemsImpl
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/ComplexKeyHashedDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -218,16 +218,10 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsNumber
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsImpl
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
T
>
bool
setAttributeValueImpl
(
Attribute
&
attribute
,
const
StringRef
key
,
const
T
value
);
...
...
dbms/src/Dictionaries/FlatDictionary.cpp
浏览文件 @
49e12eaa
...
...
@@ -55,7 +55,7 @@ void FlatDictionary::toParent(const PaddedPODArray<Key> & ids, PaddedPODArray<Ke
{
const
auto
null_value
=
std
::
get
<
UInt64
>
(
hierarchical_attribute
->
null_values
);
getItems
Number
<
UInt64
>
(
getItems
Impl
<
UInt64
,
UInt64
>
(
*
hierarchical_attribute
,
ids
,
[
&
](
const
size_t
row
,
const
UInt64
value
)
{
out
[
row
]
=
value
;
},
...
...
@@ -121,7 +121,7 @@ void FlatDictionary::isInConstantVector(const Key child_id, const PaddedPODArray
\
const auto null_value = std::get<TYPE>(attribute.null_values); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return null_value; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -164,7 +164,7 @@ void FlatDictionary::getString(const std::string & attribute_name, const PaddedP
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t row) { return def[row]; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -203,7 +203,7 @@ void FlatDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return def; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -568,35 +568,6 @@ FlatDictionary::Attribute FlatDictionary::createAttributeWithType(const Attribut
}
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
FlatDictionary
::
getItemsNumber
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) \
getItemsImpl<TYPE, OutputType>(attribute, ids, std::forward<ValueSetter>(set_value), std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
FlatDictionary
::
getItemsImpl
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/FlatDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -206,10 +206,6 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsNumber
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsImpl
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
...
...
dbms/src/Dictionaries/HashedDictionary.cpp
浏览文件 @
49e12eaa
...
...
@@ -49,7 +49,7 @@ void HashedDictionary::toParent(const PaddedPODArray<Key> & ids, PaddedPODArray<
{
const
auto
null_value
=
std
::
get
<
UInt64
>
(
hierarchical_attribute
->
null_values
);
getItems
Number
<
UInt64
>
(
getItems
Impl
<
UInt64
,
UInt64
>
(
*
hierarchical_attribute
,
ids
,
[
&
](
const
size_t
row
,
const
UInt64
value
)
{
out
[
row
]
=
value
;
},
...
...
@@ -120,7 +120,7 @@ void HashedDictionary::isInConstantVector(const Key child_id, const PaddedPODArr
\
const auto null_value = std::get<TYPE>(attribute.null_values); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return null_value; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -163,7 +163,7 @@ void HashedDictionary::getString(const std::string & attribute_name, const Padde
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t row) { return def[row]; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -202,7 +202,7 @@ void HashedDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, ids, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return def; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -555,34 +555,6 @@ HashedDictionary::Attribute HashedDictionary::createAttributeWithType(const Attr
}
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
HashedDictionary
::
getItemsNumber
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) \
getItemsImpl<TYPE, OutputType>(attribute, ids, std::forward<ValueSetter>(set_value), std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
HashedDictionary
::
getItemsImpl
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/HashedDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -211,10 +211,6 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsNumber
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsImpl
(
const
Attribute
&
attribute
,
const
PaddedPODArray
<
Key
>
&
ids
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
...
...
dbms/src/Dictionaries/TrieDictionary.cpp
浏览文件 @
49e12eaa
...
...
@@ -79,7 +79,7 @@ TrieDictionary::~TrieDictionary()
\
const auto null_value = std::get<TYPE>(attribute.null_values); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, \
key_columns, \
[&](const size_t row, const auto value) { out[row] = value; }, \
...
...
@@ -131,7 +131,7 @@ void TrieDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, \
key_columns, \
[&](const size_t row, const auto value) { out[row] = value; }, \
...
...
@@ -185,7 +185,7 @@ void TrieDictionary::getString(
const auto & attribute = getAttribute(attribute_name); \
checkAttributeType(name, attribute_name, attribute.type, AttributeUnderlyingType::TYPE); \
\
getItems
Number<
TYPE>( \
getItems
Impl<TYPE,
TYPE>( \
attribute, key_columns, [&](const size_t row, const auto value) { out[row] = value; }, [&](const size_t) { return def; }); \
}
DECLARE
(
UInt8
)
...
...
@@ -495,34 +495,6 @@ TrieDictionary::Attribute TrieDictionary::createAttributeWithType(const Attribut
}
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
TrieDictionary
::
getItemsNumber
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
{
if
(
false
)
{
}
#define DISPATCH(TYPE) \
else if (attribute.type == AttributeUnderlyingType::TYPE) getItemsImpl<TYPE, OutputType>( \
attribute, key_columns, std::forward<ValueSetter>(set_value), std::forward<DefaultGetter>(get_default));
DISPATCH
(
UInt8
)
DISPATCH
(
UInt16
)
DISPATCH
(
UInt32
)
DISPATCH
(
UInt64
)
DISPATCH
(
UInt128
)
DISPATCH
(
Int8
)
DISPATCH
(
Int16
)
DISPATCH
(
Int32
)
DISPATCH
(
Int64
)
DISPATCH
(
Float32
)
DISPATCH
(
Float64
)
DISPATCH
(
Decimal32
)
DISPATCH
(
Decimal64
)
DISPATCH
(
Decimal128
)
#undef DISPATCH
else
throw
Exception
(
"Unexpected type of attribute: "
+
toString
(
attribute
.
type
),
ErrorCodes
::
LOGICAL_ERROR
);
}
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
TrieDictionary
::
getItemsImpl
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
...
...
dbms/src/Dictionaries/TrieDictionary.h
浏览文件 @
49e12eaa
...
...
@@ -218,10 +218,6 @@ private:
Attribute
createAttributeWithType
(
const
AttributeUnderlyingType
type
,
const
Field
&
null_value
);
template
<
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsNumber
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
template
<
typename
AttributeType
,
typename
OutputType
,
typename
ValueSetter
,
typename
DefaultGetter
>
void
getItemsImpl
(
const
Attribute
&
attribute
,
const
Columns
&
key_columns
,
ValueSetter
&&
set_value
,
DefaultGetter
&&
get_default
)
const
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录