fix: merge join ignore param issue
This commit is contained in:
parent
38be8f2a8e
commit
8b62c75c26
|
@ -147,6 +147,7 @@ typedef struct SLimitInfo {
|
|||
} SLimitInfo;
|
||||
|
||||
typedef struct SSortMergeJoinOperatorParam {
|
||||
bool initParam;
|
||||
} SSortMergeJoinOperatorParam;
|
||||
|
||||
typedef struct SExchangeOperatorBasicParam {
|
||||
|
|
|
@ -36,7 +36,7 @@ void freeVgTableList(void* ptr) {
|
|||
|
||||
static void destroyDynQueryCtrlOperator(void* param) {
|
||||
SDynQueryCtrlOperatorInfo* pDyn = (SDynQueryCtrlOperatorInfo*)param;
|
||||
qDebug("dynQueryCtrl exec info, prevBlk:%" PRId64 ", prevRows:%" PRId64 ", postBlk:%" PRId64 ", postRows:%" PRId64,
|
||||
qError("dynQueryCtrl exec info, prevBlk:%" PRId64 ", prevRows:%" PRId64 ", postBlk:%" PRId64 ", postRows:%" PRId64,
|
||||
pDyn->execInfo.prevBlkNum, pDyn->execInfo.prevBlkRows, pDyn->execInfo.postBlkNum, pDyn->execInfo.postBlkRows);
|
||||
|
||||
if (pDyn->stbJoin.ctx.prev.leftVg) {
|
||||
|
@ -158,7 +158,7 @@ static FORCE_INLINE int32_t buildBatchExchangeOperatorParam(SOperatorParam** ppR
|
|||
}
|
||||
|
||||
|
||||
static FORCE_INLINE int32_t buildMergeJoinOperatorParam(SOperatorParam** ppRes, SOperatorParam* pChild0, SOperatorParam* pChild1) {
|
||||
static FORCE_INLINE int32_t buildMergeJoinOperatorParam(SOperatorParam** ppRes, bool initParam, SOperatorParam* pChild0, SOperatorParam* pChild1) {
|
||||
*ppRes = taosMemoryMalloc(sizeof(SOperatorParam));
|
||||
if (NULL == *ppRes) {
|
||||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
|
@ -179,6 +179,8 @@ static FORCE_INLINE int32_t buildMergeJoinOperatorParam(SOperatorParam** ppRes,
|
|||
return TSDB_CODE_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
pJoin->initParam = initParam;
|
||||
|
||||
(*ppRes)->opType = QUERY_NODE_PHYSICAL_PLAN_MERGE_JOIN;
|
||||
(*ppRes)->value = pJoin;
|
||||
|
||||
|
@ -214,7 +216,7 @@ static int32_t buildSeqStbJoinOperatorParam(SDynQueryCtrlOperatorInfo* pInfo, SS
|
|||
code = buildGroupCacheOperatorParam(&pGcParam1, 1, *rightVg, *rightUid, pExcParam1);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = buildMergeJoinOperatorParam(ppParam, pGcParam0, pGcParam1);
|
||||
code = buildMergeJoinOperatorParam(ppParam, false, pGcParam0, pGcParam1);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
@ -254,7 +256,7 @@ static int32_t buildSeqBatchStbJoinOperatorParam(SDynQueryCtrlOperatorInfo* pInf
|
|||
code = buildGroupCacheOperatorParam(&pGcParam1, 1, *rightVg, *rightUid, pExcParam1);
|
||||
}
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
code = buildMergeJoinOperatorParam(ppParam, pGcParam0, pGcParam1);
|
||||
code = buildMergeJoinOperatorParam(ppParam, pExcParam0 ? true : false, pGcParam0, pGcParam1);
|
||||
}
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -650,6 +650,7 @@ static void setMergeJoinDone(SOperatorInfo* pOperator) {
|
|||
|
||||
static bool mergeJoinGetNextTimestamp(SOperatorInfo* pOperator, int64_t* pLeftTs, int64_t* pRightTs) {
|
||||
SMJoinOperatorInfo* pJoinInfo = pOperator->info;
|
||||
bool leftEmpty = false;
|
||||
|
||||
if (pJoinInfo->pLeft == NULL || pJoinInfo->leftPos >= pJoinInfo->pLeft->info.rows) {
|
||||
pJoinInfo->pLeft = getNextBlockFromDownstream(pOperator, 0);
|
||||
|
@ -658,7 +659,11 @@ static bool mergeJoinGetNextTimestamp(SOperatorInfo* pOperator, int64_t* pLeftTs
|
|||
if (pJoinInfo->pLeft == NULL) {
|
||||
qError("merge join left got empty block");
|
||||
setMergeJoinDone(pOperator);
|
||||
return false;
|
||||
if (pOperator->pOperatorParam && ((SSortMergeJoinOperatorParam*)pOperator->pOperatorParam->value)->initParam) {
|
||||
leftEmpty = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
qError("merge join left got block");
|
||||
}
|
||||
|
@ -674,8 +679,12 @@ static bool mergeJoinGetNextTimestamp(SOperatorInfo* pOperator, int64_t* pLeftTs
|
|||
return false;
|
||||
} else {
|
||||
qError("merge join right got block");
|
||||
if (leftEmpty) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// only the timestamp match support for ordinary table
|
||||
SColumnInfoData* pLeftCol = taosArrayGet(pJoinInfo->pLeft->pDataBlock, pJoinInfo->leftCol.slotId);
|
||||
char* pLeftVal = colDataGetData(pLeftCol, pJoinInfo->leftPos);
|
||||
|
|
Loading…
Reference in New Issue