Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
58161110
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
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,发现更多精彩内容 >>
未验证
提交
58161110
编写于
6月 08, 2022
作者:
S
shenglian-zhou
提交者:
GitHub
6月 08, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13570 from taosdata/szhou/feature/multiwaymerge
feat: support multi-way sort merge
上级
098be04a
b2d06652
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
166 addition
and
16 deletion
+166
-16
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-1
source/libs/command/inc/commandInt.h
source/libs/command/inc/commandInt.h
+3
-0
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+49
-0
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+1
-1
source/libs/executor/inc/tsort.h
source/libs/executor/inc/tsort.h
+6
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-2
source/libs/executor/src/sortoperator.c
source/libs/executor/src/sortoperator.c
+81
-7
source/libs/executor/src/tsort.c
source/libs/executor/src/tsort.c
+19
-3
source/libs/planner/src/planSpliter.c
source/libs/planner/src/planSpliter.c
+2
-2
tests/script/tsim/query/scalarNull.sim
tests/script/tsim/query/scalarNull.sim
+1
-0
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
58161110
...
...
@@ -1216,7 +1216,7 @@ SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData) {
pBlock
->
info
.
numOfCols
=
numOfCols
;
pBlock
->
info
.
hasVarCol
=
pDataBlock
->
info
.
hasVarCol
;
pBlock
->
info
.
rowSize
=
pDataBlock
->
info
.
row
s
;
pBlock
->
info
.
rowSize
=
pDataBlock
->
info
.
row
Size
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
colInfo
=
{
0
};
...
...
source/libs/command/inc/commandInt.h
浏览文件 @
58161110
...
...
@@ -47,6 +47,9 @@ extern "C" {
#define EXPLAIN_TIME_WINDOWS_FORMAT "Time Window: interval=%" PRId64 "%c offset=%" PRId64 "%c sliding=%" PRId64 "%c"
#define EXPLAIN_WINDOW_FORMAT "Window: gap=%" PRId64
#define EXPLAIN_RATIO_TIME_FORMAT "Ratio: %f"
#define EXPLAIN_MERGE_FORMAT "Merge"
#define EXPLAIN_MERGE_KEYS_FORMAT "Merge Key: "
#define EXPLAIN_PLANNING_TIME_FORMAT "Planning Time: %.3f ms"
#define EXPLAIN_EXEC_TIME_FORMAT "Execution Time: %.3f ms"
...
...
source/libs/command/src/explain.c
浏览文件 @
58161110
...
...
@@ -173,6 +173,11 @@ int32_t qExplainGenerateResChildren(SPhysiNode *pNode, SExplainGroup *group, SNo
pPhysiChildren
=
partitionPhysiNode
->
node
.
pChildren
;
break
;
}
case
QUERY_NODE_PHYSICAL_PLAN_MERGE
:
{
SMergePhysiNode
*
mergePhysiNode
=
(
SMergePhysiNode
*
)
pNode
;
pPhysiChildren
=
mergePhysiNode
->
node
.
pChildren
;
break
;
}
default:
qError
(
"not supported physical node type %d"
,
pNode
->
type
);
QRY_ERR_RET
(
TSDB_CODE_QRY_APP_ERROR
);
...
...
@@ -857,6 +862,50 @@ int32_t qExplainResNodeToRowsImpl(SExplainResNode *pResNode, SExplainCtx *ctx, i
}
break
;
}
case
QUERY_NODE_PHYSICAL_PLAN_MERGE
:
{
SMergePhysiNode
*
pMergeNode
=
(
SMergePhysiNode
*
)
pNode
;
EXPLAIN_ROW_NEW
(
level
,
EXPLAIN_MERGE_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_LEFT_PARENTHESIS_FORMAT
);
if
(
pResNode
->
pExecInfo
)
{
QRY_ERR_RET
(
qExplainBufAppendExecInfo
(
pResNode
->
pExecInfo
,
tbuf
,
&
tlen
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
}
SDataBlockDescNode
*
pDescNode
=
pMergeNode
->
node
.
pOutputDataBlockDesc
;
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
nodesGetOutputNumFromSlotList
(
pDescNode
->
pSlots
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pDescNode
->
totalRowSize
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_RIGHT_PARENTHESIS_FORMAT
);
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
));
if
(
verbose
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_OUTPUT_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_COLUMNS_FORMAT
,
nodesGetOutputNumFromSlotList
(
pMergeNode
->
node
.
pOutputDataBlockDesc
->
pSlots
));
EXPLAIN_ROW_APPEND
(
EXPLAIN_BLANK_FORMAT
);
EXPLAIN_ROW_APPEND
(
EXPLAIN_WIDTH_FORMAT
,
pMergeNode
->
node
.
pOutputDataBlockDesc
->
outputRowSize
);
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_MERGE_KEYS_FORMAT
);
for
(
int32_t
i
=
0
;
i
<
LIST_LENGTH
(
pMergeNode
->
pMergeKeys
);
++
i
)
{
SOrderByExprNode
*
ptn
=
nodesListGetNode
(
pMergeNode
->
pMergeKeys
,
i
);
EXPLAIN_ROW_APPEND
(
"%s "
,
nodesGetNameFromColumnNode
(
ptn
->
pExpr
));
}
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
if
(
pMergeNode
->
node
.
pConditions
)
{
EXPLAIN_ROW_NEW
(
level
+
1
,
EXPLAIN_FILTER_FORMAT
);
QRY_ERR_RET
(
nodesNodeToSQL
(
pMergeNode
->
node
.
pConditions
,
tbuf
+
VARSTR_HEADER_SIZE
,
TSDB_EXPLAIN_RESULT_ROW_SIZE
,
&
tlen
));
EXPLAIN_ROW_END
();
QRY_ERR_RET
(
qExplainResAppendRow
(
ctx
,
tbuf
,
tlen
,
level
+
1
));
}
}
break
;
}
default:
qError
(
"not supported physical node type %d"
,
pNode
->
type
);
return
TSDB_CODE_QRY_APP_ERROR
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
58161110
...
...
@@ -787,7 +787,7 @@ SOperatorInfo* createIndefinitOutputOperatorInfo(SOperatorInfo* downstream, SPhy
SOperatorInfo
*
createProjectOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
num
,
SSDataBlock
*
pResBlock
,
SLimit
*
pLimit
,
SLimit
*
pSlimit
,
SNode
*
pCondition
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createSortOperatorInfo
(
SOperatorInfo
*
downstream
,
SSDataBlock
*
pResBlock
,
SArray
*
pSortInfo
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SArray
*
pIndexMap
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createMultiwaySortMergeOperatorInfo
(
SOperatorInfo
**
downStreams
,
int32_t
numStreams
,
SOperatorInfo
*
createMultiwaySortMergeOperatorInfo
(
SOperatorInfo
**
downStreams
,
int32_t
numStreams
,
SSDataBlock
*
pInputBlock
,
SSDataBlock
*
pResBlock
,
SArray
*
pSortInfo
,
SArray
*
pColMatchColInfo
,
SExecTaskInfo
*
pTaskInfo
);
SOperatorInfo
*
createSortedMergeOperatorInfo
(
SOperatorInfo
**
downstream
,
int32_t
numOfDownstream
,
SExprInfo
*
pExprInfo
,
int32_t
num
,
SArray
*
pSortInfo
,
SArray
*
pGroupInfo
,
SExecTaskInfo
*
pTaskInfo
);
...
...
source/libs/executor/inc/tsort.h
浏览文件 @
58161110
...
...
@@ -130,6 +130,12 @@ bool tsortIsNullVal(STupleHandle* pVHandle, int32_t colId);
*/
void
*
tsortGetValue
(
STupleHandle
*
pVHandle
,
int32_t
colId
);
/**
*
* @param pVHandle
* @return
*/
uint64_t
tsortGetGroupId
(
STupleHandle
*
pVHandle
);
/**
*
* @param pSortHandle
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
58161110
...
...
@@ -4666,8 +4666,9 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
int32_t
numOfOutputCols
=
0
;
SArray
*
pColList
=
extractColMatchInfo
(
pMergePhyNode
->
pTargets
,
pDescNode
,
&
numOfOutputCols
,
pTaskInfo
,
COL_MATCH_FROM_SLOT_ID
);
pOptr
=
createMultiwaySortMergeOperatorInfo
(
ops
,
size
,
pResBlock
,
sortInfo
,
pColList
,
pTaskInfo
);
SPhysiNode
*
pChildNode
=
(
SPhysiNode
*
)
nodesListGetNode
(
pPhyNode
->
pChildren
,
0
);
SSDataBlock
*
pInputDataBlock
=
createResDataBlock
(
pChildNode
->
pOutputDataBlockDesc
);
pOptr
=
createMultiwaySortMergeOperatorInfo
(
ops
,
size
,
pInputDataBlock
,
pResBlock
,
sortInfo
,
pColList
,
pTaskInfo
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_MERGE_SESSION
==
type
)
{
SSessionWinodwPhysiNode
*
pSessionNode
=
(
SSessionWinodwPhysiNode
*
)
pPhyNode
;
...
...
source/libs/executor/src/sortoperator.c
浏览文件 @
58161110
...
...
@@ -84,7 +84,6 @@ void appendOneRowToDataBlock(SSDataBlock* pBlock, STupleHandle* pTupleHandle) {
SSDataBlock
*
getSortedBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SArray
*
pColMatchInfo
)
{
blockDataCleanup
(
pDataBlock
);
ASSERT
(
taosArrayGetSize
(
pColMatchInfo
)
==
pDataBlock
->
info
.
numOfCols
);
SSDataBlock
*
p
=
tsortGetSortedDataBlock
(
pHandle
);
if
(
p
==
NULL
)
{
...
...
@@ -230,7 +229,12 @@ typedef struct SMultiwaySortMergeOperatorInfo {
SSortHandle
*
pSortHandle
;
SArray
*
pColMatchInfo
;
// for index map from table scan output
SSDataBlock
*
pInputBlock
;
int64_t
startTs
;
// sort start time
bool
hasGroupId
;
uint64_t
groupId
;
STupleHandle
*
prefetchedTuple
;
}
SMultiwaySortMergeOperatorInfo
;
int32_t
doOpenMultiwaySortMergeOperator
(
SOperatorInfo
*
pOperator
)
{
...
...
@@ -246,14 +250,14 @@ int32_t doOpenMultiwaySortMergeOperator(SOperatorInfo* pOperator) {
int32_t
numOfBufPage
=
pInfo
->
sortBufSize
/
pInfo
->
bufPageSize
;
pInfo
->
pSortHandle
=
tsortCreateSortHandle
(
pInfo
->
pSortInfo
,
pInfo
->
pColMatchInfo
,
SORT_MULTISOURCE_MERGE
,
pInfo
->
bufPageSize
,
numOfBufPage
,
NULL
,
pTaskInfo
->
id
.
str
);
pInfo
->
bufPageSize
,
numOfBufPage
,
pInfo
->
pInputBlock
,
pTaskInfo
->
id
.
str
);
tsortSetFetchRawDataFp
(
pInfo
->
pSortHandle
,
loadNextDataBlock
,
NULL
,
NULL
);
for
(
int32_t
i
=
0
;
i
<
pOperator
->
numOfDownstream
;
++
i
)
{
SSortSource
ps
=
{
0
}
;
ps
.
param
=
pOperator
->
pDownstream
[
i
];
tsortAddSource
(
pInfo
->
pSortHandle
,
&
ps
);
SSortSource
*
ps
=
taosMemoryCalloc
(
1
,
sizeof
(
SSortSource
))
;
ps
->
param
=
pOperator
->
pDownstream
[
i
];
tsortAddSource
(
pInfo
->
pSortHandle
,
ps
);
}
int32_t
code
=
tsortOpen
(
pInfo
->
pSortHandle
);
...
...
@@ -269,6 +273,70 @@ int32_t doOpenMultiwaySortMergeOperator(SOperatorInfo* pOperator) {
return
TSDB_CODE_SUCCESS
;
}
SSDataBlock
*
getMultiwaySortedBlockData
(
SSortHandle
*
pHandle
,
SSDataBlock
*
pDataBlock
,
int32_t
capacity
,
SArray
*
pColMatchInfo
,
SMultiwaySortMergeOperatorInfo
*
pInfo
)
{
blockDataCleanup
(
pDataBlock
);
SSDataBlock
*
p
=
tsortGetSortedDataBlock
(
pHandle
);
if
(
p
==
NULL
)
{
return
NULL
;
}
blockDataEnsureCapacity
(
p
,
capacity
);
while
(
1
)
{
STupleHandle
*
pTupleHandle
=
NULL
;
if
(
pInfo
->
prefetchedTuple
==
NULL
)
{
pTupleHandle
=
tsortNextTuple
(
pHandle
);
}
else
{
pTupleHandle
=
pInfo
->
prefetchedTuple
;
pInfo
->
prefetchedTuple
=
NULL
;
}
if
(
pTupleHandle
==
NULL
)
{
break
;
}
uint64_t
tupleGroupId
=
tsortGetGroupId
(
pTupleHandle
);
if
(
!
pInfo
->
hasGroupId
)
{
pInfo
->
groupId
=
tupleGroupId
;
pInfo
->
hasGroupId
=
true
;
appendOneRowToDataBlock
(
p
,
pTupleHandle
);
}
else
if
(
pInfo
->
groupId
==
tupleGroupId
)
{
appendOneRowToDataBlock
(
p
,
pTupleHandle
);
}
else
{
pInfo
->
prefetchedTuple
=
pTupleHandle
;
pInfo
->
groupId
=
tupleGroupId
;
break
;
}
if
(
p
->
info
.
rows
>=
capacity
)
{
break
;
}
}
if
(
p
->
info
.
rows
>
0
)
{
int32_t
numOfCols
=
taosArrayGetSize
(
pColMatchInfo
);
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColMatchInfo
*
pmInfo
=
taosArrayGet
(
pColMatchInfo
,
i
);
ASSERT
(
pmInfo
->
matchType
==
COL_MATCH_FROM_SLOT_ID
);
SColumnInfoData
*
pSrc
=
taosArrayGet
(
p
->
pDataBlock
,
pmInfo
->
srcSlotId
);
SColumnInfoData
*
pDst
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
pmInfo
->
targetSlotId
);
colDataAssign
(
pDst
,
pSrc
,
p
->
info
.
rows
);
}
pDataBlock
->
info
.
rows
=
p
->
info
.
rows
;
pDataBlock
->
info
.
capacity
=
p
->
info
.
rows
;
}
blockDataDestroy
(
p
);
return
(
pDataBlock
->
info
.
rows
>
0
)
?
pDataBlock
:
NULL
;
}
SSDataBlock
*
doMultiwaySortMerge
(
SOperatorInfo
*
pOperator
)
{
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
...
...
@@ -283,7 +351,11 @@ SSDataBlock* doMultiwaySortMerge(SOperatorInfo* pOperator) {
}
SSDataBlock
*
pBlock
=
getSortedBlockData
(
pInfo
->
pSortHandle
,
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
,
pInfo
->
pColMatchInfo
);
getMultiwaySortedBlockData
(
pInfo
->
pSortHandle
,
pInfo
->
binfo
.
pRes
,
pOperator
->
resultInfo
.
capacity
,
pInfo
->
pColMatchInfo
,
pInfo
);
if
(
pBlock
!=
NULL
)
{
pOperator
->
resultInfo
.
totalRows
+=
pBlock
->
info
.
rows
;
...
...
@@ -296,6 +368,7 @@ SSDataBlock* doMultiwaySortMerge(SOperatorInfo* pOperator) {
void
destroyMultiwaySortMergeOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SMultiwaySortMergeOperatorInfo
*
pInfo
=
(
SMultiwaySortMergeOperatorInfo
*
)
param
;
pInfo
->
binfo
.
pRes
=
blockDataDestroy
(
pInfo
->
binfo
.
pRes
);
pInfo
->
pInputBlock
=
blockDataDestroy
(
pInfo
->
pInputBlock
);
taosArrayDestroy
(
pInfo
->
pSortInfo
);
taosArrayDestroy
(
pInfo
->
pColMatchInfo
);
...
...
@@ -313,7 +386,7 @@ int32_t getMultiwaySortMergeExplainExecInfo(SOperatorInfo* pOptr, void** pOptrEx
return
TSDB_CODE_SUCCESS
;
}
SOperatorInfo
*
createMultiwaySortMergeOperatorInfo
(
SOperatorInfo
**
downStreams
,
int32_t
numStreams
,
SOperatorInfo
*
createMultiwaySortMergeOperatorInfo
(
SOperatorInfo
**
downStreams
,
int32_t
numStreams
,
SSDataBlock
*
pInputBlock
,
SSDataBlock
*
pResBlock
,
SArray
*
pSortInfo
,
SArray
*
pColMatchColInfo
,
SExecTaskInfo
*
pTaskInfo
)
{
SMultiwaySortMergeOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SMultiwaySortMergeOperatorInfo
));
...
...
@@ -330,6 +403,7 @@ SOperatorInfo* createMultiwaySortMergeOperatorInfo(SOperatorInfo** downStreams,
pInfo
->
pSortInfo
=
pSortInfo
;
pInfo
->
pColMatchInfo
=
pColMatchColInfo
;
pInfo
->
pInputBlock
=
pInputBlock
;
pOperator
->
name
=
"MultiwaySortMerge"
;
pOperator
->
operatorType
=
QUERY_NODE_PHYSICAL_PLAN_MERGE
;
pOperator
->
blocking
=
true
;
...
...
source/libs/executor/src/tsort.c
浏览文件 @
58161110
...
...
@@ -225,6 +225,10 @@ static int32_t sortComparInit(SMsortComparParam* cmpParam, SArray* pSources, int
for
(
int32_t
i
=
0
;
i
<
cmpParam
->
numOfSources
;
++
i
)
{
SSortSource
*
pSource
=
cmpParam
->
pSources
[
i
];
pSource
->
src
.
pBlock
=
pHandle
->
fetchfp
(
pSource
->
param
);
if
(
pSource
->
src
.
pBlock
==
NULL
)
{
pSource
->
src
.
rowIndex
=
-
1
;
++
pHandle
->
numOfCompletedSources
;
}
}
}
...
...
@@ -361,13 +365,21 @@ int32_t msortComparFn(const void *pLeft, const void *pRight, void *param) {
bool
leftNull
=
false
;
if
(
pLeftColInfoData
->
hasNull
)
{
leftNull
=
colDataIsNull
(
pLeftColInfoData
,
pLeftBlock
->
info
.
rows
,
pLeftSource
->
src
.
rowIndex
,
pLeftBlock
->
pBlockAgg
[
pOrder
->
slotId
]);
if
(
pLeftBlock
->
pBlockAgg
==
NULL
)
{
leftNull
=
colDataIsNull_s
(
pLeftColInfoData
,
pLeftSource
->
src
.
rowIndex
);
}
else
{
leftNull
=
colDataIsNull
(
pLeftColInfoData
,
pLeftBlock
->
info
.
rows
,
pLeftSource
->
src
.
rowIndex
,
pLeftBlock
->
pBlockAgg
[
i
]);
}
}
SColumnInfoData
*
pRightColInfoData
=
TARRAY_GET_ELEM
(
pRightBlock
->
pDataBlock
,
pOrder
->
slotId
);
bool
rightNull
=
false
;
if
(
pRightColInfoData
->
hasNull
)
{
rightNull
=
colDataIsNull
(
pRightColInfoData
,
pRightBlock
->
info
.
rows
,
pRightSource
->
src
.
rowIndex
,
pRightBlock
->
pBlockAgg
[
pOrder
->
slotId
]);
if
(
pLeftBlock
->
pBlockAgg
==
NULL
)
{
rightNull
=
colDataIsNull_s
(
pRightColInfoData
,
pRightSource
->
src
.
rowIndex
);
}
else
{
rightNull
=
colDataIsNull
(
pRightColInfoData
,
pRightBlock
->
info
.
rows
,
pRightSource
->
src
.
rowIndex
,
pRightBlock
->
pBlockAgg
[
i
]);
}
}
if
(
leftNull
&&
rightNull
)
{
...
...
@@ -408,7 +420,7 @@ static int32_t doInternalMergeSort(SSortHandle* pHandle) {
pHandle
->
totalElapsed
=
taosGetTimestampUs
()
-
pHandle
->
startTs
;
qDebug
(
"%s %d rounds mergesort required to complete the sort, first-round sorted data size:%"
PRIzu
", sort elapsed:%"
PRId64
", total elapsed:%"
PRId64
,
pHandle
->
idStr
,
(
int32_t
)
(
sortPass
+
1
),
getTotalBufSize
(
pHandle
->
pBuf
)
,
pHandle
->
sortElapsed
,
pHandle
->
totalElapsed
);
pHandle
->
idStr
,
(
int32_t
)
(
sortPass
+
1
),
pHandle
->
pBuf
?
getTotalBufSize
(
pHandle
->
pBuf
)
:
0
,
pHandle
->
sortElapsed
,
pHandle
->
totalElapsed
);
int32_t
numOfRows
=
blockDataGetCapacityInRow
(
pHandle
->
pDataBlock
,
pHandle
->
pageSize
);
blockDataEnsureCapacity
(
pHandle
->
pDataBlock
,
numOfRows
);
...
...
@@ -697,6 +709,10 @@ void* tsortGetValue(STupleHandle* pVHandle, int32_t colIndex) {
return
colDataGetData
(
pColInfo
,
pVHandle
->
rowIndex
);
}
uint64_t
tsortGetGroupId
(
STupleHandle
*
pVHandle
)
{
return
pVHandle
->
pBlock
->
info
.
groupId
;
}
SSortExecInfo
tsortGetSortExecInfo
(
SSortHandle
*
pHandle
)
{
SSortExecInfo
info
=
{
0
};
...
...
source/libs/planner/src/planSpliter.c
浏览文件 @
58161110
...
...
@@ -166,8 +166,8 @@ static bool stbSplNeedSplit(bool streamQuery, SLogicNode* pNode) {
}
return
!
stbSplHasGatherExecFunc
(
pWindow
->
pFuncs
)
&&
stbSplHasMultiTbScan
(
streamQuery
,
pNode
);
}
//
case QUERY_NODE_LOGIC_PLAN_SORT:
//
return stbSplHasMultiTbScan(streamQuery, pNode);
case
QUERY_NODE_LOGIC_PLAN_SORT
:
return
stbSplHasMultiTbScan
(
streamQuery
,
pNode
);
case
QUERY_NODE_LOGIC_PLAN_SCAN
:
return
stbSplIsMultiTbScan
(
streamQuery
,
(
SScanLogicNode
*
)
pNode
);
default:
...
...
tests/script/tsim/query/scalarNull.sim
浏览文件 @
58161110
...
...
@@ -66,6 +66,7 @@ if $rows != 0 then
return -1
endi
sql select * from tb1 where null;
print $rows
if $rows != 0 then
return -1
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录