Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
88c767bc
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
88c767bc
编写于
5月 10, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: problem of parser and planner
上级
6804c6a4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
72 addition
and
59 deletion
+72
-59
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+72
-59
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
88c767bc
...
@@ -203,9 +203,9 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
...
@@ -203,9 +203,9 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
idata
=
{{
0
}};
SColumnInfoData
idata
=
{{
0
}};
SSlotDescNode
*
pDescNode
=
nodesListGetNode
(
pNode
->
pSlots
,
i
);
SSlotDescNode
*
pDescNode
=
nodesListGetNode
(
pNode
->
pSlots
,
i
);
// if (!pDescNode->output) { // todo disable it temporarily
// if (!pDescNode->output) { // todo disable it temporarily
// continue;
// continue;
// }
// }
idata
.
info
.
type
=
pDescNode
->
dataType
.
type
;
idata
.
info
.
type
=
pDescNode
->
dataType
.
type
;
idata
.
info
.
bytes
=
pDescNode
->
dataType
.
bytes
;
idata
.
info
.
bytes
=
pDescNode
->
dataType
.
bytes
;
...
@@ -833,7 +833,8 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
...
@@ -833,7 +833,8 @@ int32_t projectApplyFunctions(SExprInfo* pExpr, SSDataBlock* pResult, SSDataBloc
if
(
pExpr
[
k
].
pExpr
->
nodeType
==
QUERY_NODE_COLUMN
)
{
// it is a project query
if
(
pExpr
[
k
].
pExpr
->
nodeType
==
QUERY_NODE_COLUMN
)
{
// it is a project query
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pResult
->
pDataBlock
,
outputSlotId
);
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pResult
->
pDataBlock
,
outputSlotId
);
if
(
pResult
->
info
.
rows
>
0
&&
!
createNewColModel
)
{
if
(
pResult
->
info
.
rows
>
0
&&
!
createNewColModel
)
{
colDataMergeCol
(
pColInfoData
,
pResult
->
info
.
rows
,
&
pResult
->
info
.
capacity
,
pfCtx
->
input
.
pData
[
0
],
pfCtx
->
input
.
numOfRows
);
colDataMergeCol
(
pColInfoData
,
pResult
->
info
.
rows
,
&
pResult
->
info
.
capacity
,
pfCtx
->
input
.
pData
[
0
],
pfCtx
->
input
.
numOfRows
);
}
else
{
}
else
{
colDataAssign
(
pColInfoData
,
pfCtx
->
input
.
pData
[
0
],
pfCtx
->
input
.
numOfRows
);
colDataAssign
(
pColInfoData
,
pfCtx
->
input
.
pData
[
0
],
pfCtx
->
input
.
numOfRows
);
}
}
...
@@ -1873,7 +1874,7 @@ static void updateTableQueryInfoForReverseScan(STableQueryInfo* pTableQueryInfo)
...
@@ -1873,7 +1874,7 @@ static void updateTableQueryInfoForReverseScan(STableQueryInfo* pTableQueryInfo)
}
}
void
initResultRow
(
SResultRow
*
pResultRow
)
{
void
initResultRow
(
SResultRow
*
pResultRow
)
{
// pResultRow->pEntryInfo = (struct SResultRowEntryInfo*)((char*)pResultRow + sizeof(SResultRow));
// pResultRow->pEntryInfo = (struct SResultRowEntryInfo*)((char*)pResultRow + sizeof(SResultRow));
}
}
/*
/*
...
@@ -1885,7 +1886,8 @@ void initResultRow(SResultRow* pResultRow) {
...
@@ -1885,7 +1886,8 @@ void initResultRow(SResultRow* pResultRow) {
* offset[0] offset[1] offset[2]
* offset[0] offset[1] offset[2]
*/
*/
// TODO refactor: some function move away
// TODO refactor: some function move away
void
setFunctionResultOutput
(
SOptrBasicInfo
*
pInfo
,
SAggSupporter
*
pSup
,
int32_t
stage
,
int32_t
numOfExprs
,
SExecTaskInfo
*
pTaskInfo
)
{
void
setFunctionResultOutput
(
SOptrBasicInfo
*
pInfo
,
SAggSupporter
*
pSup
,
int32_t
stage
,
int32_t
numOfExprs
,
SExecTaskInfo
*
pTaskInfo
)
{
SqlFunctionCtx
*
pCtx
=
pInfo
->
pCtx
;
SqlFunctionCtx
*
pCtx
=
pInfo
->
pCtx
;
SSDataBlock
*
pDataBlock
=
pInfo
->
pRes
;
SSDataBlock
*
pDataBlock
=
pInfo
->
pRes
;
int32_t
*
rowCellInfoOffset
=
pInfo
->
rowCellInfoOffset
;
int32_t
*
rowCellInfoOffset
=
pInfo
->
rowCellInfoOffset
;
...
@@ -2240,7 +2242,8 @@ int32_t doCopyToSDataBlock(SSDataBlock* pBlock, SExprInfo* pExprInfo, SDiskbased
...
@@ -2240,7 +2242,8 @@ int32_t doCopyToSDataBlock(SSDataBlock* pBlock, SExprInfo* pExprInfo, SDiskbased
return
0
;
return
0
;
}
}
void
doBuildResultDatablock
(
SOptrBasicInfo
*
pbInfo
,
SGroupResInfo
*
pGroupResInfo
,
SExprInfo
*
pExprInfo
,
SDiskbasedBuf
*
pBuf
)
{
void
doBuildResultDatablock
(
SOptrBasicInfo
*
pbInfo
,
SGroupResInfo
*
pGroupResInfo
,
SExprInfo
*
pExprInfo
,
SDiskbasedBuf
*
pBuf
)
{
assert
(
pGroupResInfo
->
currentGroup
<=
pGroupResInfo
->
totalGroup
);
assert
(
pGroupResInfo
->
currentGroup
<=
pGroupResInfo
->
totalGroup
);
int32_t
*
rowCellOffset
=
pbInfo
->
rowCellInfoOffset
;
int32_t
*
rowCellOffset
=
pbInfo
->
rowCellInfoOffset
;
...
@@ -2419,7 +2422,8 @@ void queryCostStatis(SExecTaskInfo* pTaskInfo) {
...
@@ -2419,7 +2422,8 @@ void queryCostStatis(SExecTaskInfo* pTaskInfo) {
SFileBlockLoadRecorder
*
pRecorder
=
pSummary
->
pRecoder
;
SFileBlockLoadRecorder
*
pRecorder
=
pSummary
->
pRecoder
;
if
(
pSummary
->
pRecoder
!=
NULL
)
{
if
(
pSummary
->
pRecoder
!=
NULL
)
{
qDebug
(
"%s :cost summary: elapsed time:%"
PRId64
" us, first merge:%"
PRId64
" us, total blocks:%d, "
qDebug
(
"%s :cost summary: elapsed time:%"
PRId64
" us, first merge:%"
PRId64
" us, total blocks:%d, "
"load block statis:%d, load data block:%d, total rows:%"
PRId64
", check rows:%"
PRId64
,
"load block statis:%d, load data block:%d, total rows:%"
PRId64
", check rows:%"
PRId64
,
GET_TASKID
(
pTaskInfo
),
pSummary
->
elapsedTime
,
pSummary
->
firstStageMergeTime
,
pRecorder
->
totalBlocks
,
GET_TASKID
(
pTaskInfo
),
pSummary
->
elapsedTime
,
pSummary
->
firstStageMergeTime
,
pRecorder
->
totalBlocks
,
pRecorder
->
loadBlockStatis
,
pRecorder
->
loadBlocks
,
pRecorder
->
totalRows
,
pRecorder
->
totalCheckedRows
);
pRecorder
->
loadBlockStatis
,
pRecorder
->
loadBlocks
,
pRecorder
->
totalRows
,
pRecorder
->
totalCheckedRows
);
...
@@ -2954,7 +2958,7 @@ int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadI
...
@@ -2954,7 +2958,7 @@ int32_t setSDataBlockFromFetchRsp(SSDataBlock* pRes, SLoadRemoteDataInfo* pLoadI
relocateColumnData
(
pRes
,
pColList
,
pBlock
->
pDataBlock
);
relocateColumnData
(
pRes
,
pColList
,
pBlock
->
pDataBlock
);
taosArrayDestroy
(
pBlock
->
pDataBlock
);
taosArrayDestroy
(
pBlock
->
pDataBlock
);
taosMemoryFree
(
pBlock
);
taosMemoryFree
(
pBlock
);
// blockDataDestroy(pBlock);
// blockDataDestroy(pBlock);
}
}
pRes
->
info
.
rows
=
numOfRows
;
pRes
->
info
.
rows
=
numOfRows
;
...
@@ -4100,7 +4104,7 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) {
...
@@ -4100,7 +4104,7 @@ static SSDataBlock* doFill(SOperatorInfo* pOperator) {
// todo handle different group data interpolation
// todo handle different group data interpolation
bool
n
=
false
;
bool
n
=
false
;
bool
*
newgroup
=
&
n
;
bool
*
newgroup
=
&
n
;
doHandleRemainBlockFromNewGroup
(
pInfo
,
pResultInfo
,
newgroup
,
pTaskInfo
);
doHandleRemainBlockFromNewGroup
(
pInfo
,
pResultInfo
,
newgroup
,
pTaskInfo
);
if
(
pResBlock
->
info
.
rows
>
pResultInfo
->
threshold
||
(
!
pInfo
->
multigroupResult
&&
pResBlock
->
info
.
rows
>
0
))
{
if
(
pResBlock
->
info
.
rows
>
pResultInfo
->
threshold
||
(
!
pInfo
->
multigroupResult
&&
pResBlock
->
info
.
rows
>
0
))
{
return
pResBlock
;
return
pResBlock
;
...
@@ -4224,7 +4228,7 @@ int32_t doInitAggInfoSup(SAggSupporter* pAggSup, SqlFunctionCtx* pCtx, int32_t n
...
@@ -4224,7 +4228,7 @@ int32_t doInitAggInfoSup(SAggSupporter* pAggSup, SqlFunctionCtx* pCtx, int32_t n
}
}
uint32_t
defaultPgsz
=
4096
;
uint32_t
defaultPgsz
=
4096
;
while
(
defaultPgsz
<
pAggSup
->
resultRowSize
*
4
)
{
while
(
defaultPgsz
<
pAggSup
->
resultRowSize
*
4
)
{
defaultPgsz
<<=
1u
;
defaultPgsz
<<=
1u
;
}
}
...
@@ -4375,7 +4379,7 @@ void destroyBasicOperatorInfo(void* param, int32_t numOfOutput) {
...
@@ -4375,7 +4379,7 @@ void destroyBasicOperatorInfo(void* param, int32_t numOfOutput) {
}
}
void
destroyMergeJoinOperator
(
void
*
param
,
int32_t
numOfOutput
)
{
void
destroyMergeJoinOperator
(
void
*
param
,
int32_t
numOfOutput
)
{
SJoinOperatorInfo
*
pJoinOperator
=
(
SJoinOperatorInfo
*
)
param
;
SJoinOperatorInfo
*
pJoinOperator
=
(
SJoinOperatorInfo
*
)
param
;
}
}
void
destroyAggOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
void
destroyAggOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
...
@@ -4487,8 +4491,9 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t
...
@@ -4487,8 +4491,9 @@ static int32_t initFillInfo(SFillOperatorInfo* pInfo, SExprInfo* pExpr, int32_t
}
}
SOperatorInfo
*
createFillOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExpr
,
int32_t
numOfCols
,
SOperatorInfo
*
createFillOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExpr
,
int32_t
numOfCols
,
SInterval
*
pInterval
,
STimeWindow
*
pWindow
,
SSDataBlock
*
pResBlock
,
int32_t
fillType
,
SNodeListNode
*
pValueNode
,
SInterval
*
pInterval
,
STimeWindow
*
pWindow
,
SSDataBlock
*
pResBlock
,
bool
multigroupResult
,
SExecTaskInfo
*
pTaskInfo
)
{
int32_t
fillType
,
SNodeListNode
*
pValueNode
,
bool
multigroupResult
,
SExecTaskInfo
*
pTaskInfo
)
{
SFillOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SFillOperatorInfo
));
SFillOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SFillOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
SOperatorInfo
*
pOperator
=
taosMemoryCalloc
(
1
,
sizeof
(
SOperatorInfo
));
...
@@ -4522,8 +4527,8 @@ SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExp
...
@@ -4522,8 +4527,8 @@ SOperatorInfo* createFillOperatorInfo(SOperatorInfo* downstream, SExprInfo* pExp
SResultInfo
*
pResultInfo
=
&
pOperator
->
resultInfo
;
SResultInfo
*
pResultInfo
=
&
pOperator
->
resultInfo
;
initResultSizeInfo
(
pOperator
,
4096
);
initResultSizeInfo
(
pOperator
,
4096
);
int32_t
code
=
initFillInfo
(
pInfo
,
pExpr
,
numOfCols
,
pValueNode
,
*
pWindow
,
pResultInfo
->
capacity
,
int32_t
code
=
initFillInfo
(
pInfo
,
pExpr
,
numOfCols
,
pValueNode
,
*
pWindow
,
pResultInfo
->
capacity
,
pTaskInfo
->
id
.
str
,
p
TaskInfo
->
id
.
str
,
p
Interval
,
type
);
pInterval
,
type
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
goto
_error
;
goto
_error
;
}
}
...
@@ -4736,7 +4741,8 @@ static int32_t doCreateTableGroup(void* metaHandle, int32_t tableType, uint64_t
...
@@ -4736,7 +4741,8 @@ static int32_t doCreateTableGroup(void* metaHandle, int32_t tableType, uint64_t
uint64_t
queryId
,
uint64_t
taskId
);
uint64_t
queryId
,
uint64_t
taskId
);
static
SArray
*
extractTableIdList
(
const
STableGroupInfo
*
pTableGroupInfo
);
static
SArray
*
extractTableIdList
(
const
STableGroupInfo
*
pTableGroupInfo
);
static
SArray
*
extractColumnInfo
(
SNodeList
*
pNodeList
);
static
SArray
*
extractColumnInfo
(
SNodeList
*
pNodeList
);
static
SArray
*
extractColMatchInfo
(
SNodeList
*
pNodeList
,
SDataBlockDescNode
*
pOutputNodeList
,
int32_t
*
numOfOutputCols
,
int32_t
type
);
static
SArray
*
extractColMatchInfo
(
SNodeList
*
pNodeList
,
SDataBlockDescNode
*
pOutputNodeList
,
int32_t
*
numOfOutputCols
,
int32_t
type
);
static
SArray
*
createSortInfo
(
SNodeList
*
pNodeList
);
static
SArray
*
createSortInfo
(
SNodeList
*
pNodeList
);
static
SArray
*
extractPartitionColInfo
(
SNodeList
*
pNodeList
);
static
SArray
*
extractPartitionColInfo
(
SNodeList
*
pNodeList
);
...
@@ -4782,9 +4788,9 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4782,9 +4788,9 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
}
SInterval
interval
=
extractIntervalInfo
(
pTableScanNode
);
SInterval
interval
=
extractIntervalInfo
(
pTableScanNode
);
SOperatorInfo
*
pOperator
=
createTableScanOperatorInfo
(
pDataReader
,
&
cond
,
numOfCols
,
pTableScanNode
->
dataRequired
,
SOperatorInfo
*
pOperator
=
createTableScanOperatorInfo
(
pTableScanNode
->
scanSeq
,
pColList
,
pResBlock
,
pScanPhyNode
->
node
.
pConditions
,
pDataReader
,
&
cond
,
numOfCols
,
pTableScanNode
->
dataRequired
,
pTableScanNode
->
scanSeq
,
pColList
,
pResBlock
,
&
interval
,
pTableScanNode
->
ratio
,
pTaskInfo
);
pScanPhyNode
->
node
.
pConditions
,
&
interval
,
pTableScanNode
->
ratio
,
pTaskInfo
);
STableScanInfo
*
pScanInfo
=
pOperator
->
info
;
STableScanInfo
*
pScanInfo
=
pOperator
->
info
;
pTaskInfo
->
cost
.
pRecoder
=
&
pScanInfo
->
readRecorder
;
pTaskInfo
->
cost
.
pRecoder
=
&
pScanInfo
->
readRecorder
;
return
pOperator
;
return
pOperator
;
...
@@ -4795,7 +4801,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4795,7 +4801,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
==
type
)
{
SScanPhysiNode
*
pScanPhyNode
=
(
SScanPhysiNode
*
)
pPhyNode
;
// simple child table.
SScanPhysiNode
*
pScanPhyNode
=
(
SScanPhysiNode
*
)
pPhyNode
;
// simple child table.
int32_t
code
=
doCreateTableGroup
(
pHandle
->
meta
,
pScanPhyNode
->
tableType
,
pScanPhyNode
->
uid
,
pTableGroupInfo
,
queryId
,
taskId
);
int32_t
code
=
doCreateTableGroup
(
pHandle
->
meta
,
pScanPhyNode
->
tableType
,
pScanPhyNode
->
uid
,
pTableGroupInfo
,
queryId
,
taskId
);
SArray
*
tableIdList
=
extractTableIdList
(
pTableGroupInfo
);
SArray
*
tableIdList
=
extractTableIdList
(
pTableGroupInfo
);
SDataBlockDescNode
*
pDescNode
=
pScanPhyNode
->
node
.
pOutputDataBlockDesc
;
SDataBlockDescNode
*
pDescNode
=
pScanPhyNode
->
node
.
pOutputDataBlockDesc
;
...
@@ -4822,14 +4829,14 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4822,14 +4829,14 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pTaskInfo
,
pSysScanPhyNode
->
showRewrite
,
pSysScanPhyNode
->
accountId
);
pTaskInfo
,
pSysScanPhyNode
->
showRewrite
,
pSysScanPhyNode
->
accountId
);
return
pOperator
;
return
pOperator
;
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN
==
type
)
{
STagScanPhysiNode
*
pScanPhyNode
=
(
STagScanPhysiNode
*
)
pPhyNode
;
STagScanPhysiNode
*
pScanPhyNode
=
(
STagScanPhysiNode
*
)
pPhyNode
;
SDataBlockDescNode
*
pDescNode
=
pScanPhyNode
->
node
.
pOutputDataBlockDesc
;
SDataBlockDescNode
*
pDescNode
=
pScanPhyNode
->
node
.
pOutputDataBlockDesc
;
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pDescNode
);
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pDescNode
);
int32_t
code
=
int32_t
code
=
doCreateTableGroup
(
pHandle
->
meta
,
pScanPhyNode
->
tableType
,
pScanPhyNode
->
uid
,
pTableGroupInfo
,
doCreateTableGroup
(
pHandle
->
meta
,
pScanPhyNode
->
tableType
,
pScanPhyNode
->
uid
,
pTableGroupInfo
,
queryId
,
taskId
);
queryId
,
taskId
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
return
NULL
;
}
}
...
@@ -4838,9 +4845,11 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4838,9 +4845,11 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
SExprInfo
*
pExprInfo
=
createExprInfo
(
pScanPhyNode
->
pScanPseudoCols
,
NULL
,
&
num
);
SExprInfo
*
pExprInfo
=
createExprInfo
(
pScanPhyNode
->
pScanPseudoCols
,
NULL
,
&
num
);
int32_t
numOfOutputCols
=
0
;
int32_t
numOfOutputCols
=
0
;
SArray
*
colList
=
extractColMatchInfo
(
pScanPhyNode
->
pScanPseudoCols
,
pDescNode
,
&
numOfOutputCols
,
COL_MATCH_FROM_COL_ID
);
SArray
*
colList
=
extractColMatchInfo
(
pScanPhyNode
->
pScanPseudoCols
,
pDescNode
,
&
numOfOutputCols
,
COL_MATCH_FROM_COL_ID
);
SOperatorInfo
*
pOperator
=
createTagScanOperatorInfo
(
pHandle
,
pExprInfo
,
num
,
pResBlock
,
colList
,
pTableGroupInfo
,
pTaskInfo
);
SOperatorInfo
*
pOperator
=
createTagScanOperatorInfo
(
pHandle
,
pExprInfo
,
num
,
pResBlock
,
colList
,
pTableGroupInfo
,
pTaskInfo
);
return
pOperator
;
return
pOperator
;
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
...
@@ -4887,7 +4896,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4887,7 +4896,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
pOptr
=
createAggregateOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
pScalarExprInfo
,
numOfScalarExpr
,
pOptr
=
createAggregateOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
pScalarExprInfo
,
numOfScalarExpr
,
pTaskInfo
,
pTableGroupInfo
);
pTaskInfo
,
pTableGroupInfo
);
}
}
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_INTERVAL
==
type
||
QUERY_NODE_PHYSICAL_PLAN_STREAM_INTERVAL
==
type
)
{
SIntervalPhysiNode
*
pIntervalPhyNode
=
(
SIntervalPhysiNode
*
)
pPhyNode
;
SIntervalPhysiNode
*
pIntervalPhyNode
=
(
SIntervalPhysiNode
*
)
pPhyNode
;
SExprInfo
*
pExprInfo
=
createExprInfo
(
pIntervalPhyNode
->
window
.
pFuncs
,
NULL
,
&
num
);
SExprInfo
*
pExprInfo
=
createExprInfo
(
pIntervalPhyNode
->
window
.
pFuncs
,
NULL
,
&
num
);
...
@@ -4925,13 +4934,15 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4925,13 +4934,15 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_SESSION_WINDOW
==
type
)
{
SSessionWinodwPhysiNode
*
pSessionNode
=
(
SSessionWinodwPhysiNode
*
)
pPhyNode
;
SSessionWinodwPhysiNode
*
pSessionNode
=
(
SSessionWinodwPhysiNode
*
)
pPhyNode
;
STimeWindowAggSupp
as
=
{.
waterMark
=
pSessionNode
->
window
.
watermark
,
.
calTrigger
=
pSessionNode
->
window
.
triggerType
};
STimeWindowAggSupp
as
=
{.
waterMark
=
pSessionNode
->
window
.
watermark
,
.
calTrigger
=
pSessionNode
->
window
.
triggerType
};
SExprInfo
*
pExprInfo
=
createExprInfo
(
pSessionNode
->
window
.
pFuncs
,
NULL
,
&
num
);
SExprInfo
*
pExprInfo
=
createExprInfo
(
pSessionNode
->
window
.
pFuncs
,
NULL
,
&
num
);
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pPhyNode
->
pOutputDataBlockDesc
);
SSDataBlock
*
pResBlock
=
createResDataBlock
(
pPhyNode
->
pOutputDataBlockDesc
);
int32_t
tsSlotId
=
((
SColumnNode
*
)
pSessionNode
->
window
.
pTspk
)
->
slotId
;
int32_t
tsSlotId
=
((
SColumnNode
*
)
pSessionNode
->
window
.
pTspk
)
->
slotId
;
pOptr
=
createSessionAggOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
pSessionNode
->
gap
,
tsSlotId
,
&
as
,
pTaskInfo
);
pOptr
=
createSessionAggOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
pSessionNode
->
gap
,
tsSlotId
,
&
as
,
pTaskInfo
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_PARTITION
==
type
)
{
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_PARTITION
==
type
)
{
SPartitionPhysiNode
*
pPartNode
=
(
SPartitionPhysiNode
*
)
pPhyNode
;
SPartitionPhysiNode
*
pPartNode
=
(
SPartitionPhysiNode
*
)
pPhyNode
;
SArray
*
pColList
=
extractPartitionColInfo
(
pPartNode
->
pPartitionKeys
);
SArray
*
pColList
=
extractPartitionColInfo
(
pPartNode
->
pPartitionKeys
);
...
@@ -4961,7 +4972,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
...
@@ -4961,7 +4972,8 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
SExprInfo
*
pExprInfo
=
createExprInfo
(
pFillNode
->
pTargets
,
NULL
,
&
num
);
SExprInfo
*
pExprInfo
=
createExprInfo
(
pFillNode
->
pTargets
,
NULL
,
&
num
);
SInterval
*
pInterval
=
&
((
SIntervalAggOperatorInfo
*
)
ops
[
0
]
->
info
)
->
interval
;
SInterval
*
pInterval
=
&
((
SIntervalAggOperatorInfo
*
)
ops
[
0
]
->
info
)
->
interval
;
pOptr
=
createFillOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pInterval
,
&
pFillNode
->
timeRange
,
pResBlock
,
pFillNode
->
mode
,
(
SNodeListNode
*
)
pFillNode
->
pValues
,
false
,
pTaskInfo
);
pOptr
=
createFillOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pInterval
,
&
pFillNode
->
timeRange
,
pResBlock
,
pFillNode
->
mode
,
(
SNodeListNode
*
)
pFillNode
->
pValues
,
false
,
pTaskInfo
);
}
else
{
}
else
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
...
@@ -5101,7 +5113,8 @@ SArray* createSortInfo(SNodeList* pNodeList) {
...
@@ -5101,7 +5113,8 @@ SArray* createSortInfo(SNodeList* pNodeList) {
return
pList
;
return
pList
;
}
}
SArray
*
extractColMatchInfo
(
SNodeList
*
pNodeList
,
SDataBlockDescNode
*
pOutputNodeList
,
int32_t
*
numOfOutputCols
,
int32_t
type
)
{
SArray
*
extractColMatchInfo
(
SNodeList
*
pNodeList
,
SDataBlockDescNode
*
pOutputNodeList
,
int32_t
*
numOfOutputCols
,
int32_t
type
)
{
size_t
numOfCols
=
LIST_LENGTH
(
pNodeList
);
size_t
numOfCols
=
LIST_LENGTH
(
pNodeList
);
SArray
*
pList
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColMatchInfo
));
SArray
*
pList
=
taosArrayInit
(
numOfCols
,
sizeof
(
SColMatchInfo
));
if
(
pList
==
NULL
)
{
if
(
pList
==
NULL
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录