Merge pull request #11549 from taosdata/feature/3.0_wxy
enh: set appropriate block loading options for some queries
This commit is contained in:
commit
43f500ba4d
|
@ -56,6 +56,20 @@ typedef enum ECondAction {
|
|||
// after supporting outer join, there are other possibilities
|
||||
} ECondAction;
|
||||
|
||||
EDealRes haveNormalColImpl(SNode* pNode, void* pContext) {
|
||||
if (QUERY_NODE_COLUMN == nodeType(pNode)) {
|
||||
*((bool*)pContext) = (COLUMN_TYPE_TAG != ((SColumnNode*)pNode)->colType);
|
||||
return *((bool*)pContext) ? DEAL_RES_END : DEAL_RES_IGNORE_CHILD;
|
||||
}
|
||||
return DEAL_RES_CONTINUE;
|
||||
}
|
||||
|
||||
static bool haveNormalCol(SNodeList* pList) {
|
||||
bool res = false;
|
||||
nodesWalkExprsPostOrder(pList, haveNormalColImpl, &res);
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool osdMayBeOptimized(SLogicNode* pNode) {
|
||||
if (OPTIMIZE_FLAG_TEST_MASK(pNode->optimizedFlag, OPTIMIZE_FLAG_OSD)) {
|
||||
return false;
|
||||
|
@ -67,7 +81,10 @@ static bool osdMayBeOptimized(SLogicNode* pNode) {
|
|||
(QUERY_NODE_LOGIC_PLAN_WINDOW != nodeType(pNode->pParent) && QUERY_NODE_LOGIC_PLAN_AGG != nodeType(pNode->pParent))) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
if (QUERY_NODE_LOGIC_PLAN_WINDOW == nodeType(pNode->pParent)) {
|
||||
return (WINDOW_TYPE_INTERVAL == ((SWindowLogicNode*)pNode->pParent)->winType);
|
||||
}
|
||||
return !haveNormalCol(((SAggLogicNode*)pNode->pParent)->pGroupKeys);
|
||||
}
|
||||
|
||||
static SLogicNode* osdFindPossibleScanNode(SLogicNode* pNode) {
|
||||
|
|
|
@ -45,7 +45,7 @@ protected:
|
|||
int32_t code = qParseQuerySql(&cxt_, &query_);
|
||||
|
||||
if (code != TSDB_CODE_SUCCESS) {
|
||||
cout << "sql:[" << cxt_.pSql << "] parser code:" << code << ", strerror:" << tstrerror(code) << ", msg:" << errMagBuf_ << endl;
|
||||
cout << "sql:[" << cxt_.pSql << "] qParseQuerySql code:" << code << ", strerror:" << tstrerror(code) << ", msg:" << errMagBuf_ << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue