Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6d22e961
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
6d22e961
编写于
12月 22, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
retrigger CI
上级
859eb12d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
21 deletion
+21
-21
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+21
-21
未找到文件。
src/query/src/qAggMain.c
浏览文件 @
6d22e961
...
@@ -253,7 +253,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -253,7 +253,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
*
interBytes
=
0
;
*
interBytes
=
0
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
if
(
functionId
==
TSDB_FUNC_COUNT
)
{
if
(
functionId
==
TSDB_FUNC_COUNT
)
{
*
type
=
TSDB_DATA_TYPE_BIGINT
;
*
type
=
TSDB_DATA_TYPE_BIGINT
;
*
bytes
=
sizeof
(
int64_t
);
*
bytes
=
sizeof
(
int64_t
);
...
@@ -261,7 +261,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -261,7 +261,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
if
(
functionId
==
TSDB_FUNC_TS_COMP
)
{
if
(
functionId
==
TSDB_FUNC_TS_COMP
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
1
;
// this results is compressed ts data, only one byte
*
bytes
=
1
;
// this results is compressed ts data, only one byte
...
@@ -316,20 +316,20 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -316,20 +316,20 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
(
dataBytes
+
DATA_SET_FLAG_SIZE
);
*
bytes
=
(
dataBytes
+
DATA_SET_FLAG_SIZE
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_SUM
)
{
}
else
if
(
functionId
==
TSDB_FUNC_SUM
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
sizeof
(
SSumInfo
);
*
bytes
=
sizeof
(
SSumInfo
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_AVG
)
{
}
else
if
(
functionId
==
TSDB_FUNC_AVG
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
sizeof
(
SAvgInfo
);
*
bytes
=
sizeof
(
SAvgInfo
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
>=
TSDB_FUNC_RATE
&&
functionId
<=
TSDB_FUNC_IRATE
)
{
}
else
if
(
functionId
>=
TSDB_FUNC_RATE
&&
functionId
<=
TSDB_FUNC_IRATE
)
{
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
*
bytes
=
sizeof
(
SRateInfo
);
*
bytes
=
sizeof
(
SRateInfo
);
...
@@ -339,7 +339,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -339,7 +339,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
(
sizeof
(
STopBotInfo
)
+
(
sizeof
(
tValuePair
)
+
POINTER_BYTES
+
extLength
)
*
param
);
*
bytes
=
(
sizeof
(
STopBotInfo
)
+
(
sizeof
(
tValuePair
)
+
POINTER_BYTES
+
extLength
)
*
param
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_SAMPLE
)
{
}
else
if
(
functionId
==
TSDB_FUNC_SAMPLE
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
...
@@ -351,7 +351,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -351,7 +351,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
sizeof
(
SSpreadInfo
);
*
bytes
=
sizeof
(
SSpreadInfo
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_APERCT
)
{
}
else
if
(
functionId
==
TSDB_FUNC_APERCT
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
...
@@ -359,13 +359,13 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -359,13 +359,13 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
int32_t
bytesDigest
=
(
int32_t
)
(
sizeof
(
SAPercentileInfo
)
+
TDIGEST_SIZE
(
COMPRESSION
));
int32_t
bytesDigest
=
(
int32_t
)
(
sizeof
(
SAPercentileInfo
)
+
TDIGEST_SIZE
(
COMPRESSION
));
*
bytes
=
MAX
(
bytesHist
,
bytesDigest
);
*
bytes
=
MAX
(
bytesHist
,
bytesDigest
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_LAST_ROW
)
{
}
else
if
(
functionId
==
TSDB_FUNC_LAST_ROW
)
{
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
type
=
TSDB_DATA_TYPE_BINARY
;
*
bytes
=
(
sizeof
(
SLastrowInfo
)
+
dataBytes
);
*
bytes
=
(
sizeof
(
SLastrowInfo
)
+
dataBytes
);
*
interBytes
=
*
bytes
;
*
interBytes
=
*
bytes
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
else
if
(
functionId
==
TSDB_FUNC_TWA
)
{
}
else
if
(
functionId
==
TSDB_FUNC_TWA
)
{
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
...
@@ -388,7 +388,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -388,7 +388,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
}
else
{
}
else
{
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
*
type
=
TSDB_DATA_TYPE_DOUBLE
;
}
}
*
bytes
=
sizeof
(
int64_t
);
*
bytes
=
sizeof
(
int64_t
);
*
interBytes
=
sizeof
(
SSumInfo
);
*
interBytes
=
sizeof
(
SSumInfo
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -458,9 +458,9 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -458,9 +458,9 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
}
else
if
(
functionId
==
TSDB_FUNC_TOP
||
functionId
==
TSDB_FUNC_BOTTOM
)
{
}
else
if
(
functionId
==
TSDB_FUNC_TOP
||
functionId
==
TSDB_FUNC_BOTTOM
)
{
*
type
=
(
int16_t
)
dataType
;
*
type
=
(
int16_t
)
dataType
;
*
bytes
=
dataBytes
;
*
bytes
=
dataBytes
;
size_t
size
=
sizeof
(
STopBotInfo
)
+
(
sizeof
(
tValuePair
)
+
POINTER_BYTES
+
extLength
)
*
param
;
size_t
size
=
sizeof
(
STopBotInfo
)
+
(
sizeof
(
tValuePair
)
+
POINTER_BYTES
+
extLength
)
*
param
;
// the output column may be larger than sizeof(STopBotInfo)
// the output column may be larger than sizeof(STopBotInfo)
*
interBytes
=
(
int32_t
)
size
;
*
interBytes
=
(
int32_t
)
size
;
}
else
if
(
functionId
==
TSDB_FUNC_SAMPLE
)
{
}
else
if
(
functionId
==
TSDB_FUNC_SAMPLE
)
{
...
@@ -484,7 +484,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
...
@@ -484,7 +484,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
}
else
{
}
else
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -501,7 +501,7 @@ int32_t isValidFunction(const char* name, int32_t len) {
...
@@ -501,7 +501,7 @@ int32_t isValidFunction(const char* name, int32_t len) {
return
aScalarFunctions
[
i
].
functionId
;
return
aScalarFunctions
[
i
].
functionId
;
}
}
}
}
for
(
int32_t
i
=
0
;
i
<=
TSDB_FUNC_ELAPSED
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<=
TSDB_FUNC_ELAPSED
;
++
i
)
{
int32_t
nameLen
=
(
int32_t
)
strlen
(
aAggs
[
i
].
name
);
int32_t
nameLen
=
(
int32_t
)
strlen
(
aAggs
[
i
].
name
);
if
(
len
!=
nameLen
)
{
if
(
len
!=
nameLen
)
{
...
@@ -519,7 +519,7 @@ static bool function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pResultInfo
...
@@ -519,7 +519,7 @@ static bool function_setup(SQLFunctionCtx *pCtx, SResultRowCellInfo* pResultInfo
if
(
pResultInfo
->
initialized
)
{
if
(
pResultInfo
->
initialized
)
{
return
false
;
return
false
;
}
}
memset
(
pCtx
->
pOutput
,
0
,
(
size_t
)
pCtx
->
outputBytes
);
memset
(
pCtx
->
pOutput
,
0
,
(
size_t
)
pCtx
->
outputBytes
);
initResultInfo
(
pResultInfo
,
pCtx
->
interBufBytes
);
initResultInfo
(
pResultInfo
,
pCtx
->
interBufBytes
);
return
true
;
return
true
;
...
@@ -537,7 +537,7 @@ static void function_finalizer(SQLFunctionCtx *pCtx) {
...
@@ -537,7 +537,7 @@ static void function_finalizer(SQLFunctionCtx *pCtx) {
if
(
pResInfo
->
hasResult
!=
DATA_SET_FLAG
)
{
if
(
pResInfo
->
hasResult
!=
DATA_SET_FLAG
)
{
setNull
(
pCtx
->
pOutput
,
pCtx
->
outputType
,
pCtx
->
outputBytes
);
setNull
(
pCtx
->
pOutput
,
pCtx
->
outputType
,
pCtx
->
outputBytes
);
}
}
doFinalizer
(
pCtx
);
doFinalizer
(
pCtx
);
}
}
...
@@ -547,7 +547,7 @@ static void function_finalizer(SQLFunctionCtx *pCtx) {
...
@@ -547,7 +547,7 @@ static void function_finalizer(SQLFunctionCtx *pCtx) {
*/
*/
static
void
count_function
(
SQLFunctionCtx
*
pCtx
)
{
static
void
count_function
(
SQLFunctionCtx
*
pCtx
)
{
int32_t
numOfElem
=
0
;
int32_t
numOfElem
=
0
;
/*
/*
* 1. column data missing (schema modified) causes pCtx->hasNull == true. pCtx->preAggVals.isSet == true;
* 1. column data missing (schema modified) causes pCtx->hasNull == true. pCtx->preAggVals.isSet == true;
* 2. for general non-primary key columns, pCtx->hasNull may be true or false, pCtx->preAggVals.isSet == true;
* 2. for general non-primary key columns, pCtx->hasNull may be true or false, pCtx->preAggVals.isSet == true;
...
@@ -562,7 +562,7 @@ static void count_function(SQLFunctionCtx *pCtx) {
...
@@ -562,7 +562,7 @@ static void count_function(SQLFunctionCtx *pCtx) {
if
(
isNull
(
val
,
pCtx
->
inputType
))
{
if
(
isNull
(
val
,
pCtx
->
inputType
))
{
continue
;
continue
;
}
}
numOfElem
+=
1
;
numOfElem
+=
1
;
}
}
}
else
{
}
else
{
...
@@ -570,11 +570,11 @@ static void count_function(SQLFunctionCtx *pCtx) {
...
@@ -570,11 +570,11 @@ static void count_function(SQLFunctionCtx *pCtx) {
numOfElem
=
pCtx
->
size
;
numOfElem
=
pCtx
->
size
;
}
}
}
}
if
(
numOfElem
>
0
)
{
if
(
numOfElem
>
0
)
{
GET_RES_INFO
(
pCtx
)
->
hasResult
=
DATA_SET_FLAG
;
GET_RES_INFO
(
pCtx
)
->
hasResult
=
DATA_SET_FLAG
;
}
}
*
((
int64_t
*
)
pCtx
->
pOutput
)
+=
numOfElem
;
*
((
int64_t
*
)
pCtx
->
pOutput
)
+=
numOfElem
;
SET_VAL
(
pCtx
,
numOfElem
,
1
);
SET_VAL
(
pCtx
,
numOfElem
,
1
);
}
}
...
@@ -584,7 +584,7 @@ static void count_func_merge(SQLFunctionCtx *pCtx) {
...
@@ -584,7 +584,7 @@ static void count_func_merge(SQLFunctionCtx *pCtx) {
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
*
((
int64_t
*
)
pCtx
->
pOutput
)
+=
pData
[
i
];
*
((
int64_t
*
)
pCtx
->
pOutput
)
+=
pData
[
i
];
}
}
SET_VAL
(
pCtx
,
pCtx
->
size
,
1
);
SET_VAL
(
pCtx
,
pCtx
->
size
,
1
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录