Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f096f27c
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f096f27c
编写于
5月 01, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
4decef96
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
35 deletion
+7
-35
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-4
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+6
-31
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
f096f27c
...
@@ -1235,9 +1235,6 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
...
@@ -1235,9 +1235,6 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
if
(
fmIsPseudoColumnFunc
(
pfCtx
->
functionId
))
{
if
(
fmIsPseudoColumnFunc
(
pfCtx
->
functionId
))
{
// do nothing
// do nothing
}
else
if
(
fmIsNonstandardSQLFunc
(
pfCtx
->
functionId
))
{
}
else
if
(
fmIsNonstandardSQLFunc
(
pfCtx
->
functionId
))
{
// todo set the correct timestamp column
pfCtx
->
input
.
pPTS
=
taosArrayGet
(
pSrcBlock
->
pDataBlock
,
1
);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
&
pCtx
[
k
]);
SResultRowEntryInfo
*
pResInfo
=
GET_RES_INFO
(
&
pCtx
[
k
]);
pfCtx
->
fpSet
.
init
(
&
pCtx
[
k
],
pResInfo
);
pfCtx
->
fpSet
.
init
(
&
pCtx
[
k
],
pResInfo
);
...
@@ -2490,7 +2487,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
...
@@ -2490,7 +2487,7 @@ int32_t loadDataBlockOnDemand(SExecTaskInfo* pTaskInfo, STableScanInfo* pTableSc
// if (pQueryAttr->pFilters != NULL) {
// if (pQueryAttr->pFilters != NULL) {
// filterSetColFieldData(pQueryAttr->pFilters, pBlock->info.numOfCols, pBlock->pDataBlock);
// filterSetColFieldData(pQueryAttr->pFilters, pBlock->info.numOfCols, pBlock->pDataBlock);
// }
// }
// if (pQueryAttr->pFilters != NULL || pRuntimeEnv->pTsBuf != NULL) {
// if (pQueryAttr->pFilters != NULL || pRuntimeEnv->pTsBuf != NULL) {
// filterColRowsInDataBlock(pRuntimeEnv, pBlock, ascQuery);
// filterColRowsInDataBlock(pRuntimeEnv, pBlock, ascQuery);
// }
// }
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
f096f27c
...
@@ -1198,9 +1198,6 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1198,9 +1198,6 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
bool
isFirstBlock
=
(
pDiffInfo
->
hasPrev
==
false
);
bool
isFirstBlock
=
(
pDiffInfo
->
hasPrev
==
false
);
int32_t
numOfElems
=
0
;
int32_t
numOfElems
=
0
;
// int32_t step = GET_FORWARD_DIRECTION_FACTOR(pCtx->order);
// int32_t start = (pCtx->order == TSDB_ORDER_ASC) ? pInput->startRowIndex : pInput->numOfRows + pInput->startRowIndex - 1;
SColumnInfoData
*
pTsOutput
=
pCtx
->
pTsOutput
;
SColumnInfoData
*
pTsOutput
=
pCtx
->
pTsOutput
;
TSKEY
*
tsList
=
(
int64_t
*
)
pInput
->
pPTS
->
pData
;
TSKEY
*
tsList
=
(
int64_t
*
)
pInput
->
pPTS
->
pData
;
...
@@ -1246,8 +1243,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1246,8 +1243,9 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
int32_t
v
=
*
(
int32_t
*
)
colDataGetData
(
pInputCol
,
i
);
int32_t
v
=
*
(
int32_t
*
)
colDataGetData
(
pInputCol
,
i
);
int32_t
pos
=
startOffset
+
numOfElems
;
int32_t
pos
=
startOffset
+
numOfElems
;
// there is a row of previous data block to be handled in the first place.
if
(
pDiffInfo
->
hasPrev
)
{
if
(
pDiffInfo
->
hasPrev
)
{
int32_t
delta
=
-
(
int32_t
)(
v
-
pDiffInfo
->
prev
.
i64
);
// direct previous may be null
int32_t
delta
=
(
int32_t
)(
pDiffInfo
->
prev
.
i64
-
v
);
// direct previous may be null
if
(
delta
<
0
&&
pDiffInfo
->
ignoreNegative
)
{
if
(
delta
<
0
&&
pDiffInfo
->
ignoreNegative
)
{
colDataSetNull_f
(
pOutput
->
nullbitmap
,
pos
);
colDataSetNull_f
(
pOutput
->
nullbitmap
,
pos
);
}
else
{
}
else
{
...
@@ -1255,11 +1253,12 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1255,11 +1253,12 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
}
}
if
(
pTsOutput
!=
NULL
)
{
if
(
pTsOutput
!=
NULL
)
{
colDataAppendInt64
(
pTsOutput
,
pos
,
&
tsList
[
i
]
);
colDataAppendInt64
(
pTsOutput
,
pos
,
&
pDiffInfo
->
prevTs
);
}
}
pDiffInfo
->
hasPrev
=
false
;
pDiffInfo
->
hasPrev
=
false
;
}
}
// it is not the last row of current block
if
(
i
<
pInput
->
numOfRows
+
pInput
->
startRowIndex
-
1
)
{
if
(
i
<
pInput
->
numOfRows
+
pInput
->
startRowIndex
-
1
)
{
int32_t
next
=
*
(
int32_t
*
)
colDataGetData
(
pInputCol
,
i
+
1
);
int32_t
next
=
*
(
int32_t
*
)
colDataGetData
(
pInputCol
,
i
+
1
);
...
@@ -1276,22 +1275,6 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1276,22 +1275,6 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
}
}
pDiffInfo
->
hasPrev
=
true
;
pDiffInfo
->
hasPrev
=
true
;
}
}
// if (colDataIsNull_f(pInputCol->nullbitmap, i)) {
// if (pDiffInfo->includeNull) {
// colDataSetNull_f(pOutput->nullbitmap, pos);
// if (tsList != NULL) {
// colDataAppendInt64(pTsOutput, pos, &tsList[i]);
// }
//
// numOfElems += 1;
// }
// continue;
// }
// int32_t v = *(int32_t*)colDataGetData(pInputCol, i);
// pDiffInfo->prev.i64 = v;
// pDiffInfo->hasPrev = true;
numOfElems
++
;
numOfElems
++
;
}
}
...
@@ -1436,7 +1419,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1436,7 +1419,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
}
}
// initial value is not set yet
// initial value is not set yet
if
(
!
pDiffInfo
->
hasPrev
||
numOfElems
<=
0
)
{
if
(
numOfElems
<=
0
)
{
/*
/*
* 1. current block and blocks before are full of null
* 1. current block and blocks before are full of null
* 2. current block may be null value
* 2. current block may be null value
...
@@ -1444,15 +1427,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
...
@@ -1444,15 +1427,7 @@ int32_t diffFunction(SqlFunctionCtx* pCtx) {
assert
(
pCtx
->
hasNull
);
assert
(
pCtx
->
hasNull
);
return
0
;
return
0
;
}
else
{
}
else
{
// for (int t = 0; t < pCtx->tagInfo.numOfTagCols; ++t) {
return
(
isFirstBlock
)
?
numOfElems
-
1
:
numOfElems
;
// SqlFunctionCtx* tagCtx = pCtx->tagInfo.pTagCtxList[t];
// if (tagCtx->functionId == TSDB_FUNC_TAG_DUMMY) {
// aAggs[TSDB_FUNC_TAGPRJ].xFunction(tagCtx);
// }
// }
int32_t
forwardStep
=
(
isFirstBlock
)
?
numOfElems
-
1
:
numOfElems
;
return
forwardStep
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录