modify test case
This commit is contained in:
parent
865a13c1c2
commit
f72c983792
|
@ -409,7 +409,7 @@ int32_t blockDataSplitRows(SSDataBlock* pBlock, bool hasVarCol, int32_t startInd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size > pageSize) {
|
if (size > pageSize) { // pageSize must be able to hold one row
|
||||||
*stopIndex = j - 1;
|
*stopIndex = j - 1;
|
||||||
ASSERT(*stopIndex >= startIndex);
|
ASSERT(*stopIndex >= startIndex);
|
||||||
|
|
||||||
|
|
|
@ -6155,7 +6155,7 @@ SOperatorInfo* createSortOperatorInfo(SOperatorInfo* downstream, SSDataBlock* pR
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pInfo->bufPageSize = rowSize < 1024 ? 1024 : rowSize*2;
|
pInfo->bufPageSize = rowSize < 1024 ? 1024*2 : rowSize*2; // there are headers, so pageSize = rowSize + header
|
||||||
|
|
||||||
pInfo->sortBufSize = pInfo->bufPageSize * 16; // TODO dynamic set the available sort buffer
|
pInfo->sortBufSize = pInfo->bufPageSize * 16; // TODO dynamic set the available sort buffer
|
||||||
pInfo->numOfRowsInRes = 1024;
|
pInfo->numOfRowsInRes = 1024;
|
||||||
|
|
|
@ -287,7 +287,13 @@ TEST(testCase, external_mem_sort_Test) {
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++){
|
for (int i = 0; i < 8; i++){
|
||||||
SBlockOrderInfo oi = {0};
|
SBlockOrderInfo oi = {0};
|
||||||
|
|
||||||
|
if(pInfo[i].type == TSDB_DATA_TYPE_NCHAR){
|
||||||
|
oi.order = TSDB_ORDER_DESC;
|
||||||
|
}else{
|
||||||
oi.order = TSDB_ORDER_ASC;
|
oi.order = TSDB_ORDER_ASC;
|
||||||
|
}
|
||||||
|
|
||||||
oi.slotId = 0;
|
oi.slotId = 0;
|
||||||
SArray* orderInfo = taosArrayInit(1, sizeof(SBlockOrderInfo));
|
SArray* orderInfo = taosArrayInit(1, sizeof(SBlockOrderInfo));
|
||||||
taosArrayPush(orderInfo, &oi);
|
taosArrayPush(orderInfo, &oi);
|
||||||
|
@ -363,15 +369,16 @@ TEST(testCase, ordered_merge_sort_Test) {
|
||||||
tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock);
|
tsortSetFetchRawDataFp(phandle, getSingleColDummyBlock);
|
||||||
tsortSetComparFp(phandle, docomp);
|
tsortSetComparFp(phandle, docomp);
|
||||||
|
|
||||||
|
SGenericSource* p = static_cast<SGenericSource*>(taosMemoryCalloc(10, sizeof(SGenericSource)));
|
||||||
|
_info* c = static_cast<_info*>(taosMemoryCalloc(10, sizeof(_info)));
|
||||||
for(int32_t i = 0; i < 10; ++i) {
|
for(int32_t i = 0; i < 10; ++i) {
|
||||||
SGenericSource* p = static_cast<SGenericSource*>(taosMemoryCalloc(1, sizeof(SGenericSource)));
|
c[i].count = 1;
|
||||||
_info* c = static_cast<_info*>(taosMemoryCalloc(1, sizeof(_info)));
|
c[i].pageRows = 1000;
|
||||||
c->count = 1;
|
c[i].startVal = i*1000;
|
||||||
c->pageRows = 1000;
|
c[i].type = TSDB_DATA_TYPE_INT;
|
||||||
c->startVal = i*1000;
|
|
||||||
|
|
||||||
p->param = c;
|
p[i].param = c;
|
||||||
tsortAddSource(phandle, p);
|
tsortAddSource(phandle, &p[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t code = tsortOpen(phandle);
|
int32_t code = tsortOpen(phandle);
|
||||||
|
@ -388,8 +395,10 @@ TEST(testCase, ordered_merge_sort_Test) {
|
||||||
ASSERT_EQ(row++, *(int32_t*) v);
|
ASSERT_EQ(row++, *(int32_t*) v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
taosMemoryFree(p);
|
||||||
|
taosMemoryFree(c);
|
||||||
tsortDestroySortHandle(phandle);
|
tsortDestroySortHandle(phandle);
|
||||||
taosMemoryFree(pBlock);
|
blockDataDestroy(pBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue