Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
61cb98c9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
61cb98c9
编写于
3月 03, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-2895] refactor.
上级
aaeedc65
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
64 deletion
+7
-64
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+7
-64
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
61cb98c9
...
...
@@ -195,7 +195,6 @@ static SOperatorInfo* createTagScanOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, S
static
int32_t
doCopyToSData_rv
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
,
int32_t
orderType
,
SSDataBlock
*
pBlock
);
static
char
*
getGroupbyColumnData
(
SQuery
*
pQuery
,
int16_t
*
type
,
int16_t
*
bytes
,
SArray
*
pDataBlock
);
static
int32_t
getGroupbyColumnData_rv
(
SSqlGroupbyExpr
*
pGroupbyExpr
,
SSDataBlock
*
pDataBlock
);
static
int32_t
setGroupResultOutputBuf_rv
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SResultRowInfo
*
pResultRowInfo
,
...
...
@@ -778,7 +777,7 @@ static void doUpdateResultRowIndex(SResultRowInfo*pResultRowInfo, TSKEY lastKey,
}
}
static
void
updateResultRowIndex
(
SResultRowInfo
*
pResultRowInfo
,
STableQueryInfo
*
pTableQueryInfo
,
bool
ascQuery
,
bool
timeWindowInterpo
)
{
static
UNUSED_FUNC
void
updateResultRowIndex
(
SResultRowInfo
*
pResultRowInfo
,
STableQueryInfo
*
pTableQueryInfo
,
bool
ascQuery
,
bool
timeWindowInterpo
)
{
if
((
pTableQueryInfo
->
lastKey
>
pTableQueryInfo
->
win
.
ekey
&&
ascQuery
)
||
(
pTableQueryInfo
->
lastKey
<
pTableQueryInfo
->
win
.
ekey
&&
(
!
ascQuery
)))
{
closeAllResultRows
(
pResultRowInfo
);
pResultRowInfo
->
curIndex
=
pResultRowInfo
->
size
-
1
;
...
...
@@ -973,7 +972,7 @@ static void setNotInterpoWindowKey(SQLFunctionCtx* pCtx, int32_t numOfOutput, in
// window start key interpolation
static
UNUSED_FUNC
void
saveDataBlockLastRow
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SDataBlockInfo
*
pDataBlockInfo
,
SArray
*
pDataBlock
,
static
void
saveDataBlockLastRow
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SDataBlockInfo
*
pDataBlockInfo
,
SArray
*
pDataBlock
,
int32_t
rowIndex
)
{
if
(
pDataBlock
==
NULL
)
{
return
;
...
...
@@ -1357,6 +1356,11 @@ static void hashIntervalAgg(SOperatorInfo* pOperatorInfo, SResultRowInfo* pResul
doBlockwiseApplyFunctions_rv
(
pRuntimeEnv
,
pInfo
->
pCtx
,
&
nextWin
,
startPos
,
forwardStep
,
tsCols
,
pSDataBlock
->
info
.
rows
,
numOfOutput
);
}
if
(
pQuery
->
timeWindowInterpo
)
{
int32_t
rowIndex
=
QUERY_IS_ASC_QUERY
(
pQuery
)
?
pSDataBlock
->
info
.
rows
-
1
:
0
;
saveDataBlockLastRow
(
pRuntimeEnv
,
&
pSDataBlock
->
info
,
pSDataBlock
->
pDataBlock
,
rowIndex
);
}
}
static
void
hashGroupbyAgg
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
pOperator
,
SGroupbyOperatorInfo
*
pInfo
,
...
...
@@ -1436,48 +1440,6 @@ static int32_t setGroupResultOutputBuf_rv(SQueryRuntimeEnv *pRuntimeEnv, SResult
return
TSDB_CODE_SUCCESS
;
}
static
UNUSED_FUNC
char
*
getGroupbyColumnData
(
SQuery
*
pQuery
,
int16_t
*
type
,
int16_t
*
bytes
,
SArray
*
pDataBlock
)
{
SSqlGroupbyExpr
*
pGroupbyExpr
=
pQuery
->
pGroupbyExpr
;
for
(
int32_t
k
=
0
;
k
<
pGroupbyExpr
->
numOfGroupCols
;
++
k
)
{
SColIndex
*
pColIndex
=
taosArrayGet
(
pGroupbyExpr
->
columnInfo
,
k
);
if
(
TSDB_COL_IS_TAG
(
pColIndex
->
flag
))
{
continue
;
}
int16_t
colIndex
=
-
1
;
int32_t
colId
=
pColIndex
->
colId
;
for
(
int32_t
i
=
0
;
i
<
pQuery
->
numOfCols
;
++
i
)
{
if
(
pQuery
->
colList
[
i
].
colId
==
colId
)
{
colIndex
=
i
;
break
;
}
}
assert
(
colIndex
>=
0
&&
colIndex
<
pQuery
->
numOfCols
);
*
type
=
pQuery
->
colList
[
colIndex
].
type
;
*
bytes
=
pQuery
->
colList
[
colIndex
].
bytes
;
/*
* the colIndex is acquired from the first tables of all qualified tables in this vnode during query prepare
* stage, the remain tables may not have the required column in cache actually. So, the validation of required
* column in cache with the corresponding schema is reinforced.
*/
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
pDataBlock
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
p
=
taosArrayGet
(
pDataBlock
,
i
);
if
(
pColIndex
->
colId
==
p
->
info
.
colId
)
{
return
p
->
pData
;
}
}
}
return
NULL
;
}
static
int32_t
getGroupbyColumnData_rv
(
SSqlGroupbyExpr
*
pGroupbyExpr
,
SSDataBlock
*
pDataBlock
)
{
for
(
int32_t
k
=
0
;
k
<
pGroupbyExpr
->
numOfGroupCols
;
++
k
)
{
SColIndex
*
pColIndex
=
taosArrayGet
(
pGroupbyExpr
->
columnInfo
,
k
);
...
...
@@ -3630,25 +3592,6 @@ static void updateWindowResNumOfRes_rv(SQueryRuntimeEnv *pRuntimeEnv,
}
}
static
UNUSED_FUNC
void
stableApplyFunctionsOnBlock
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SDataBlockInfo
*
pDataBlockInfo
,
SDataStatis
*
pStatis
,
SArray
*
pDataBlock
,
__block_search_fn_t
searchFn
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
STableQueryInfo
*
pTableQueryInfo
=
pQuery
->
current
;
SResultRowInfo
*
pResultRowInfo
=
&
pTableQueryInfo
->
resInfo
;
// pQuery->pos = QUERY_IS_ASC_QUERY(pQuery)? 0 : pDataBlockInfo->rows - 1;
// if (pQuery->numOfFilterCols > 0 || pRuntimeEnv->pTsBuf != NULL || pQuery->groupbyColumn) {
// rowwiseApplyFunctions(pRuntimeEnv, pStatis, pDataBlockInfo, pResultRowInfo, pDataBlock);
// } else {
// blockwiseApplyFunctions(pRuntimeEnv, pStatis, pDataBlockInfo, pResultRowInfo, searchFn, pDataBlock);
// }
if
(
QUERY_IS_INTERVAL_QUERY
(
pQuery
))
{
updateResultRowIndex
(
pResultRowInfo
,
pTableQueryInfo
,
QUERY_IS_ASC_QUERY
(
pQuery
),
pQuery
->
timeWindowInterpo
);
}
}
bool
hasNotReturnedResults
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SGroupResInfo
*
pGroupResInfo
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
SFillInfo
*
pFillInfo
=
pRuntimeEnv
->
pFillInfo
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录