提交 489a1f51 编写于 作者: A Alex Duan

fix(query): count like first last to ignore loadBlock

上级 d6e878ff
...@@ -2812,8 +2812,9 @@ static bool onlyLastQuery(SQueryAttr *pQueryAttr) { return onlyOneQueryType(pQue ...@@ -2812,8 +2812,9 @@ static bool onlyLastQuery(SQueryAttr *pQueryAttr) { return onlyOneQueryType(pQue
static bool notContainSessionOrStateWindow(SQueryAttr *pQueryAttr) { return !(pQueryAttr->sw.gap > 0 || pQueryAttr->stateWindow); } static bool notContainSessionOrStateWindow(SQueryAttr *pQueryAttr) { return !(pQueryAttr->sw.gap > 0 || pQueryAttr->stateWindow); }
static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) { static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
bool hasFirstLastFunc = false; bool hasFirstLastCountFunc = false;
bool hasOtherFunc = false; bool hasOtherFunc = false;
bool hasCount = false;
if (status == BLK_DATA_ALL_NEEDED || status == BLK_DATA_DISCARD) { if (status == BLK_DATA_ALL_NEEDED || status == BLK_DATA_DISCARD) {
return status; return status;
...@@ -2827,14 +2828,14 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) { ...@@ -2827,14 +2828,14 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
continue; continue;
} }
if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_LAST_DST) { if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_LAST_DST || functionId == TSDB_FUNC_COUNT) {
hasFirstLastFunc = true; hasFirstLastCountFunc = true;
} else { } else {
hasOtherFunc = true; hasOtherFunc = true;
} }
} }
if (hasFirstLastFunc && status == BLK_DATA_NO_NEEDED) { if (hasFirstLastCountFunc && status == BLK_DATA_NO_NEEDED) {
if(!hasOtherFunc) { if(!hasOtherFunc) {
return BLK_DATA_DISCARD; return BLK_DATA_DISCARD;
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册