提交 88f61824 编写于 作者: A Alex Duan

fix(query): first last and count combine query need not load data from file

上级 8c1633aa
...@@ -2658,6 +2658,7 @@ static bool notContainSessionOrStateWindow(SQueryAttr *pQueryAttr) { return !(pQ ...@@ -2658,6 +2658,7 @@ static bool notContainSessionOrStateWindow(SQueryAttr *pQueryAttr) { return !(pQ
static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) { static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
bool hasFirstLastFunc = false; bool hasFirstLastFunc = 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;
...@@ -2673,6 +2674,8 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) { ...@@ -2673,6 +2674,8 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_LAST_DST) { if (functionId == TSDB_FUNC_FIRST_DST || functionId == TSDB_FUNC_LAST_DST) {
hasFirstLastFunc = true; hasFirstLastFunc = true;
} else if(functionId == TSDB_FUNC_COUNT) {
hasCount = true;
} else { } else {
hasOtherFunc = true; hasOtherFunc = true;
} }
...@@ -2680,7 +2683,7 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) { ...@@ -2680,7 +2683,7 @@ static int32_t updateBlockLoadStatus(SQueryAttr *pQuery, int32_t status) {
if (hasFirstLastFunc && status == BLK_DATA_NO_NEEDED) { if (hasFirstLastFunc && status == BLK_DATA_NO_NEEDED) {
if(!hasOtherFunc) { if(!hasOtherFunc) {
return BLK_DATA_DISCARD; return hasCount ? BLK_DATA_NO_NEEDED : BLK_DATA_DISCARD;
} else { } else {
return BLK_DATA_ALL_NEEDED; return BLK_DATA_ALL_NEEDED;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册