TDengine/source/libs/executor/inc/dynqueryctrl.h

88 lines
2.2 KiB
C
Raw Normal View History

2023-07-03 11:29:46 +00:00
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TDENGINE_DYNQUERYCTRL_H
#define TDENGINE_DYNQUERYCTRL_H
#ifdef __cplusplus
extern "C" {
#endif
2023-07-06 11:33:31 +00:00
typedef struct SDynQueryCtrlExecInfo {
int64_t prevBlkNum;
int64_t prevBlkRows;
int64_t postBlkNum;
int64_t postBlkRows;
2023-07-28 10:00:33 +00:00
int64_t leftCacheNum;
int64_t rightCacheNum;
2023-07-06 11:33:31 +00:00
} SDynQueryCtrlExecInfo;
2023-07-18 06:44:53 +00:00
typedef struct SStbJoinTableList {
void *pNext;
int64_t uidNum;
int64_t readIdx;
int32_t *pLeftVg;
int64_t *pLeftUid;
int32_t *pRightVg;
int64_t *pRightUid;
} SStbJoinTableList;
2023-07-05 03:07:08 +00:00
typedef struct SStbJoinPrevJoinCtx {
2023-07-18 06:44:53 +00:00
bool joinBuild;
2023-07-26 11:17:59 +00:00
SSHashObj* leftHash;
SSHashObj* rightHash;
2023-07-28 10:00:33 +00:00
SSHashObj* leftCache;
SSHashObj* rightCache;
2023-07-26 11:17:59 +00:00
SSHashObj* onceTable;
2023-07-18 06:44:53 +00:00
int64_t tableNum;
SStbJoinTableList* pListHead;
2023-08-07 11:35:33 +00:00
SStbJoinTableList* pListTail;
2023-07-05 03:07:08 +00:00
} SStbJoinPrevJoinCtx;
typedef struct SStbJoinPostJoinCtx {
2023-07-26 11:17:59 +00:00
bool isStarted;
2023-07-28 10:00:33 +00:00
bool leftNeedCache;
bool rightNeedCache;
int32_t leftVgId;
int32_t rightVgId;
int64_t leftCurrUid;
2023-07-26 11:17:59 +00:00
int64_t rightCurrUid;
int64_t rightNextUid;
2023-07-05 03:07:08 +00:00
} SStbJoinPostJoinCtx;
typedef struct SStbJoinDynCtrlCtx {
SStbJoinPrevJoinCtx prev;
SStbJoinPostJoinCtx post;
} SStbJoinDynCtrlCtx;
typedef struct SStbJoinDynCtrlInfo {
2023-07-28 10:00:33 +00:00
SDynQueryCtrlExecInfo execInfo;
SStbJoinDynCtrlBasic basic;
SStbJoinDynCtrlCtx ctx;
2023-08-17 05:50:26 +00:00
int16_t outputBlkId;
2023-07-05 03:07:08 +00:00
} SStbJoinDynCtrlInfo;
2023-07-03 11:29:46 +00:00
typedef struct SDynQueryCtrlOperatorInfo {
2023-07-06 11:33:31 +00:00
EDynQueryType qType;
2023-07-05 03:07:08 +00:00
union {
SStbJoinDynCtrlInfo stbJoin;
};
2023-07-03 11:29:46 +00:00
} SDynQueryCtrlOperatorInfo;
#ifdef __cplusplus
}
#endif
#endif // TDENGINE_DYNQUERYCTRL_H