Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76d5298b
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
76d5298b
编写于
2月 17, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
bffdb7a8
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
449 addition
and
199 deletion
+449
-199
include/libs/function/function.h
include/libs/function/function.h
+2
-2
include/libs/function/functionMgt.h
include/libs/function/functionMgt.h
+1
-1
include/libs/nodes/querynodes.h
include/libs/nodes/querynodes.h
+0
-2
source/libs/function/inc/tbinoperator.h
source/libs/function/inc/tbinoperator.h
+1
-1
source/libs/function/inc/tscalar.h
source/libs/function/inc/tscalar.h
+6
-2
source/libs/function/inc/tscalarfunction.h
source/libs/function/inc/tscalarfunction.h
+3
-3
source/libs/function/inc/tunaryoperator.h
source/libs/function/inc/tunaryoperator.h
+1
-1
source/libs/function/src/taggfunction.c
source/libs/function/src/taggfunction.c
+1
-1
source/libs/function/src/tbinoperator.c
source/libs/function/src/tbinoperator.c
+34
-34
source/libs/function/src/tscalar.c
source/libs/function/src/tscalar.c
+390
-142
source/libs/function/src/tscalarfunction.c
source/libs/function/src/tscalarfunction.c
+10
-10
未找到文件。
include/libs/function/function.h
浏览文件 @
76d5298b
...
...
@@ -226,13 +226,13 @@ typedef struct SAggFunctionInfo {
int32_t
(
*
dataReqFunc
)(
SqlFunctionCtx
*
pCtx
,
STimeWindow
*
w
,
int32_t
colId
);
}
SAggFunctionInfo
;
struct
SScalar
Func
Param
;
struct
SScalarParam
;
typedef
struct
SScalarFunctionInfo
{
char
name
[
FUNCTIONS_NAME_MAX_LENGTH
];
int8_t
type
;
// scalar function or aggregation function
uint32_t
functionId
;
// index of scalar function
void
(
*
process
)(
struct
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
struct
SScalarFunc
Param
*
pInput
);
void
(
*
process
)(
struct
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
struct
SScalar
Param
*
pInput
);
}
SScalarFunctionInfo
;
typedef
struct
SMultiFunctionsDesc
{
...
...
include/libs/function/functionMgt.h
浏览文件 @
76d5298b
...
...
@@ -117,7 +117,7 @@ typedef struct SFuncExecFuncs {
FExecFinalize
finalize
;
}
SFuncExecFuncs
;
typedef
int32_t
(
*
FScalarExecProcess
)(
SScalar
FuncParam
*
pInput
,
int32_t
inputNum
,
SScalarFunc
Param
*
pOutput
);
typedef
int32_t
(
*
FScalarExecProcess
)(
SScalar
Param
*
pInput
,
int32_t
inputNum
,
SScalar
Param
*
pOutput
);
typedef
struct
SScalarFuncExecFuncs
{
FScalarExecProcess
process
;
...
...
include/libs/nodes/querynodes.h
浏览文件 @
76d5298b
...
...
@@ -104,8 +104,6 @@ typedef enum EOperatorType {
OP_TYPE_NMATCH
,
OP_TYPE_IS_NULL
,
OP_TYPE_IS_NOT_NULL
,
OP_TYPE_BIT_AND
,
OP_TYPE_BIT_OR
,
// json operator
OP_TYPE_JSON_GET_VALUE
,
...
...
source/libs/function/inc/tbinoperator.h
浏览文件 @
76d5298b
...
...
@@ -22,7 +22,7 @@ extern "C" {
#include "tscalarfunction.h"
typedef
void
(
*
_bin_scalar_fn_t
)(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
output
,
int32_t
order
);
typedef
void
(
*
_bin_scalar_fn_t
)(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
output
,
int32_t
order
);
_bin_scalar_fn_t
getBinScalarOperatorFn
(
int32_t
binOperator
);
bool
isBinaryStringOp
(
int32_t
op
);
...
...
source/libs/function/inc/tscalar.h
浏览文件 @
76d5298b
...
...
@@ -19,9 +19,13 @@
extern
"C"
{
#endif
typedef
struct
SScalarCalcContext
{
typedef
struct
SScalarCtx
{
int32_t
code
;
SSDataBlock
*
pSrc
;
SHashObj
*
pRes
;
/* element is SScalarParam */
}
SScalarCtx
;
}
SScalarCalcContext
;
#define SCL_DEFAULT_OP_NUM 10
#define sclFatal(...) qFatal(__VA_ARGS__)
#define sclError(...) qError(__VA_ARGS__)
...
...
source/libs/function/inc/tscalarfunction.h
浏览文件 @
76d5298b
...
...
@@ -21,12 +21,12 @@ extern "C" {
#include "function.h"
typedef
struct
SScalar
Func
Param
{
typedef
struct
SScalarParam
{
void
*
data
;
int32_t
num
;
int32_t
type
;
int32_t
bytes
;
}
SScalar
Func
Param
;
}
SScalarParam
;
typedef
struct
SScalarFunctionSupport
{
struct
SExprInfo
*
pExprInfo
;
...
...
@@ -39,7 +39,7 @@ typedef struct SScalarFunctionSupport {
extern
struct
SScalarFunctionInfo
scalarFunc
[
8
];
int32_t
evaluateExprNodeTree
(
tExprNode
*
pExprs
,
int32_t
numOfRows
,
SScalar
Func
Param
*
pOutput
,
int32_t
evaluateExprNodeTree
(
tExprNode
*
pExprs
,
int32_t
numOfRows
,
SScalarParam
*
pOutput
,
void
*
param
,
char
*
(
*
getSourceDataBlock
)(
void
*
,
const
char
*
,
int32_t
));
...
...
source/libs/function/inc/tunaryoperator.h
浏览文件 @
76d5298b
...
...
@@ -22,7 +22,7 @@ extern "C" {
#include "tscalarfunction.h"
typedef
void
(
*
_unary_scalar_fn_t
)(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pOutput
);
typedef
void
(
*
_unary_scalar_fn_t
)(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pOutput
);
_unary_scalar_fn_t
getUnaryScalarOperatorFn
(
int32_t
binOperator
);
#ifdef __cplusplus
...
...
source/libs/function/src/taggfunction.c
浏览文件 @
76d5298b
...
...
@@ -3240,7 +3240,7 @@ static void arithmetic_function(SqlFunctionCtx *pCtx) {
GET_RES_INFO
(
pCtx
)
->
numOfRes
+=
pCtx
->
size
;
SScalarFunctionSupport
*
pSup
=
(
SScalarFunctionSupport
*
)
pCtx
->
param
[
1
].
pz
;
SScalar
Func
Param
output
=
{
0
};
SScalarParam
output
=
{
0
};
output
.
data
=
pCtx
->
pOutput
;
//evaluateExprNodeTree(pSup->pExprInfo->pExpr, pCtx->size, &output, pSup, getArithColumnData);
...
...
source/libs/function/src/tbinoperator.c
浏览文件 @
76d5298b
...
...
@@ -245,7 +245,7 @@ _getValueAddr_fn_t getVectorValueAddrFn(int32_t srcType) {
}
int32_t
vectorConvertImpl
(
SScalar
FuncParam
*
pIn
,
SScalarFunc
Param
*
pOut
)
{
int32_t
vectorConvertImpl
(
SScalar
Param
*
pIn
,
SScalar
Param
*
pOut
)
{
int16_t
inType
=
pIn
->
type
;
int16_t
inBytes
=
pIn
->
bytes
;
char
*
input
=
pIn
->
data
;
...
...
@@ -512,13 +512,13 @@ int8_t gConvertTypes[TSDB_DATA_TYPE_BLOB+1][TSDB_DATA_TYPE_BLOB+1] = {
/*BLOB*/
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
int32_t
vectorConvert
(
SScalar
FuncParam
*
pLeft
,
SScalarFuncParam
*
pRight
,
SScalarFuncParam
*
pLeftOut
,
SScalarFunc
Param
*
pRightOut
)
{
int32_t
vectorConvert
(
SScalar
Param
*
pLeft
,
SScalarParam
*
pRight
,
SScalarParam
*
pLeftOut
,
SScalar
Param
*
pRightOut
)
{
if
(
pLeft
->
type
==
pRight
->
type
)
{
return
TSDB_CODE_SUCCESS
;
}
SScalar
Func
Param
*
param1
=
NULL
,
*
paramOut1
=
NULL
;
SScalar
Func
Param
*
param2
=
NULL
,
*
paramOut2
=
NULL
;
SScalarParam
*
param1
=
NULL
,
*
paramOut1
=
NULL
;
SScalarParam
*
param2
=
NULL
,
*
paramOut2
=
NULL
;
int32_t
code
=
0
;
if
(
pLeft
->
type
<
pRight
->
type
)
{
...
...
@@ -575,7 +575,7 @@ int32_t vectorConvert(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, SScalar
return
TSDB_CODE_SUCCESS
;
}
void
vectorAdd
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorAdd
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -614,7 +614,7 @@ void vectorAdd(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out, int
}
}
void
vectorSub
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorSub
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -651,7 +651,7 @@ void vectorSub(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out, int
}
}
}
void
vectorMultiply
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorMultiply
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -690,7 +690,7 @@ void vectorMultiply(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out
}
}
void
vectorDivide
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorDivide
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -736,7 +736,7 @@ void vectorDivide(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out,
}
}
void
vectorRemainder
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorRemainder
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -808,7 +808,7 @@ void vectorRemainder(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *ou
}
}
void
vectorConcat
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorConcat
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
len
=
pLeft
->
bytes
+
pRight
->
bytes
;
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
...
...
@@ -859,7 +859,7 @@ void vectorConcat(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out,
}
void
vectorBitAnd
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorBitAnd
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -898,7 +898,7 @@ void vectorBitAnd(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out,
}
}
void
vectorBitOr
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorBitOr
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
...
...
@@ -938,7 +938,7 @@ void vectorBitOr(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out, i
}
void
vectorCompareImpl
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
,
int32_t
optr
)
{
void
vectorCompareImpl
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
,
int32_t
optr
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
int8_t
funcIdx
=
filterGetCompFuncIdx
(
pLeft
->
type
,
optr
);
...
...
@@ -993,14 +993,14 @@ void vectorCompareImpl(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *
}
}
void
vectorCompare
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
,
int32_t
optr
)
{
SScalar
Func
Param
pLeftOut
=
{
0
};
SScalar
Func
Param
pRightOut
=
{
0
};
void
vectorCompare
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
,
int32_t
optr
)
{
SScalarParam
pLeftOut
=
{
0
};
SScalarParam
pRightOut
=
{
0
};
vectorConvert
(
pLeft
,
pRight
,
&
pLeftOut
,
&
pRightOut
);
SScalar
Func
Param
*
param1
=
NULL
;
SScalar
Func
Param
*
param2
=
NULL
;
SScalarParam
*
param1
=
NULL
;
SScalarParam
*
param2
=
NULL
;
int32_t
type
=
0
;
if
(
pLeftOut
->
type
)
{
...
...
@@ -1018,55 +1018,55 @@ void vectorCompare(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out,
vectorCompareImpl
(
pLeftOut
,
pRightOut
,
out
,
_ord
,
TSDB_RELATION_GREATER
);
}
void
vectorGreater
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorGreater
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_GREATER
);
}
void
vectorGreaterEqual
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorGreaterEqual
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_GREATER_EQUAL
);
}
void
vectorLower
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorLower
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_LESS
);
}
void
vectorLowerEqual
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorLowerEqual
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_LESS_EQUAL
);
}
void
vectorEqual
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorEqual
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_EQUAL
);
}
void
vectorNotEqual
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorNotEqual
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_NOT_EQUAL
);
}
void
vectorIn
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorIn
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_IN
);
}
void
vectorNotIn
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorNotIn
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_NOT_IN
);
}
void
vectorLike
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorLike
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_LIKE
);
}
void
vectorNotLike
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorNotLike
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_NOT_LIKE
);
}
void
vectorMatch
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorMatch
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_MATCH
);
}
void
vectorNotMatch
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorNotMatch
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
vectorCompare
(
pLeft
,
pRight
,
out
,
_ord
,
TSDB_RELATION_NMATCH
);
}
void
vectorIsNull
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorIsNull
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
bool
res
=
false
;
...
...
@@ -1086,7 +1086,7 @@ void vectorIsNull(SScalarFuncParam* pLeft, SScalarFuncParam* pRight, void *out,
}
}
void
vectorNotNull
(
SScalar
FuncParam
*
pLeft
,
SScalarFunc
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
void
vectorNotNull
(
SScalar
Param
*
pLeft
,
SScalar
Param
*
pRight
,
void
*
out
,
int32_t
_ord
)
{
int32_t
i
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
0
:
TMAX
(
pLeft
->
num
,
pRight
->
num
)
-
1
;
int32_t
step
=
((
_ord
)
==
TSDB_ORDER_ASC
)
?
1
:
-
1
;
bool
res
=
false
;
...
...
@@ -1143,9 +1143,9 @@ _bin_scalar_fn_t getBinScalarOperatorFn(int32_t binFunctionId) {
return
vectorMatch
;
case
OP_TYPE_NMATCH
:
return
vectorNotMatch
;
case
OP_TYPE_ISNULL
:
case
OP_TYPE_IS
_
NULL
:
return
vectorIsNull
;
case
OP_TYPE_
NOT
NULL
:
case
OP_TYPE_
IS_NOT_
NULL
:
return
vectorNotNull
;
case
OP_TYPE_BIT_AND
:
return
vectorBitAnd
;
...
...
source/libs/function/src/tscalar.c
浏览文件 @
76d5298b
此差异已折叠。
点击以展开。
source/libs/function/src/tscalarfunction.c
浏览文件 @
76d5298b
...
...
@@ -2,13 +2,13 @@
#include "tbinoperator.h"
#include "tunaryoperator.h"
static
void
assignBasicParaInfo
(
struct
SScalar
FuncParam
*
dst
,
const
struct
SScalarFunc
Param
*
src
)
{
static
void
assignBasicParaInfo
(
struct
SScalar
Param
*
dst
,
const
struct
SScalar
Param
*
src
)
{
dst
->
type
=
src
->
type
;
dst
->
bytes
=
src
->
bytes
;
dst
->
num
=
src
->
num
;
}
static
void
tceil
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tceil
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assignBasicParaInfo
(
pOutput
,
pLeft
);
assert
(
numOfInput
==
1
);
...
...
@@ -34,7 +34,7 @@ static void tceil(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarFun
}
}
static
void
tfloor
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tfloor
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assignBasicParaInfo
(
pOutput
,
pLeft
);
assert
(
numOfInput
==
1
);
...
...
@@ -62,7 +62,7 @@ static void tfloor(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarFu
}
}
static
void
_tabs
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
_tabs
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assignBasicParaInfo
(
pOutput
,
pLeft
);
assert
(
numOfInput
==
1
);
...
...
@@ -120,7 +120,7 @@ static void _tabs(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarFun
}
}
static
void
tround
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tround
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assignBasicParaInfo
(
pOutput
,
pLeft
);
assert
(
numOfInput
==
1
);
...
...
@@ -146,7 +146,7 @@ static void tround(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarFu
}
}
static
void
tlength
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tlength
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assert
(
numOfInput
==
1
);
int64_t
*
out
=
(
int64_t
*
)
pOutput
->
data
;
...
...
@@ -157,7 +157,7 @@ static void tlength(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarF
}
}
static
void
tconcat
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tconcat
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
assert
(
numOfInput
>
0
);
int32_t
rowLen
=
0
;
...
...
@@ -189,11 +189,11 @@ static void tconcat(SScalarFuncParam* pOutput, size_t numOfInput, const SScalarF
}
}
static
void
tltrim
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
tltrim
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
}
static
void
trtrim
(
SScalar
FuncParam
*
pOutput
,
size_t
numOfInput
,
const
SScalarFunc
Param
*
pLeft
)
{
static
void
trtrim
(
SScalar
Param
*
pOutput
,
size_t
numOfInput
,
const
SScalar
Param
*
pLeft
)
{
}
...
...
@@ -262,7 +262,7 @@ static void reverseCopy(char* dest, const char* src, int16_t type, int32_t numOf
}
}
static
void
setScalarFuncParam
(
SScalar
Func
Param
*
param
,
int32_t
type
,
int32_t
bytes
,
void
*
pInput
,
int32_t
numOfRows
)
{
static
void
setScalarFuncParam
(
SScalarParam
*
param
,
int32_t
type
,
int32_t
bytes
,
void
*
pInput
,
int32_t
numOfRows
)
{
param
->
bytes
=
bytes
;
param
->
type
=
type
;
param
->
num
=
numOfRows
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录