Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0f00b7b1
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
0f00b7b1
编写于
10月 15, 2021
作者:
S
shenglian zhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support "select pow(c1,2)+2 from stable order by ts desc";
上级
4a0908a0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
8 deletion
+11
-8
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+9
-7
未找到文件。
src/query/inc/qExecutor.h
浏览文件 @
0f00b7b1
...
...
@@ -471,6 +471,7 @@ typedef struct SProjectOperatorInfo {
int32_t
bufCapacity
;
uint32_t
seed
;
uint32_t
order
;
bool
updateTableQueryInfo
;
SSDataBlock
*
existDataBlock
;
}
SProjectOperatorInfo
;
...
...
@@ -592,7 +593,7 @@ SOperatorInfo* createTableScanOperator(void* pTsdbQueryHandle, SQueryRuntimeEnv*
SOperatorInfo
*
createTableSeqScanOperator
(
void
*
pTsdbQueryHandle
,
SQueryRuntimeEnv
*
pRuntimeEnv
);
SOperatorInfo
*
createAggregateOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
SOperatorInfo
*
createProjectOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
uint32_t
order
);
SOperatorInfo
*
createProjectOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
uint32_t
order
,
bool
UpdateTableQueryInfo
);
SOperatorInfo
*
createLimitOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
);
SOperatorInfo
*
createTimeIntervalOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
SOperatorInfo
*
createAllTimeIntervalOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
);
...
...
src/query/src/qExecutor.c
浏览文件 @
0f00b7b1
...
...
@@ -2262,19 +2262,19 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int32_t numOf
case
OP_Project
:
{
// TODO refactor to remove arith operator.
SOperatorInfo
*
prev
=
pRuntimeEnv
->
proot
;
if
(
i
==
0
)
{
pRuntimeEnv
->
proot
=
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
,
pQueryAttr
->
order
.
order
);
pRuntimeEnv
->
proot
=
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr1
,
pQueryAttr
->
numOfOutput
,
pQueryAttr
->
order
.
order
,
true
);
if
(
pRuntimeEnv
->
proot
!=
NULL
&&
prev
->
operatorType
!=
OP_DummyInput
&&
prev
->
operatorType
!=
OP_Join
)
{
// TODO refactor
setTableScanFilterOperatorInfo
(
prev
->
info
,
pRuntimeEnv
->
proot
);
}
}
else
{
prev
=
pRuntimeEnv
->
proot
;
assert
(
pQueryAttr
->
pExpr2
!=
NULL
);
if
(
prev
->
operatorType
==
OP_Project
)
{
if
(
prev
->
operatorType
==
OP_Project
||
pQueryAttr
->
stableQuery
)
{
pRuntimeEnv
->
proot
=
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr2
,
pQueryAttr
->
numOfExpr2
,
TSDB_ORDER_ASC
);
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr2
,
pQueryAttr
->
numOfExpr2
,
TSDB_ORDER_ASC
,
false
);
}
else
{
pRuntimeEnv
->
proot
=
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr2
,
pQueryAttr
->
numOfExpr2
,
pQueryAttr
->
order
.
order
);
createProjectOperatorInfo
(
pRuntimeEnv
,
prev
,
pQueryAttr
->
pExpr2
,
pQueryAttr
->
numOfExpr2
,
pQueryAttr
->
order
.
order
,
true
);
}
}
break
;
...
...
@@ -5837,7 +5837,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
updateOutputBuf
(
&
pProjectInfo
->
binfo
,
&
pProjectInfo
->
bufCapacity
,
pBlock
->
info
.
rows
);
projectApplyFunctions
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
if
(
pTableQueryInfo
!=
NULL
)
{
if
(
pTableQueryInfo
!=
NULL
&&
pProjectInfo
->
updateTableQueryInfo
)
{
updateTableIdInfo
(
pTableQueryInfo
,
pBlock
,
pRuntimeEnv
->
pTableRetrieveTsMap
,
pRuntimeEnv
->
pQueryAttr
->
order
.
order
);
}
...
...
@@ -5898,7 +5898,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
updateOutputBuf
(
&
pProjectInfo
->
binfo
,
&
pProjectInfo
->
bufCapacity
,
pBlock
->
info
.
rows
);
projectApplyFunctions
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
if
(
pTableQueryInfo
!=
NULL
)
{
if
(
pTableQueryInfo
!=
NULL
&&
pProjectInfo
->
updateTableQueryInfo
)
{
updateTableIdInfo
(
pTableQueryInfo
,
pBlock
,
pRuntimeEnv
->
pTableRetrieveTsMap
,
pRuntimeEnv
->
pQueryAttr
->
order
.
order
);
}
...
...
@@ -6751,12 +6751,14 @@ SOperatorInfo* createMultiTableAggOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SO
return
pOperator
;
}
SOperatorInfo
*
createProjectOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
uint32_t
order
)
{
SOperatorInfo
*
createProjectOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
,
uint32_t
order
,
bool
updateTableQueryInfo
)
{
SProjectOperatorInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SProjectOperatorInfo
));
pInfo
->
seed
=
rand
();
pInfo
->
bufCapacity
=
pRuntimeEnv
->
resultInfo
.
capacity
;
pInfo
->
order
=
order
;
pInfo
->
updateTableQueryInfo
=
updateTableQueryInfo
;
SOptrBasicInfo
*
pBInfo
=
&
pInfo
->
binfo
;
pBInfo
->
pRes
=
createOutputBuf
(
pExpr
,
numOfOutput
,
pInfo
->
bufCapacity
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录