Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0252fa49
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看板
提交
0252fa49
编写于
4月 14, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ehn(query): remove some redundant codes in executor.
上级
33e51fda
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
20 deletion
+14
-20
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+0
-6
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+8
-7
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+6
-7
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
0252fa49
...
...
@@ -152,11 +152,6 @@ typedef struct SOperatorCostInfo {
uint64_t
totalCost
;
}
SOperatorCostInfo
;
typedef
struct
SOrder
{
uint32_t
order
;
SColumn
col
;
}
SOrder
;
// The basic query information extracted from the SQueryInfo tree to support the
// execution of query in a data node.
typedef
struct
STaskAttr
{
...
...
@@ -170,7 +165,6 @@ typedef struct STaskAttr {
bool
diffQuery
;
// is diff query
bool
pointInterpQuery
;
// point interpolation query
int32_t
havingNum
;
// having expr number
SOrder
order
;
int16_t
numOfCols
;
int16_t
numOfTags
;
STimeWindow
window
;
...
...
source/libs/executor/src/executil.c
浏览文件 @
0252fa49
...
...
@@ -337,11 +337,11 @@ int32_t tsDescOrder(const void* p1, const void* p2) {
void
orderTheResultRows
(
STaskRuntimeEnv
*
pRuntimeEnv
)
{
__compar_fn_t
fn
=
NULL
;
if
(
pRuntimeEnv
->
pQueryAttr
->
order
.
order
==
TSDB_ORDER_ASC
)
{
fn
=
tsAscOrder
;
}
else
{
fn
=
tsDescOrder
;
}
//
if (pRuntimeEnv->pQueryAttr->order.order == TSDB_ORDER_ASC) {
//
fn = tsAscOrder;
//
} else {
//
fn = tsDescOrder;
//
}
taosArraySort
(
pRuntimeEnv
->
pResultRowArrayList
,
fn
);
}
...
...
@@ -377,7 +377,7 @@ static int32_t mergeIntoGroupResultImplRv(STaskRuntimeEnv *pRuntimeEnv, SGroupRe
static
UNUSED_FUNC
int32_t
mergeIntoGroupResultImpl
(
STaskRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
SArray
*
pTableList
,
int32_t
*
rowCellInfoOffset
)
{
bool
ascQuery
=
QUERY_IS_ASC_QUERY
(
pRuntimeEnv
->
pQueryAttr
)
;
bool
ascQuery
=
true
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -413,7 +413,8 @@ static UNUSED_FUNC int32_t mergeIntoGroupResultImpl(STaskRuntimeEnv *pRuntimeEnv
goto
_end
;
}
SCompSupporter
cs
=
{
pTableQueryInfoList
,
posList
,
pRuntimeEnv
->
pQueryAttr
->
order
.
order
};
int32_t
order
=
TSDB_ORDER_ASC
;
SCompSupporter
cs
=
{
pTableQueryInfoList
,
posList
,
order
};
int32_t
ret
=
tMergeTreeCreate
(
&
pTree
,
numOfTables
,
&
cs
,
tableResultComparFn
);
if
(
ret
!=
TSDB_CODE_SUCCESS
)
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
0252fa49
...
...
@@ -990,7 +990,8 @@ static int32_t getNextQualifiedWindow(SInterval* pInterval, STimeWindow* pNext,
static
FORCE_INLINE
TSKEY
reviseWindowEkey
(
STaskAttr
*
pQueryAttr
,
STimeWindow
*
pWindow
)
{
TSKEY
ekey
=
-
1
;
if
(
QUERY_IS_ASC_QUERY
(
pQueryAttr
))
{
int32_t
order
=
TSDB_ORDER_ASC
;
if
(
order
==
TSDB_ORDER_ASC
)
{
ekey
=
pWindow
->
ekey
;
if
(
ekey
>
pQueryAttr
->
window
.
ekey
)
{
ekey
=
pQueryAttr
->
window
.
ekey
;
...
...
@@ -1961,7 +1962,8 @@ static bool isCachedLastQuery(STaskAttr* pQueryAttr) {
return
false
;
}
if
(
pQueryAttr
->
order
.
order
!=
TSDB_ORDER_DESC
||
!
TSWINDOW_IS_EQUAL
(
pQueryAttr
->
window
,
TSWINDOW_DESC_INITIALIZER
))
{
int32_t
order
=
TSDB_ORDER_ASC
;
if
(
order
!=
TSDB_ORDER_DESC
||
!
TSWINDOW_IS_EQUAL
(
pQueryAttr
->
window
,
TSWINDOW_DESC_INITIALIZER
))
{
return
false
;
}
...
...
@@ -2187,7 +2189,7 @@ static bool overlapWithTimeWindow(STaskAttr* pQueryAttr, SDataBlockInfo* pBlockI
TSKEY
sk
=
TMIN
(
pQueryAttr
->
window
.
skey
,
pQueryAttr
->
window
.
ekey
);
TSKEY
ek
=
TMAX
(
pQueryAttr
->
window
.
skey
,
pQueryAttr
->
window
.
ekey
);
if
(
QUERY_IS_ASC_QUERY
(
pQueryAttr
)
)
{
if
(
true
)
{
// getAlignQueryTimeWindow(pQueryAttr, pBlockInfo->window.skey, sk, ek, &w);
assert
(
w
.
ekey
>=
pBlockInfo
->
window
.
skey
);
...
...
@@ -5445,8 +5447,6 @@ static SSDataBlock* doSTableIntervalAgg(SOperatorInfo* pOperator, bool* newgroup
}
STaskAttr
*
pQueryAttr
=
pRuntimeEnv
->
pQueryAttr
;
int32_t
order
=
pQueryAttr
->
order
.
order
;
SOperatorInfo
*
downstream
=
pOperator
->
pDownstream
[
0
];
while
(
1
)
{
...
...
@@ -5462,14 +5462,13 @@ static SSDataBlock* doSTableIntervalAgg(SOperatorInfo* pOperator, bool* newgroup
STableQueryInfo
*
pTableQueryInfo
=
pRuntimeEnv
->
current
;
// setTagValue(pOperator, pTableQueryInfo->pTable, pIntervalInfo->pCtx, pOperator->numOfOutput);
setInputDataBlock
(
pOperator
,
pIntervalInfo
->
binfo
.
pCtx
,
pBlock
,
pQueryAttr
->
order
.
order
);
setInputDataBlock
(
pOperator
,
pIntervalInfo
->
binfo
.
pCtx
,
pBlock
,
TSDB_ORDER_ASC
);
setIntervalQueryRange
(
pRuntimeEnv
,
pBlock
->
info
.
window
.
skey
);
hashIntervalAgg
(
pOperator
,
&
pTableQueryInfo
->
resInfo
,
pBlock
,
pTableQueryInfo
->
groupIndex
);
}
pOperator
->
status
=
OP_RES_TO_RETURN
;
pQueryAttr
->
order
.
order
=
order
;
// TODO : restore the order
doCloseAllTimeWindow
(
pRuntimeEnv
);
setTaskStatus
(
pOperator
->
pTaskInfo
,
TASK_COMPLETED
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录