fix:modify parameter type
This commit is contained in:
parent
85eba36190
commit
4c6702ab73
|
@ -852,6 +852,8 @@ int32_t releaseOutputBuf(SStreamState* pState, SWinKey* pKey, SResultRow* pResul
|
||||||
int32_t saveOutputBuf(SStreamState* pState, SWinKey* pKey, SResultRow* pResult, int32_t resSize);
|
int32_t saveOutputBuf(SStreamState* pState, SWinKey* pKey, SResultRow* pResult, int32_t resSize);
|
||||||
void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order);
|
void getNextIntervalWindow(SInterval* pInterval, STimeWindow* tw, int32_t order);
|
||||||
int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo);
|
int32_t qAppendTaskStopInfo(SExecTaskInfo* pTaskInfo, SExchangeOpStopInfo* pInfo);
|
||||||
|
int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey, int32_t pos,
|
||||||
|
int32_t order, int64_t* pData);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,8 +119,8 @@ static void doKeepNewWindowStartInfo(SWindowRowsSup* pRowSup, const int64_t* tsL
|
||||||
pRowSup->groupId = groupId;
|
pRowSup->groupId = groupId;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FORCE_INLINE int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey,
|
FORCE_INLINE int32_t getForwardStepsInBlock(int32_t numOfRows, __block_search_fn_t searchFn, TSKEY ekey,
|
||||||
int16_t pos, int16_t order, int64_t* pData) {
|
int32_t pos, int32_t order, int64_t* pData) {
|
||||||
int32_t forwardRows = 0;
|
int32_t forwardRows = 0;
|
||||||
|
|
||||||
if (order == TSDB_ORDER_ASC) {
|
if (order == TSDB_ORDER_ASC) {
|
||||||
|
|
|
@ -43,6 +43,19 @@ enum {
|
||||||
data_desc = 0x3,
|
data_desc = 0x3,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TEST(testCase, windowFunctionTest) {
|
||||||
|
int64_t tsCol[100000];
|
||||||
|
int32_t rows = 100000;
|
||||||
|
for (int32_t i = 0; i < rows; i++) {
|
||||||
|
tsCol[i] = 1648791213000 + i;
|
||||||
|
}
|
||||||
|
int32_t ekeyNum = 50000;
|
||||||
|
int32_t pos = 40000;
|
||||||
|
int64_t ekey = tsCol[ekeyNum];
|
||||||
|
int32_t num = getForwardStepsInBlock(rows, binarySearchForKey, ekey, pos, TSDB_ORDER_ASC, tsCol);
|
||||||
|
ASSERT_EQ(num, ekeyNum - pos + 1);
|
||||||
|
}
|
||||||
|
|
||||||
typedef struct SDummyInputInfo {
|
typedef struct SDummyInputInfo {
|
||||||
int32_t totalPages; // numOfPages
|
int32_t totalPages; // numOfPages
|
||||||
int32_t current;
|
int32_t current;
|
||||||
|
|
Loading…
Reference in New Issue