Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9fa5b304
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看板
提交
9fa5b304
编写于
5月 14, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into feat/alter_table
上级
088ba309
fe01caf3
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
23 deletion
+41
-23
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+41
-23
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
9fa5b304
...
@@ -2114,6 +2114,7 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
...
@@ -2114,6 +2114,7 @@ void setResultRowInitCtx(SResultRow* pResult, SqlFunctionCtx* pCtx, int32_t numO
}
}
}
}
static
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
);
void
doFilter
(
const
SNode
*
pFilterNode
,
SSDataBlock
*
pBlock
)
{
void
doFilter
(
const
SNode
*
pFilterNode
,
SSDataBlock
*
pBlock
)
{
if
(
pFilterNode
==
NULL
)
{
if
(
pFilterNode
==
NULL
)
{
return
;
return
;
...
@@ -2128,43 +2129,60 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock) {
...
@@ -2128,43 +2129,60 @@ void doFilter(const SNode* pFilterNode, SSDataBlock* pBlock) {
code
=
filterSetDataFromSlotId
(
filter
,
&
param1
);
code
=
filterSetDataFromSlotId
(
filter
,
&
param1
);
int8_t
*
rowRes
=
NULL
;
int8_t
*
rowRes
=
NULL
;
// todo the keep seems never to be True??
bool
keep
=
filterExecute
(
filter
,
pBlock
,
&
rowRes
,
NULL
,
param1
.
numOfCols
);
bool
keep
=
filterExecute
(
filter
,
pBlock
,
&
rowRes
,
NULL
,
param1
.
numOfCols
);
filterFreeInfo
(
filter
);
filterFreeInfo
(
filter
);
SSDataBlock
*
px
=
createOneDataBlock
(
pBlock
,
false
);
extractQualifiedTupleByFilterResult
(
pBlock
,
rowRes
,
keep
);
blockDataEnsureCapacity
(
px
,
pBlock
->
info
.
rows
);
blockDataUpdateTsWindow
(
pBlock
);
}
// todo extract method
void
extractQualifiedTupleByFilterResult
(
SSDataBlock
*
pBlock
,
const
int8_t
*
rowRes
,
bool
keep
)
{
int32_t
numOfRow
=
0
;
if
(
keep
)
{
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
return
;
SColumnInfoData
*
pDst
=
taosArrayGet
(
px
->
pDataBlock
,
i
);
}
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
if
(
keep
)
{
if
(
rowRes
!=
NULL
)
{
colDataAssign
(
pDst
,
pSrc
,
pBlock
->
info
.
rows
);
SSDataBlock
*
px
=
createOneDataBlock
(
pBlock
,
false
);
numOfRow
=
pBlock
->
info
.
rows
;
blockDataEnsureCapacity
(
px
,
pBlock
->
info
.
rows
);
}
else
if
(
NULL
!=
rowRes
)
{
numOfRow
=
0
;
int32_t
totalRows
=
pBlock
->
info
.
rows
;
for
(
int32_t
j
=
0
;
j
<
pBlock
->
info
.
rows
;
++
j
)
{
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
SColumnInfoData
*
pDst
=
taosArrayGet
(
px
->
pDataBlock
,
i
);
SColumnInfoData
*
pSrc
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
// For the reserved column, the value is not filled yet, so the whole column data may be NULL.
if
(
pSrc
->
pData
==
NULL
)
{
continue
;
}
int32_t
numOfRows
=
0
;
for
(
int32_t
j
=
0
;
j
<
totalRows
;
++
j
)
{
if
(
rowRes
[
j
]
==
0
)
{
if
(
rowRes
[
j
]
==
0
)
{
continue
;
continue
;
}
}
if
(
colDataIsNull_s
(
pSrc
,
j
))
{
if
(
colDataIsNull_s
(
pSrc
,
j
))
{
colDataAppendNULL
(
pDst
,
numOfRow
);
colDataAppendNULL
(
pDst
,
numOfRow
s
);
}
else
{
}
else
{
colDataAppend
(
pDst
,
numOfRow
,
colDataGetData
(
pSrc
,
j
),
false
);
colDataAppend
(
pDst
,
numOfRow
s
,
colDataGetData
(
pSrc
,
j
),
false
);
}
}
numOfRow
+=
1
;
numOfRow
s
+=
1
;
}
}
}
else
{
numOfRow
=
0
;
}
*
pSrc
=
*
pDst
;
if
(
pBlock
->
info
.
rows
==
totalRows
)
{
}
pBlock
->
info
.
rows
=
numOfRows
;
}
else
{
ASSERT
(
pBlock
->
info
.
rows
==
numOfRows
);
}
pBlock
->
info
.
rows
=
numOfRow
;
*
pSrc
=
*
pDst
;
blockDataUpdateTsWindow
(
pBlock
);
}
}
else
{
// do nothing
pBlock
->
info
.
rows
=
0
;
}
}
}
void
doSetTableGroupOutputBuf
(
SAggOperatorInfo
*
pAggInfo
,
int32_t
numOfOutput
,
uint64_t
groupId
,
void
doSetTableGroupOutputBuf
(
SAggOperatorInfo
*
pAggInfo
,
int32_t
numOfOutput
,
uint64_t
groupId
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录