Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
2b188ba6
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,发现更多精彩内容 >>
提交
2b188ba6
编写于
8月 22, 2014
作者:
A
Alexey Milovidov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dbms: improved build time [#METR-2944].
上级
bc887b15
变更
28
隐藏空白更改
内联
并排
Showing
28 changed file
with
597 addition
and
250 deletion
+597
-250
dbms/include/DB/Functions/FunctionFactory.h
dbms/include/DB/Functions/FunctionFactory.h
+12
-4
dbms/include/DB/Functions/FunctionsCoding.h
dbms/include/DB/Functions/FunctionsCoding.h
+2
-0
dbms/include/DB/Functions/FunctionsFormatting.h
dbms/include/DB/Functions/FunctionsFormatting.h
+1
-1
dbms/include/DB/Functions/FunctionsStringArray.h
dbms/include/DB/Functions/FunctionsStringArray.h
+1
-1
dbms/include/DB/Functions/FunctionsStringSearch.h
dbms/include/DB/Functions/FunctionsStringSearch.h
+2
-0
dbms/include/DB/Interpreters/Context.h
dbms/include/DB/Interpreters/Context.h
+4
-6
dbms/src/Functions/FunctionFactory.cpp
dbms/src/Functions/FunctionFactory.cpp
+52
-238
dbms/src/Functions/FunctionsArithmetic.cpp
dbms/src/Functions/FunctionsArithmetic.cpp
+28
-0
dbms/src/Functions/FunctionsArray.cpp
dbms/src/Functions/FunctionsArray.cpp
+22
-0
dbms/src/Functions/FunctionsCoding.cpp
dbms/src/Functions/FunctionsCoding.cpp
+21
-0
dbms/src/Functions/FunctionsComparison.cpp
dbms/src/Functions/FunctionsComparison.cpp
+21
-0
dbms/src/Functions/FunctionsConditional.cpp
dbms/src/Functions/FunctionsConditional.cpp
+16
-0
dbms/src/Functions/FunctionsConversion.cpp
dbms/src/Functions/FunctionsConversion.cpp
+29
-0
dbms/src/Functions/FunctionsDateTime.cpp
dbms/src/Functions/FunctionsDateTime.cpp
+39
-0
dbms/src/Functions/FunctionsDictionaries.cpp
dbms/src/Functions/FunctionsDictionaries.cpp
+49
-0
dbms/src/Functions/FunctionsFormatting.cpp
dbms/src/Functions/FunctionsFormatting.cpp
+16
-0
dbms/src/Functions/FunctionsHashing.cpp
dbms/src/Functions/FunctionsHashing.cpp
+21
-0
dbms/src/Functions/FunctionsHigherOrder.cpp
dbms/src/Functions/FunctionsHigherOrder.cpp
+21
-0
dbms/src/Functions/FunctionsLogical.cpp
dbms/src/Functions/FunctionsLogical.cpp
+19
-0
dbms/src/Functions/FunctionsMiscellaneous.cpp
dbms/src/Functions/FunctionsMiscellaneous.cpp
+31
-0
dbms/src/Functions/FunctionsRandom.cpp
dbms/src/Functions/FunctionsRandom.cpp
+17
-0
dbms/src/Functions/FunctionsReinterpret.cpp
dbms/src/Functions/FunctionsReinterpret.cpp
+28
-0
dbms/src/Functions/FunctionsRound.cpp
dbms/src/Functions/FunctionsRound.cpp
+18
-0
dbms/src/Functions/FunctionsString.cpp
dbms/src/Functions/FunctionsString.cpp
+28
-0
dbms/src/Functions/FunctionsStringArray.cpp
dbms/src/Functions/FunctionsStringArray.cpp
+19
-0
dbms/src/Functions/FunctionsStringSearch.cpp
dbms/src/Functions/FunctionsStringSearch.cpp
+25
-0
dbms/src/Functions/FunctionsURL.cpp
dbms/src/Functions/FunctionsURL.cpp
+33
-0
dbms/src/Functions/FunctionsVisitParam.cpp
dbms/src/Functions/FunctionsVisitParam.cpp
+22
-0
未找到文件。
dbms/include/DB/Functions/FunctionFactory.h
浏览文件 @
2b188ba6
#pragma once
#include <Poco/SharedPtr.h>
#include <DB/Functions/IFunction.h>
...
...
@@ -17,10 +16,19 @@ class Context;
*/
class
FunctionFactory
{
private:
typedef
std
::
function
<
IFunction
*
(
const
Context
&
context
)
>
Creator
;
std
::
unordered_map
<
String
,
Creator
>
functions
;
public:
FunctionPtr
get
(
const
String
&
name
,
const
Context
&
context
)
const
;
FunctionFactory
();
FunctionPtr
get
(
const
String
&
name
,
const
Context
&
context
)
const
;
void
registerFunction
(
const
String
&
name
,
Creator
creator
)
{
functions
[
name
]
=
creator
;
}
};
}
dbms/include/DB/Functions/FunctionsCoding.h
浏览文件 @
2b188ba6
...
...
@@ -4,10 +4,12 @@
#include <DB/DataTypes/DataTypesNumberFixed.h>
#include <DB/DataTypes/DataTypeString.h>
#include <DB/DataTypes/DataTypeFixedString.h>
#include <DB/DataTypes/DataTypeArray.h>
#include <DB/DataTypes/DataTypeDate.h>
#include <DB/DataTypes/DataTypeDateTime.h>
#include <DB/Columns/ColumnString.h>
#include <DB/Columns/ColumnFixedString.h>
#include <DB/Columns/ColumnArray.h>
#include <DB/Columns/ColumnConst.h>
#include <DB/Functions/IFunction.h>
...
...
dbms/include/DB/Functions/FunctionsFormatting.h
浏览文件 @
2b188ba6
#include <DB/Functions/IFunction.h>
#include "NumberTraits.h"
#include <DB/Columns/ColumnString.h>
#include <DB/DataTypes/DataTypeString.h>
#include <DB/DataTypes/DataTypesNumberFixed.h>
#include <DB/IO/WriteBufferFromVector.h>
#include <DB/IO/WriteBufferFromString.h>
...
...
dbms/include/DB/Functions/FunctionsStringArray.h
浏览文件 @
2b188ba6
#pragma once
#include <DB/DataTypes/DataTypeString.h>
#include <DB/DataTypes/DataTypeArray.h>
#include <DB/Columns/ColumnString.h>
#include <DB/Columns/ColumnFixedString.h>
#include <DB/Columns/ColumnConst.h>
#include <DB/Columns/ColumnArray.h>
#include <DB/Functions/IFunction.h>
...
...
dbms/include/DB/Functions/FunctionsStringSearch.h
浏览文件 @
2b188ba6
...
...
@@ -7,7 +7,9 @@
#include <DB/DataTypes/DataTypesNumberFixed.h>
#include <DB/DataTypes/DataTypeString.h>
#include <DB/DataTypes/DataTypeFixedString.h>
#include <DB/Columns/ColumnString.h>
#include <DB/Columns/ColumnFixedString.h>
#include <DB/Columns/ColumnConst.h>
#include <DB/Common/Volnitsky.h>
#include <DB/Functions/IFunction.h>
...
...
dbms/include/DB/Interpreters/Context.h
浏览文件 @
2b188ba6
...
...
@@ -57,8 +57,8 @@ typedef std::vector<DatabaseAndTableName> Dependencies;
*/
struct
ContextShared
{
Logger
*
log
;
/// Логгер.
Logger
*
log
=
&
Logger
::
get
(
"Context"
);
/// Логгер.
struct
AfterDestroy
{
Logger
*
log
;
...
...
@@ -70,7 +70,7 @@ struct ContextShared
LOG_INFO
(
log
,
"Uninitialized shared context."
);
#endif
}
}
after_destroy
;
}
after_destroy
{
log
}
;
mutable
Poco
::
Mutex
mutex
;
/// Для доступа и модификации разделяемых объектов.
...
...
@@ -107,8 +107,6 @@ struct ContextShared
bool
shutdown_called
=
false
;
ContextShared
()
:
log
(
&
Logger
::
get
(
"Context"
)),
after_destroy
(
log
)
{};
~
ContextShared
()
{
#ifndef DBMS_CLIENT
...
...
@@ -229,7 +227,7 @@ public:
/// Возвращает отцепленную таблицу.
StoragePtr
detachTable
(
const
String
&
database_name
,
const
String
&
table_name
);
void
detachDatabase
(
const
String
&
database_name
);
String
getCurrentDatabase
()
const
;
...
...
dbms/src/Functions/FunctionFactory.cpp
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionsArithmetic.h>
#include <DB/Functions/FunctionsComparison.h>
#include <DB/Functions/FunctionsLogical.h>
#include <DB/Functions/FunctionsString.h>
#include <DB/Functions/FunctionsConversion.h>
#include <DB/Functions/FunctionsDateTime.h>
#include <DB/Functions/FunctionsStringSearch.h>
#include <DB/Functions/FunctionsHashing.h>
#include <DB/Functions/FunctionsRandom.h>
#include <DB/Functions/FunctionsURL.h>
#include <DB/Functions/FunctionsArray.h>
#include <DB/Functions/FunctionsStringArray.h>
#include <DB/Functions/FunctionsConditional.h>
#include <DB/Functions/FunctionsDictionaries.h>
#include <DB/Functions/FunctionsMiscellaneous.h>
#include <DB/Functions/FunctionsRound.h>
#include <DB/Functions/FunctionsReinterpret.h>
#include <DB/Functions/FunctionsFormatting.h>
#include <DB/Functions/FunctionsCoding.h>
#include <DB/Functions/FunctionsHigherOrder.h>
#include <DB/Functions/FunctionsVisitParam.h>
#include <DB/Functions/FunctionFactory.h>
namespace
DB
{
/** Эти функции определены в отдельных translation unit-ах.
* Это сделано для того, чтобы уменьшить потребление оперативки при сборке, и ускорить параллельную сборку.
*/
void
registerFunctionsArithmetic
(
FunctionFactory
&
);
void
registerFunctionsArray
(
FunctionFactory
&
);
void
registerFunctionsCoding
(
FunctionFactory
&
);
void
registerFunctionsComparison
(
FunctionFactory
&
);
void
registerFunctionsConditional
(
FunctionFactory
&
);
void
registerFunctionsConversion
(
FunctionFactory
&
);
void
registerFunctionsDateTime
(
FunctionFactory
&
);
void
registerFunctionsDictionaries
(
FunctionFactory
&
);
void
registerFunctionsFormatting
(
FunctionFactory
&
);
void
registerFunctionsHashing
(
FunctionFactory
&
);
void
registerFunctionsHigherOrder
(
FunctionFactory
&
);
void
registerFunctionsLogical
(
FunctionFactory
&
);
void
registerFunctionsMiscellaneous
(
FunctionFactory
&
);
void
registerFunctionsRandom
(
FunctionFactory
&
);
void
registerFunctionsReinterpret
(
FunctionFactory
&
);
void
registerFunctionsRound
(
FunctionFactory
&
);
void
registerFunctionsString
(
FunctionFactory
&
);
void
registerFunctionsStringArray
(
FunctionFactory
&
);
void
registerFunctionsStringSearch
(
FunctionFactory
&
);
void
registerFunctionsURL
(
FunctionFactory
&
);
void
registerFunctionsVisitParam
(
FunctionFactory
&
);
FunctionFactory
::
FunctionFactory
()
{
registerFunctionsArithmetic
(
*
this
);
registerFunctionsArray
(
*
this
);
registerFunctionsCoding
(
*
this
);
registerFunctionsComparison
(
*
this
);
registerFunctionsConditional
(
*
this
);
registerFunctionsConversion
(
*
this
);
registerFunctionsDateTime
(
*
this
);
registerFunctionsDictionaries
(
*
this
);
registerFunctionsFormatting
(
*
this
);
registerFunctionsHashing
(
*
this
);
registerFunctionsHigherOrder
(
*
this
);
registerFunctionsLogical
(
*
this
);
registerFunctionsMiscellaneous
(
*
this
);
registerFunctionsRandom
(
*
this
);
registerFunctionsReinterpret
(
*
this
);
registerFunctionsRound
(
*
this
);
registerFunctionsString
(
*
this
);
registerFunctionsStringArray
(
*
this
);
registerFunctionsStringSearch
(
*
this
);
registerFunctionsURL
(
*
this
);
registerFunctionsVisitParam
(
*
this
);
}
FunctionPtr
FunctionFactory
::
get
(
const
String
&
name
,
const
Context
&
context
)
const
{
static
const
std
::
unordered_map
<
std
::
string
,
std
::
function
<
IFunction
*
(
const
Context
&
context
)
>>
functions
=
{
#define F [](const Context & context)
{
"plus"
,
F
{
return
new
FunctionPlus
;
}
},
{
"minus"
,
F
{
return
new
FunctionMinus
;
}
},
{
"multiply"
,
F
{
return
new
FunctionMultiply
;
}
},
{
"divide"
,
F
{
return
new
FunctionDivideFloating
;
}
},
{
"intDiv"
,
F
{
return
new
FunctionDivideIntegral
;
}
},
{
"modulo"
,
F
{
return
new
FunctionModulo
;
}
},
{
"negate"
,
F
{
return
new
FunctionNegate
;
}
},
{
"bitAnd"
,
F
{
return
new
FunctionBitAnd
;
}
},
{
"bitOr"
,
F
{
return
new
FunctionBitOr
;
}
},
{
"bitXor"
,
F
{
return
new
FunctionBitXor
;
}
},
{
"bitNot"
,
F
{
return
new
FunctionBitNot
;
}
},
{
"bitShiftLeft"
,
F
{
return
new
FunctionBitShiftLeft
;
}
},
{
"bitShiftRight"
,
F
{
return
new
FunctionBitShiftRight
;
}
},
{
"equals"
,
F
{
return
new
FunctionEquals
;
}
},
{
"notEquals"
,
F
{
return
new
FunctionNotEquals
;
}
},
{
"less"
,
F
{
return
new
FunctionLess
;
}
},
{
"greater"
,
F
{
return
new
FunctionGreater
;
}
},
{
"lessOrEquals"
,
F
{
return
new
FunctionLessOrEquals
;
}
},
{
"greaterOrEquals"
,
F
{
return
new
FunctionGreaterOrEquals
;
}
},
{
"and"
,
F
{
return
new
FunctionAnd
;
}
},
{
"or"
,
F
{
return
new
FunctionOr
;
}
},
{
"xor"
,
F
{
return
new
FunctionXor
;
}
},
{
"not"
,
F
{
return
new
FunctionNot
;
}
},
{
"roundToExp2"
,
F
{
return
new
FunctionRoundToExp2
;
}
},
{
"roundDuration"
,
F
{
return
new
FunctionRoundDuration
;
}
},
{
"roundAge"
,
F
{
return
new
FunctionRoundAge
;
}
},
{
"empty"
,
F
{
return
new
FunctionEmpty
;
}
},
{
"notEmpty"
,
F
{
return
new
FunctionNotEmpty
;
}
},
{
"length"
,
F
{
return
new
FunctionLength
;
}
},
{
"lengthUTF8"
,
F
{
return
new
FunctionLengthUTF8
;
}
},
{
"lower"
,
F
{
return
new
FunctionLower
;
}
},
{
"upper"
,
F
{
return
new
FunctionUpper
;
}
},
{
"lowerUTF8"
,
F
{
return
new
FunctionLowerUTF8
;
}
},
{
"upperUTF8"
,
F
{
return
new
FunctionUpperUTF8
;
}
},
{
"reverse"
,
F
{
return
new
FunctionReverse
;
}
},
{
"reverseUTF8"
,
F
{
return
new
FunctionReverseUTF8
;
}
},
{
"concat"
,
F
{
return
new
FunctionConcat
;
}
},
{
"substring"
,
F
{
return
new
FunctionSubstring
;
}
},
{
"replaceOne"
,
F
{
return
new
FunctionReplaceOne
;
}
},
{
"replaceAll"
,
F
{
return
new
FunctionReplaceAll
;
}
},
{
"replaceRegexpOne"
,
F
{
return
new
FunctionReplaceRegexpOne
;
}
},
{
"replaceRegexpAll"
,
F
{
return
new
FunctionReplaceRegexpAll
;
}
},
{
"substringUTF8"
,
F
{
return
new
FunctionSubstringUTF8
;
}
},
{
"toUInt8"
,
F
{
return
new
FunctionToUInt8
;
}
},
{
"toUInt16"
,
F
{
return
new
FunctionToUInt16
;
}
},
{
"toUInt32"
,
F
{
return
new
FunctionToUInt32
;
}
},
{
"toUInt64"
,
F
{
return
new
FunctionToUInt64
;
}
},
{
"toInt8"
,
F
{
return
new
FunctionToInt8
;
}
},
{
"toInt16"
,
F
{
return
new
FunctionToInt16
;
}
},
{
"toInt32"
,
F
{
return
new
FunctionToInt32
;
}
},
{
"toInt64"
,
F
{
return
new
FunctionToInt64
;
}
},
{
"toFloat32"
,
F
{
return
new
FunctionToFloat32
;
}
},
{
"toFloat64"
,
F
{
return
new
FunctionToFloat64
;
}
},
{
"toDate"
,
F
{
return
new
FunctionToDate
;
}
},
{
"toDateTime"
,
F
{
return
new
FunctionToDateTime
;
}
},
{
"toString"
,
F
{
return
new
FunctionToString
;
}
},
{
"toFixedString"
,
F
{
return
new
FunctionToFixedString
;
}
},
{
"toStringCutToZero"
,
F
{
return
new
FunctionToStringCutToZero
;
}
},
{
"reinterpretAsUInt8"
,
F
{
return
new
FunctionReinterpretAsUInt8
;
}
},
{
"reinterpretAsUInt16"
,
F
{
return
new
FunctionReinterpretAsUInt16
;
}
},
{
"reinterpretAsUInt32"
,
F
{
return
new
FunctionReinterpretAsUInt32
;
}
},
{
"reinterpretAsUInt64"
,
F
{
return
new
FunctionReinterpretAsUInt64
;
}
},
{
"reinterpretAsInt8"
,
F
{
return
new
FunctionReinterpretAsInt8
;
}
},
{
"reinterpretAsInt16"
,
F
{
return
new
FunctionReinterpretAsInt16
;
}
},
{
"reinterpretAsInt32"
,
F
{
return
new
FunctionReinterpretAsInt32
;
}
},
{
"reinterpretAsInt64"
,
F
{
return
new
FunctionReinterpretAsInt64
;
}
},
{
"reinterpretAsFloat32"
,
F
{
return
new
FunctionReinterpretAsFloat32
;
}
},
{
"reinterpretAsFloat64"
,
F
{
return
new
FunctionReinterpretAsFloat64
;
}
},
{
"reinterpretAsDate"
,
F
{
return
new
FunctionReinterpretAsDate
;
}
},
{
"reinterpretAsDateTime"
,
F
{
return
new
FunctionReinterpretAsDateTime
;
}
},
{
"reinterpretAsString"
,
F
{
return
new
FunctionReinterpretAsString
;
}
},
{
"toYear"
,
F
{
return
new
FunctionToYear
;
}
},
{
"toMonth"
,
F
{
return
new
FunctionToMonth
;
}
},
{
"toDayOfMonth"
,
F
{
return
new
FunctionToDayOfMonth
;
}
},
{
"toDayOfWeek"
,
F
{
return
new
FunctionToDayOfWeek
;
}
},
{
"toHour"
,
F
{
return
new
FunctionToHour
;
}
},
{
"toMinute"
,
F
{
return
new
FunctionToMinute
;
}
},
{
"toSecond"
,
F
{
return
new
FunctionToSecond
;
}
},
{
"toMonday"
,
F
{
return
new
FunctionToMonday
;
}
},
{
"toStartOfMonth"
,
F
{
return
new
FunctionToStartOfMonth
;
}
},
{
"toStartOfQuarter"
,
F
{
return
new
FunctionToStartOfQuarter
;
}
},
{
"toStartOfYear"
,
F
{
return
new
FunctionToStartOfYear
;
}
},
{
"toStartOfMinute"
,
F
{
return
new
FunctionToStartOfMinute
;
}
},
{
"toStartOfHour"
,
F
{
return
new
FunctionToStartOfHour
;
}
},
{
"toRelativeYearNum"
,
F
{
return
new
FunctionToRelativeYearNum
;
}
},
{
"toRelativeMonthNum"
,
F
{
return
new
FunctionToRelativeMonthNum
;
}
},
{
"toRelativeWeekNum"
,
F
{
return
new
FunctionToRelativeWeekNum
;
}
},
{
"toRelativeDayNum"
,
F
{
return
new
FunctionToRelativeDayNum
;
}
},
{
"toRelativeHourNum"
,
F
{
return
new
FunctionToRelativeHourNum
;
}
},
{
"toRelativeMinuteNum"
,
F
{
return
new
FunctionToRelativeMinuteNum
;
}
},
{
"toRelativeSecondNum"
,
F
{
return
new
FunctionToRelativeSecondNum
;
}
},
{
"toTime"
,
F
{
return
new
FunctionToTime
;
}
},
{
"now"
,
F
{
return
new
FunctionNow
;
}
},
{
"timeSlot"
,
F
{
return
new
FunctionTimeSlot
;
}
},
{
"timeSlots"
,
F
{
return
new
FunctionTimeSlots
;
}
},
{
"position"
,
F
{
return
new
FunctionPosition
;
}
},
{
"positionUTF8"
,
F
{
return
new
FunctionPositionUTF8
;
}
},
{
"match"
,
F
{
return
new
FunctionMatch
;
}
},
{
"like"
,
F
{
return
new
FunctionLike
;
}
},
{
"notLike"
,
F
{
return
new
FunctionNotLike
;
}
},
{
"extract"
,
F
{
return
new
FunctionExtract
;
}
},
{
"extractAll"
,
F
{
return
new
FunctionExtractAll
;
}
},
{
"halfMD5"
,
F
{
return
new
FunctionHalfMD5
;
}
},
{
"sipHash64"
,
F
{
return
new
FunctionSipHash64
;
}
},
{
"cityHash64"
,
F
{
return
new
FunctionCityHash64
;
}
},
{
"intHash32"
,
F
{
return
new
FunctionIntHash32
;
}
},
{
"intHash64"
,
F
{
return
new
FunctionIntHash64
;
}
},
{
"IPv4NumToString"
,
F
{
return
new
FunctionIPv4NumToString
;
}
},
{
"IPv4StringToNum"
,
F
{
return
new
FunctionIPv4StringToNum
;
}
},
{
"hex"
,
F
{
return
new
FunctionHex
;
}
},
{
"unhex"
,
F
{
return
new
FunctionUnhex
;
}
},
{
"bitmaskToList"
,
F
{
return
new
FunctionBitmaskToList
;
}
},
{
"bitmaskToArray"
,
F
{
return
new
FunctionBitmaskToArray
;
}
},
{
"rand"
,
F
{
return
new
FunctionRand
;
}
},
{
"rand64"
,
F
{
return
new
FunctionRand64
;
}
},
{
"protocol"
,
F
{
return
new
FunctionProtocol
;
}
},
{
"domain"
,
F
{
return
new
FunctionDomain
;
}
},
{
"domainWithoutWWW"
,
F
{
return
new
FunctionDomainWithoutWWW
;
}
},
{
"topLevelDomain"
,
F
{
return
new
FunctionTopLevelDomain
;
}
},
{
"path"
,
F
{
return
new
FunctionPath
;
}
},
{
"queryString"
,
F
{
return
new
FunctionQueryString
;
}
},
{
"fragment"
,
F
{
return
new
FunctionFragment
;
}
},
{
"queryStringAndFragment"
,
F
{
return
new
FunctionQueryStringAndFragment
;
}
},
{
"extractURLParameter"
,
F
{
return
new
FunctionExtractURLParameter
;
}
},
{
"extractURLParameters"
,
F
{
return
new
FunctionExtractURLParameters
;
}
},
{
"extractURLParameterNames"
,
F
{
return
new
FunctionExtractURLParameterNames
;
}
},
{
"URLHierarchy"
,
F
{
return
new
FunctionURLHierarchy
;
}
},
{
"URLPathHierarchy"
,
F
{
return
new
FunctionURLPathHierarchy
;
}
},
{
"cutWWW"
,
F
{
return
new
FunctionCutWWW
;
}
},
{
"cutQueryString"
,
F
{
return
new
FunctionCutQueryString
;
}
},
{
"cutFragment"
,
F
{
return
new
FunctionCutFragment
;
}
},
{
"cutQueryStringAndFragment"
,
F
{
return
new
FunctionCutQueryStringAndFragment
;
}
},
{
"cutURLParameter"
,
F
{
return
new
FunctionCutURLParameter
;
}
},
{
"hostName"
,
F
{
return
new
FunctionHostName
;
}
},
{
"visibleWidth"
,
F
{
return
new
FunctionVisibleWidth
;
}
},
{
"bar"
,
F
{
return
new
FunctionBar
;
}
},
{
"toTypeName"
,
F
{
return
new
FunctionToTypeName
;
}
},
{
"blockSize"
,
F
{
return
new
FunctionBlockSize
;
}
},
{
"sleep"
,
F
{
return
new
FunctionSleep
;
}
},
{
"materialize"
,
F
{
return
new
FunctionMaterialize
;
}
},
{
"ignore"
,
F
{
return
new
FunctionIgnore
;
}
},
{
"arrayJoin"
,
F
{
return
new
FunctionArrayJoin
;
}
},
{
"tuple"
,
F
{
return
new
FunctionTuple
;
}
},
{
"tupleElement"
,
F
{
return
new
FunctionTupleElement
;
}
},
{
"in"
,
F
{
return
new
FunctionIn
(
false
,
false
);
}
},
{
"notIn"
,
F
{
return
new
FunctionIn
(
true
,
false
);
}
},
{
"globalIn"
,
F
{
return
new
FunctionIn
(
false
,
true
);
}
},
{
"globalNotIn"
,
F
{
return
new
FunctionIn
(
true
,
true
);
}
},
{
"array"
,
F
{
return
new
FunctionArray
;
}
},
{
"arrayElement"
,
F
{
return
new
FunctionArrayElement
;
}
},
{
"has"
,
F
{
return
new
FunctionHas
;
}
},
{
"indexOf"
,
F
{
return
new
FunctionIndexOf
;
}
},
{
"countEqual"
,
F
{
return
new
FunctionCountEqual
;
}
},
{
"arrayEnumerate"
,
F
{
return
new
FunctionArrayEnumerate
;
}
},
{
"arrayEnumerateUniq"
,
F
{
return
new
FunctionArrayEnumerateUniq
;
}
},
{
"arrayMap"
,
F
{
return
new
FunctionArrayMap
;
}
},
{
"arrayFilter"
,
F
{
return
new
FunctionArrayFilter
;
}
},
{
"arrayCount"
,
F
{
return
new
FunctionArrayCount
;
}
},
{
"arrayExists"
,
F
{
return
new
FunctionArrayExists
;
}
},
{
"arrayAll"
,
F
{
return
new
FunctionArrayAll
;
}
},
{
"arraySum"
,
F
{
return
new
FunctionArraySum
;
}
},
{
"alphaTokens"
,
F
{
return
new
FunctionAlphaTokens
;
}
},
{
"splitByChar"
,
F
{
return
new
FunctionSplitByChar
;
}
},
{
"splitByString"
,
F
{
return
new
FunctionSplitByString
;
}
},
{
"if"
,
F
{
return
new
FunctionIf
;
}
},
{
"regionToCity"
,
F
{
return
new
FunctionRegionToCity
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"regionToArea"
,
F
{
return
new
FunctionRegionToArea
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"regionToCountry"
,
F
{
return
new
FunctionRegionToCountry
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"regionToContinent"
,
F
{
return
new
FunctionRegionToContinent
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"OSToRoot"
,
F
{
return
new
FunctionOSToRoot
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"SEToRoot"
,
F
{
return
new
FunctionSEToRoot
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"categoryToRoot"
,
F
{
return
new
FunctionCategoryToRoot
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
}
},
{
"categoryToSecondLevel"
,
F
{
return
new
FunctionCategoryToSecondLevel
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
}
},
{
"regionIn"
,
F
{
return
new
FunctionRegionIn
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"OSIn"
,
F
{
return
new
FunctionOSIn
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"SEIn"
,
F
{
return
new
FunctionSEIn
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"categoryIn"
,
F
{
return
new
FunctionCategoryIn
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
}
},
{
"regionHierarchy"
,
F
{
return
new
FunctionRegionHierarchy
(
context
.
getDictionaries
().
getRegionsHierarchies
());
}
},
{
"OSHierarchy"
,
F
{
return
new
FunctionOSHierarchy
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"SEHierarchy"
,
F
{
return
new
FunctionSEHierarchy
(
context
.
getDictionaries
().
getTechDataHierarchy
());
}
},
{
"categoryHierarchy"
,
F
{
return
new
FunctionCategoryHierarchy
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
}
},
{
"regionToName"
,
F
{
return
new
FunctionRegionToName
(
context
.
getDictionaries
().
getRegionsNames
());
}
},
{
"visitParamHas"
,
F
{
return
new
FunctionVisitParamHas
;
}
},
{
"visitParamExtractUInt"
,
F
{
return
new
FunctionVisitParamExtractUInt
;
}
},
{
"visitParamExtractInt"
,
F
{
return
new
FunctionVisitParamExtractInt
;
}
},
{
"visitParamExtractFloat"
,
F
{
return
new
FunctionVisitParamExtractFloat
;
}
},
{
"visitParamExtractBool"
,
F
{
return
new
FunctionVisitParamExtractBool
;
}
},
{
"visitParamExtractRaw"
,
F
{
return
new
FunctionVisitParamExtractRaw
;
}
},
{
"visitParamExtractString"
,
F
{
return
new
FunctionVisitParamExtractString
;
}
},
};
auto
it
=
functions
.
find
(
name
);
if
(
functions
.
end
()
!=
it
)
return
it
->
second
(
context
);
...
...
dbms/src/Functions/FunctionsArithmetic.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsArithmetic.h>
namespace
DB
{
void
registerFunctionsArithmetic
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"plus"
,
F
{
return
new
FunctionPlus
;
});
factory
.
registerFunction
(
"minus"
,
F
{
return
new
FunctionMinus
;
});
factory
.
registerFunction
(
"multiply"
,
F
{
return
new
FunctionMultiply
;
});
factory
.
registerFunction
(
"divide"
,
F
{
return
new
FunctionDivideFloating
;
});
factory
.
registerFunction
(
"intDiv"
,
F
{
return
new
FunctionDivideIntegral
;
});
factory
.
registerFunction
(
"modulo"
,
F
{
return
new
FunctionModulo
;
});
factory
.
registerFunction
(
"negate"
,
F
{
return
new
FunctionNegate
;
});
factory
.
registerFunction
(
"bitAnd"
,
F
{
return
new
FunctionBitAnd
;
});
factory
.
registerFunction
(
"bitOr"
,
F
{
return
new
FunctionBitOr
;
});
factory
.
registerFunction
(
"bitXor"
,
F
{
return
new
FunctionBitXor
;
});
factory
.
registerFunction
(
"bitNot"
,
F
{
return
new
FunctionBitNot
;
});
factory
.
registerFunction
(
"bitShiftLeft"
,
F
{
return
new
FunctionBitShiftLeft
;
});
factory
.
registerFunction
(
"bitShiftRight"
,
F
{
return
new
FunctionBitShiftRight
;
});
#undef F
}
}
dbms/src/Functions/FunctionsArray.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsArray.h>
namespace
DB
{
void
registerFunctionsArray
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"array"
,
F
{
return
new
FunctionArray
;
});
factory
.
registerFunction
(
"arrayElement"
,
F
{
return
new
FunctionArrayElement
;
});
factory
.
registerFunction
(
"has"
,
F
{
return
new
FunctionHas
;
});
factory
.
registerFunction
(
"indexOf"
,
F
{
return
new
FunctionIndexOf
;
});
factory
.
registerFunction
(
"countEqual"
,
F
{
return
new
FunctionCountEqual
;
});
factory
.
registerFunction
(
"arrayEnumerate"
,
F
{
return
new
FunctionArrayEnumerate
;
});
factory
.
registerFunction
(
"arrayEnumerateUniq"
,
F
{
return
new
FunctionArrayEnumerateUniq
;
});
#undef F
}
}
dbms/src/Functions/FunctionsCoding.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsCoding.h>
namespace
DB
{
void
registerFunctionsCoding
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"toStringCutToZero"
,
F
{
return
new
FunctionToStringCutToZero
;
});
factory
.
registerFunction
(
"IPv4NumToString"
,
F
{
return
new
FunctionIPv4NumToString
;
});
factory
.
registerFunction
(
"IPv4StringToNum"
,
F
{
return
new
FunctionIPv4StringToNum
;
});
factory
.
registerFunction
(
"hex"
,
F
{
return
new
FunctionHex
;
});
factory
.
registerFunction
(
"unhex"
,
F
{
return
new
FunctionUnhex
;
});
factory
.
registerFunction
(
"bitmaskToArray"
,
F
{
return
new
FunctionBitmaskToArray
;
});
#undef F
}
}
dbms/src/Functions/FunctionsComparison.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsComparison.h>
namespace
DB
{
void
registerFunctionsComparison
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"equals"
,
F
{
return
new
FunctionEquals
;
});
factory
.
registerFunction
(
"notEquals"
,
F
{
return
new
FunctionNotEquals
;
});
factory
.
registerFunction
(
"less"
,
F
{
return
new
FunctionLess
;
});
factory
.
registerFunction
(
"greater"
,
F
{
return
new
FunctionGreater
;
});
factory
.
registerFunction
(
"lessOrEquals"
,
F
{
return
new
FunctionLessOrEquals
;
});
factory
.
registerFunction
(
"greaterOrEquals"
,
F
{
return
new
FunctionGreaterOrEquals
;
});
#undef F
}
}
dbms/src/Functions/FunctionsConditional.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsConditional.h>
namespace
DB
{
void
registerFunctionsConditional
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"if"
,
F
{
return
new
FunctionIf
;
});
#undef F
}
}
dbms/src/Functions/FunctionsConversion.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsConversion.h>
namespace
DB
{
void
registerFunctionsConversion
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"toUInt8"
,
F
{
return
new
FunctionToUInt8
;
});
factory
.
registerFunction
(
"toUInt16"
,
F
{
return
new
FunctionToUInt16
;
});
factory
.
registerFunction
(
"toUInt32"
,
F
{
return
new
FunctionToUInt32
;
});
factory
.
registerFunction
(
"toUInt64"
,
F
{
return
new
FunctionToUInt64
;
});
factory
.
registerFunction
(
"toInt8"
,
F
{
return
new
FunctionToInt8
;
});
factory
.
registerFunction
(
"toInt16"
,
F
{
return
new
FunctionToInt16
;
});
factory
.
registerFunction
(
"toInt32"
,
F
{
return
new
FunctionToInt32
;
});
factory
.
registerFunction
(
"toInt64"
,
F
{
return
new
FunctionToInt64
;
});
factory
.
registerFunction
(
"toFloat32"
,
F
{
return
new
FunctionToFloat32
;
});
factory
.
registerFunction
(
"toFloat64"
,
F
{
return
new
FunctionToFloat64
;
});
factory
.
registerFunction
(
"toDate"
,
F
{
return
new
FunctionToDate
;
});
factory
.
registerFunction
(
"toDateTime"
,
F
{
return
new
FunctionToDateTime
;
});
factory
.
registerFunction
(
"toString"
,
F
{
return
new
FunctionToString
;
});
factory
.
registerFunction
(
"toFixedString"
,
F
{
return
new
FunctionToFixedString
;
});
#undef F
}
}
dbms/src/Functions/FunctionsDateTime.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsDateTime.h>
namespace
DB
{
void
registerFunctionsDateTime
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"toYear"
,
F
{
return
new
FunctionToYear
;
});
factory
.
registerFunction
(
"toMonth"
,
F
{
return
new
FunctionToMonth
;
});
factory
.
registerFunction
(
"toDayOfMonth"
,
F
{
return
new
FunctionToDayOfMonth
;
});
factory
.
registerFunction
(
"toDayOfWeek"
,
F
{
return
new
FunctionToDayOfWeek
;
});
factory
.
registerFunction
(
"toHour"
,
F
{
return
new
FunctionToHour
;
});
factory
.
registerFunction
(
"toMinute"
,
F
{
return
new
FunctionToMinute
;
});
factory
.
registerFunction
(
"toSecond"
,
F
{
return
new
FunctionToSecond
;
});
factory
.
registerFunction
(
"toMonday"
,
F
{
return
new
FunctionToMonday
;
});
factory
.
registerFunction
(
"toStartOfMonth"
,
F
{
return
new
FunctionToStartOfMonth
;
});
factory
.
registerFunction
(
"toStartOfQuarter"
,
F
{
return
new
FunctionToStartOfQuarter
;
});
factory
.
registerFunction
(
"toStartOfYear"
,
F
{
return
new
FunctionToStartOfYear
;
});
factory
.
registerFunction
(
"toStartOfMinute"
,
F
{
return
new
FunctionToStartOfMinute
;
});
factory
.
registerFunction
(
"toStartOfHour"
,
F
{
return
new
FunctionToStartOfHour
;
});
factory
.
registerFunction
(
"toRelativeYearNum"
,
F
{
return
new
FunctionToRelativeYearNum
;
});
factory
.
registerFunction
(
"toRelativeMonthNum"
,
F
{
return
new
FunctionToRelativeMonthNum
;
});
factory
.
registerFunction
(
"toRelativeWeekNum"
,
F
{
return
new
FunctionToRelativeWeekNum
;
});
factory
.
registerFunction
(
"toRelativeDayNum"
,
F
{
return
new
FunctionToRelativeDayNum
;
});
factory
.
registerFunction
(
"toRelativeHourNum"
,
F
{
return
new
FunctionToRelativeHourNum
;
});
factory
.
registerFunction
(
"toRelativeMinuteNum"
,
F
{
return
new
FunctionToRelativeMinuteNum
;
});
factory
.
registerFunction
(
"toRelativeSecondNum"
,
F
{
return
new
FunctionToRelativeSecondNum
;
});
factory
.
registerFunction
(
"toTime"
,
F
{
return
new
FunctionToTime
;
});
factory
.
registerFunction
(
"now"
,
F
{
return
new
FunctionNow
;
});
factory
.
registerFunction
(
"timeSlot"
,
F
{
return
new
FunctionTimeSlot
;
});
factory
.
registerFunction
(
"timeSlots"
,
F
{
return
new
FunctionTimeSlots
;
});
#undef F
}
}
dbms/src/Functions/FunctionsDictionaries.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsDictionaries.h>
namespace
DB
{
void
registerFunctionsDictionaries
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"regionToCity"
,
F
{
return
new
FunctionRegionToCity
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"regionToArea"
,
F
{
return
new
FunctionRegionToArea
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"regionToCountry"
,
F
{
return
new
FunctionRegionToCountry
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"regionToContinent"
,
F
{
return
new
FunctionRegionToContinent
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"OSToRoot"
,
F
{
return
new
FunctionOSToRoot
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"SEToRoot"
,
F
{
return
new
FunctionSEToRoot
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"categoryToRoot"
,
F
{
return
new
FunctionCategoryToRoot
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
});
factory
.
registerFunction
(
"categoryToSecondLevel"
,
F
{
return
new
FunctionCategoryToSecondLevel
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
});
factory
.
registerFunction
(
"regionIn"
,
F
{
return
new
FunctionRegionIn
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"OSIn"
,
F
{
return
new
FunctionOSIn
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"SEIn"
,
F
{
return
new
FunctionSEIn
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"categoryIn"
,
F
{
return
new
FunctionCategoryIn
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
});
factory
.
registerFunction
(
"regionHierarchy"
,
F
{
return
new
FunctionRegionHierarchy
(
context
.
getDictionaries
().
getRegionsHierarchies
());
});
factory
.
registerFunction
(
"OSHierarchy"
,
F
{
return
new
FunctionOSHierarchy
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"SEHierarchy"
,
F
{
return
new
FunctionSEHierarchy
(
context
.
getDictionaries
().
getTechDataHierarchy
());
});
factory
.
registerFunction
(
"categoryHierarchy"
,
F
{
return
new
FunctionCategoryHierarchy
(
context
.
getDictionaries
().
getCategoriesHierarchy
());
});
factory
.
registerFunction
(
"regionToName"
,
F
{
return
new
FunctionRegionToName
(
context
.
getDictionaries
().
getRegionsNames
());
});
#undef F
}
}
dbms/src/Functions/FunctionsFormatting.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsFormatting.h>
namespace
DB
{
void
registerFunctionsFormatting
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"bitmaskToList"
,
F
{
return
new
FunctionBitmaskToList
;
});
#undef F
}
}
dbms/src/Functions/FunctionsHashing.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsHashing.h>
namespace
DB
{
void
registerFunctionsHashing
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"halfMD5"
,
F
{
return
new
FunctionHalfMD5
;
});
factory
.
registerFunction
(
"sipHash64"
,
F
{
return
new
FunctionSipHash64
;
});
factory
.
registerFunction
(
"cityHash64"
,
F
{
return
new
FunctionCityHash64
;
});
factory
.
registerFunction
(
"intHash32"
,
F
{
return
new
FunctionIntHash32
;
});
factory
.
registerFunction
(
"intHash64"
,
F
{
return
new
FunctionIntHash64
;
});
#undef F
}
}
dbms/src/Functions/FunctionsHigherOrder.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsHigherOrder.h>
namespace
DB
{
void
registerFunctionsHigherOrder
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"arrayMap"
,
F
{
return
new
FunctionArrayMap
;
});
factory
.
registerFunction
(
"arrayFilter"
,
F
{
return
new
FunctionArrayFilter
;
});
factory
.
registerFunction
(
"arrayCount"
,
F
{
return
new
FunctionArrayCount
;
});
factory
.
registerFunction
(
"arrayExists"
,
F
{
return
new
FunctionArrayExists
;
});
factory
.
registerFunction
(
"arrayAll"
,
F
{
return
new
FunctionArrayAll
;
});
factory
.
registerFunction
(
"arraySum"
,
F
{
return
new
FunctionArraySum
;
});
#undef F
}
}
dbms/src/Functions/FunctionsLogical.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsLogical.h>
namespace
DB
{
void
registerFunctionsLogical
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"and"
,
F
{
return
new
FunctionAnd
;
});
factory
.
registerFunction
(
"or"
,
F
{
return
new
FunctionOr
;
});
factory
.
registerFunction
(
"xor"
,
F
{
return
new
FunctionXor
;
});
factory
.
registerFunction
(
"not"
,
F
{
return
new
FunctionNot
;
});
#undef F
}
}
dbms/src/Functions/FunctionsMiscellaneous.cpp
浏览文件 @
2b188ba6
#include <math.h>
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsArithmetic.h>
#include <DB/Functions/FunctionsMiscellaneous.h>
...
...
@@ -297,3 +298,33 @@ void FunctionVisibleWidth::execute(Block & block, const ColumnNumbers & argument
}
}
namespace
DB
{
void
registerFunctionsMiscellaneous
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"hostName"
,
F
{
return
new
FunctionHostName
;
});
factory
.
registerFunction
(
"visibleWidth"
,
F
{
return
new
FunctionVisibleWidth
;
});
factory
.
registerFunction
(
"toTypeName"
,
F
{
return
new
FunctionToTypeName
;
});
factory
.
registerFunction
(
"blockSize"
,
F
{
return
new
FunctionBlockSize
;
});
factory
.
registerFunction
(
"sleep"
,
F
{
return
new
FunctionSleep
;
});
factory
.
registerFunction
(
"materialize"
,
F
{
return
new
FunctionMaterialize
;
});
factory
.
registerFunction
(
"ignore"
,
F
{
return
new
FunctionIgnore
;
});
factory
.
registerFunction
(
"arrayJoin"
,
F
{
return
new
FunctionArrayJoin
;
});
factory
.
registerFunction
(
"bar"
,
F
{
return
new
FunctionBar
;
});
factory
.
registerFunction
(
"tuple"
,
F
{
return
new
FunctionTuple
;
});
factory
.
registerFunction
(
"tupleElement"
,
F
{
return
new
FunctionTupleElement
;
});
factory
.
registerFunction
(
"in"
,
F
{
return
new
FunctionIn
(
false
,
false
);
});
factory
.
registerFunction
(
"notIn"
,
F
{
return
new
FunctionIn
(
true
,
false
);
});
factory
.
registerFunction
(
"globalIn"
,
F
{
return
new
FunctionIn
(
false
,
true
);
});
factory
.
registerFunction
(
"globalNotIn"
,
F
{
return
new
FunctionIn
(
true
,
true
);
});
#undef F
}
}
dbms/src/Functions/FunctionsRandom.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsRandom.h>
namespace
DB
{
void
registerFunctionsRandom
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"rand"
,
F
{
return
new
FunctionRand
;
});
factory
.
registerFunction
(
"rand64"
,
F
{
return
new
FunctionRand64
;
});
#undef F
}
}
dbms/src/Functions/FunctionsReinterpret.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsReinterpret.h>
namespace
DB
{
void
registerFunctionsReinterpret
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"reinterpretAsUInt8"
,
F
{
return
new
FunctionReinterpretAsUInt8
;
});
factory
.
registerFunction
(
"reinterpretAsUInt16"
,
F
{
return
new
FunctionReinterpretAsUInt16
;
});
factory
.
registerFunction
(
"reinterpretAsUInt32"
,
F
{
return
new
FunctionReinterpretAsUInt32
;
});
factory
.
registerFunction
(
"reinterpretAsUInt64"
,
F
{
return
new
FunctionReinterpretAsUInt64
;
});
factory
.
registerFunction
(
"reinterpretAsInt8"
,
F
{
return
new
FunctionReinterpretAsInt8
;
});
factory
.
registerFunction
(
"reinterpretAsInt16"
,
F
{
return
new
FunctionReinterpretAsInt16
;
});
factory
.
registerFunction
(
"reinterpretAsInt32"
,
F
{
return
new
FunctionReinterpretAsInt32
;
});
factory
.
registerFunction
(
"reinterpretAsInt64"
,
F
{
return
new
FunctionReinterpretAsInt64
;
});
factory
.
registerFunction
(
"reinterpretAsFloat32"
,
F
{
return
new
FunctionReinterpretAsFloat32
;
});
factory
.
registerFunction
(
"reinterpretAsFloat64"
,
F
{
return
new
FunctionReinterpretAsFloat64
;
});
factory
.
registerFunction
(
"reinterpretAsDate"
,
F
{
return
new
FunctionReinterpretAsDate
;
});
factory
.
registerFunction
(
"reinterpretAsDateTime"
,
F
{
return
new
FunctionReinterpretAsDateTime
;
});
factory
.
registerFunction
(
"reinterpretAsString"
,
F
{
return
new
FunctionReinterpretAsString
;
});
#undef F
}
}
dbms/src/Functions/FunctionsRound.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsRound.h>
namespace
DB
{
void
registerFunctionsRound
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"roundToExp2"
,
F
{
return
new
FunctionRoundToExp2
;
});
factory
.
registerFunction
(
"roundDuration"
,
F
{
return
new
FunctionRoundDuration
;
});
factory
.
registerFunction
(
"roundAge"
,
F
{
return
new
FunctionRoundAge
;
});
#undef F
}
}
dbms/src/Functions/FunctionsString.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsString.h>
namespace
DB
{
void
registerFunctionsString
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"empty"
,
F
{
return
new
FunctionEmpty
;
});
factory
.
registerFunction
(
"notEmpty"
,
F
{
return
new
FunctionNotEmpty
;
});
factory
.
registerFunction
(
"length"
,
F
{
return
new
FunctionLength
;
});
factory
.
registerFunction
(
"lengthUTF8"
,
F
{
return
new
FunctionLengthUTF8
;
});
factory
.
registerFunction
(
"lower"
,
F
{
return
new
FunctionLower
;
});
factory
.
registerFunction
(
"upper"
,
F
{
return
new
FunctionUpper
;
});
factory
.
registerFunction
(
"lowerUTF8"
,
F
{
return
new
FunctionLowerUTF8
;
});
factory
.
registerFunction
(
"upperUTF8"
,
F
{
return
new
FunctionUpperUTF8
;
});
factory
.
registerFunction
(
"reverse"
,
F
{
return
new
FunctionReverse
;
});
factory
.
registerFunction
(
"reverseUTF8"
,
F
{
return
new
FunctionReverseUTF8
;
});
factory
.
registerFunction
(
"concat"
,
F
{
return
new
FunctionConcat
;
});
factory
.
registerFunction
(
"substring"
,
F
{
return
new
FunctionSubstring
;
});
factory
.
registerFunction
(
"substringUTF8"
,
F
{
return
new
FunctionSubstringUTF8
;
});
#undef F
}
}
dbms/src/Functions/FunctionsStringArray.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsStringArray.h>
namespace
DB
{
void
registerFunctionsStringArray
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"extractAll"
,
F
{
return
new
FunctionExtractAll
;
});
factory
.
registerFunction
(
"alphaTokens"
,
F
{
return
new
FunctionAlphaTokens
;
});
factory
.
registerFunction
(
"splitByChar"
,
F
{
return
new
FunctionSplitByChar
;
});
factory
.
registerFunction
(
"splitByString"
,
F
{
return
new
FunctionSplitByString
;
});
#undef F
}
}
dbms/src/Functions/FunctionsStringSearch.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsStringSearch.h>
namespace
DB
{
void
registerFunctionsStringSearch
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"replaceOne"
,
F
{
return
new
FunctionReplaceOne
;
});
factory
.
registerFunction
(
"replaceAll"
,
F
{
return
new
FunctionReplaceAll
;
});
factory
.
registerFunction
(
"replaceRegexpOne"
,
F
{
return
new
FunctionReplaceRegexpOne
;
});
factory
.
registerFunction
(
"replaceRegexpAll"
,
F
{
return
new
FunctionReplaceRegexpAll
;
});
factory
.
registerFunction
(
"position"
,
F
{
return
new
FunctionPosition
;
});
factory
.
registerFunction
(
"positionUTF8"
,
F
{
return
new
FunctionPositionUTF8
;
});
factory
.
registerFunction
(
"match"
,
F
{
return
new
FunctionMatch
;
});
factory
.
registerFunction
(
"like"
,
F
{
return
new
FunctionLike
;
});
factory
.
registerFunction
(
"notLike"
,
F
{
return
new
FunctionNotLike
;
});
factory
.
registerFunction
(
"extract"
,
F
{
return
new
FunctionExtract
;
});
#undef F
}
}
dbms/src/Functions/FunctionsURL.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsURL.h>
namespace
DB
{
void
registerFunctionsURL
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"protocol"
,
F
{
return
new
FunctionProtocol
;
});
factory
.
registerFunction
(
"domain"
,
F
{
return
new
FunctionDomain
;
});
factory
.
registerFunction
(
"domainWithoutWWW"
,
F
{
return
new
FunctionDomainWithoutWWW
;
});
factory
.
registerFunction
(
"topLevelDomain"
,
F
{
return
new
FunctionTopLevelDomain
;
});
factory
.
registerFunction
(
"path"
,
F
{
return
new
FunctionPath
;
});
factory
.
registerFunction
(
"queryString"
,
F
{
return
new
FunctionQueryString
;
});
factory
.
registerFunction
(
"fragment"
,
F
{
return
new
FunctionFragment
;
});
factory
.
registerFunction
(
"queryStringAndFragment"
,
F
{
return
new
FunctionQueryStringAndFragment
;
});
factory
.
registerFunction
(
"extractURLParameter"
,
F
{
return
new
FunctionExtractURLParameter
;
});
factory
.
registerFunction
(
"extractURLParameters"
,
F
{
return
new
FunctionExtractURLParameters
;
});
factory
.
registerFunction
(
"extractURLParameterNames"
,
F
{
return
new
FunctionExtractURLParameterNames
;
});
factory
.
registerFunction
(
"URLHierarchy"
,
F
{
return
new
FunctionURLHierarchy
;
});
factory
.
registerFunction
(
"URLPathHierarchy"
,
F
{
return
new
FunctionURLPathHierarchy
;
});
factory
.
registerFunction
(
"cutWWW"
,
F
{
return
new
FunctionCutWWW
;
});
factory
.
registerFunction
(
"cutQueryString"
,
F
{
return
new
FunctionCutQueryString
;
});
factory
.
registerFunction
(
"cutFragment"
,
F
{
return
new
FunctionCutFragment
;
});
factory
.
registerFunction
(
"cutQueryStringAndFragment"
,
F
{
return
new
FunctionCutQueryStringAndFragment
;
});
factory
.
registerFunction
(
"cutURLParameter"
,
F
{
return
new
FunctionCutURLParameter
;
});
#undef F
}
}
dbms/src/Functions/FunctionsVisitParam.cpp
0 → 100644
浏览文件 @
2b188ba6
#include <DB/Functions/FunctionFactory.h>
#include <DB/Functions/FunctionsVisitParam.h>
namespace
DB
{
void
registerFunctionsVisitParam
(
FunctionFactory
&
factory
)
{
#define F [](const Context & context)
factory
.
registerFunction
(
"visitParamHas"
,
F
{
return
new
FunctionVisitParamHas
;
});
factory
.
registerFunction
(
"visitParamExtractUInt"
,
F
{
return
new
FunctionVisitParamExtractUInt
;
});
factory
.
registerFunction
(
"visitParamExtractInt"
,
F
{
return
new
FunctionVisitParamExtractInt
;
});
factory
.
registerFunction
(
"visitParamExtractFloat"
,
F
{
return
new
FunctionVisitParamExtractFloat
;
});
factory
.
registerFunction
(
"visitParamExtractBool"
,
F
{
return
new
FunctionVisitParamExtractBool
;
});
factory
.
registerFunction
(
"visitParamExtractRaw"
,
F
{
return
new
FunctionVisitParamExtractRaw
;
});
factory
.
registerFunction
(
"visitParamExtractString"
,
F
{
return
new
FunctionVisitParamExtractString
;
});
#undef F
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录