Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
abb545ef
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看板
提交
abb545ef
编写于
2月 13, 2023
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: first/last can process datablock that has only statistics input
上级
f68a1eca
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
0 deletion
+10
-0
src/query/inc/qAggMain.h
src/query/inc/qAggMain.h
+1
-0
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+9
-0
未找到文件。
src/query/inc/qAggMain.h
浏览文件 @
abb545ef
...
@@ -196,6 +196,7 @@ typedef struct SQLFunctionCtx {
...
@@ -196,6 +196,7 @@ typedef struct SQLFunctionCtx {
uint32_t
order
;
// asc|desc
uint32_t
order
;
// asc|desc
int16_t
inputType
;
int16_t
inputType
;
int32_t
inputBytes
;
int32_t
inputBytes
;
bool
hasColDataInput
;
// the input data block has column data
int16_t
outputType
;
int16_t
outputType
;
int32_t
outputBytes
;
// size of results, determined by function and input column data type
int32_t
outputBytes
;
// size of results, determined by function and input column data type
...
...
src/query/src/qExecutor.c
浏览文件 @
abb545ef
...
@@ -1322,6 +1322,7 @@ static void doSetInputDataBlockInfo(SOperatorInfo* pOperator, SQLFunctionCtx* pC
...
@@ -1322,6 +1322,7 @@ static void doSetInputDataBlockInfo(SOperatorInfo* pOperator, SQLFunctionCtx* pC
pCtx
[
i
].
order
=
order
;
pCtx
[
i
].
order
=
order
;
pCtx
[
i
].
size
=
pBlock
->
info
.
rows
;
pCtx
[
i
].
size
=
pBlock
->
info
.
rows
;
pCtx
[
i
].
currentStage
=
(
uint8_t
)
pOperator
->
pRuntimeEnv
->
scanFlag
;
pCtx
[
i
].
currentStage
=
(
uint8_t
)
pOperator
->
pRuntimeEnv
->
scanFlag
;
pCtx
[
i
].
hasColDataInput
=
false
;
setBlockStatisInfo
(
&
pCtx
[
i
],
pBlock
,
&
pOperator
->
pExpr
[
i
].
base
.
colInfo
);
setBlockStatisInfo
(
&
pCtx
[
i
],
pBlock
,
&
pOperator
->
pExpr
[
i
].
base
.
colInfo
);
}
}
...
@@ -1349,6 +1350,7 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
...
@@ -1349,6 +1350,7 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
pCtx
[
i
].
order
=
order
;
pCtx
[
i
].
order
=
order
;
pCtx
[
i
].
size
=
pBlock
->
info
.
rows
;
pCtx
[
i
].
size
=
pBlock
->
info
.
rows
;
pCtx
[
i
].
currentStage
=
(
uint8_t
)
pOperator
->
pRuntimeEnv
->
scanFlag
;
pCtx
[
i
].
currentStage
=
(
uint8_t
)
pOperator
->
pRuntimeEnv
->
scanFlag
;
pCtx
[
i
].
hasColDataInput
=
(
pBlock
->
pDataBlock
!=
NULL
);
setBlockStatisInfo
(
&
pCtx
[
i
],
pBlock
,
&
pOperator
->
pExpr
[
i
].
base
.
colInfo
);
setBlockStatisInfo
(
&
pCtx
[
i
],
pBlock
,
&
pOperator
->
pExpr
[
i
].
base
.
colInfo
);
...
@@ -2129,6 +2131,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx*
...
@@ -2129,6 +2131,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx*
}
}
if
(
functionId
==
TSDB_FUNC_FIRST_DST
||
functionId
==
TSDB_FUNC_FIRST
)
{
if
(
functionId
==
TSDB_FUNC_FIRST_DST
||
functionId
==
TSDB_FUNC_FIRST
)
{
if
(
pCtx
->
hasColDataInput
==
false
)
{
return
false
;
}
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always
// return true
// return true
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
...
@@ -2137,6 +2142,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx*
...
@@ -2137,6 +2142,9 @@ static bool functionNeedToExecute(SQueryRuntimeEnv* pRuntimeEnv, SQLFunctionCtx*
// denote the order type
// denote the order type
if
((
functionId
==
TSDB_FUNC_LAST_DST
||
functionId
==
TSDB_FUNC_LAST
))
{
if
((
functionId
==
TSDB_FUNC_LAST_DST
||
functionId
==
TSDB_FUNC_LAST
))
{
if
(
pCtx
->
hasColDataInput
==
false
)
{
return
false
;
}
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always
// if param[2] is set value, input data come from client, order is no relation with pQueryAttr->order, so always
// return true
// return true
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
if
(
pCtx
->
param
[
2
].
nType
==
TSDB_DATA_TYPE_INT
)
return
true
;
...
@@ -2259,6 +2267,7 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr
...
@@ -2259,6 +2267,7 @@ static SQLFunctionCtx* createSQLFunctionCtx(SQueryRuntimeEnv* pRuntimeEnv, SExpr
}
else
{
}
else
{
pCtx
->
inputBytes
=
pSqlExpr
->
colBytes
;
pCtx
->
inputBytes
=
pSqlExpr
->
colBytes
;
}
}
pCtx
->
hasColDataInput
=
false
;
pCtx
->
ptsOutputBuf
=
NULL
;
pCtx
->
ptsOutputBuf
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录