[TD-4614]fix in operator bug
This commit is contained in:
parent
f2e01999dd
commit
a18a2c0a62
|
@ -2287,7 +2287,7 @@ static bool doFilterByBlockStatistics(SQueryRuntimeEnv* pRuntimeEnv, SDataStatis
|
||||||
if (pDataStatis == NULL || pQueryAttr->numOfFilterCols == 0) {
|
if (pDataStatis == NULL || pQueryAttr->numOfFilterCols == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
bool ret = true;
|
||||||
for (int32_t k = 0; k < pQueryAttr->numOfFilterCols; ++k) {
|
for (int32_t k = 0; k < pQueryAttr->numOfFilterCols; ++k) {
|
||||||
SSingleColumnFilterInfo *pFilterInfo = &pQueryAttr->pFilterInfo[k];
|
SSingleColumnFilterInfo *pFilterInfo = &pQueryAttr->pFilterInfo[k];
|
||||||
|
|
||||||
|
@ -2330,20 +2330,28 @@ static bool doFilterByBlockStatistics(SQueryRuntimeEnv* pRuntimeEnv, SDataStatis
|
||||||
float maxval = (float)(*(double *)(&pDataBlockst->max));
|
float maxval = (float)(*(double *)(&pDataBlockst->max));
|
||||||
|
|
||||||
for (int32_t i = 0; i < pFilterInfo->numOfFilters; ++i) {
|
for (int32_t i = 0; i < pFilterInfo->numOfFilters; ++i) {
|
||||||
if (pFilterInfo->pFilters[i].fp(&pFilterInfo->pFilters[i], (char *)&minval, (char *)&maxval, TSDB_DATA_TYPE_FLOAT)) {
|
if (pFilterInfo->pFilters[i].filterInfo.lowerRelOptr == TSDB_RELATION_IN) {
|
||||||
return true;
|
continue;
|
||||||
|
}
|
||||||
|
ret &= pFilterInfo->pFilters[i].fp(&pFilterInfo->pFilters[i], (char *)&minval, (char *)&maxval, TSDB_DATA_TYPE_FLOAT);
|
||||||
|
if (ret == false) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int32_t i = 0; i < pFilterInfo->numOfFilters; ++i) {
|
for (int32_t i = 0; i < pFilterInfo->numOfFilters; ++i) {
|
||||||
if (pFilterInfo->pFilters[i].fp(&pFilterInfo->pFilters[i], (char *)&pDataBlockst->min, (char *)&pDataBlockst->max, pFilterInfo->info.type)) {
|
if (pFilterInfo->pFilters[i].filterInfo.lowerRelOptr == TSDB_RELATION_IN) {
|
||||||
return true;
|
continue;
|
||||||
|
}
|
||||||
|
ret &= pFilterInfo->pFilters[i].fp(&pFilterInfo->pFilters[i], (char *)&pDataBlockst->min, (char *)&pDataBlockst->max, pFilterInfo->info.type);
|
||||||
|
if (ret == false) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlockInfo) {
|
static bool overlapWithTimeWindow(SQueryAttr* pQueryAttr, SDataBlockInfo* pBlockInfo) {
|
||||||
|
|
|
@ -90,11 +90,12 @@ uint32_t taosFloatHash(const char *key, uint32_t UNUSED_PARAM(len)) {
|
||||||
if (FLT_EQUAL(f, 0.0)) {
|
if (FLT_EQUAL(f, 0.0)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (f >= (FLT_MAX/BASE - DLT) || f <= (FLT_MIN/BASE - DLT)){
|
if (fabs(f) < FLT_MAX/BASE - DLT) {
|
||||||
|
int t = (int)(round(BASE * (f + DLT)));
|
||||||
|
return (uint32_t)t;
|
||||||
|
} else {
|
||||||
return 0x7fc00000;
|
return 0x7fc00000;
|
||||||
}
|
}
|
||||||
int t = (int)round(BASE * (f + DLT));
|
|
||||||
return (uint32_t)t;
|
|
||||||
}
|
}
|
||||||
uint32_t taosDoubleHash(const char *key, uint32_t UNUSED_PARAM(len)) {
|
uint32_t taosDoubleHash(const char *key, uint32_t UNUSED_PARAM(len)) {
|
||||||
double f = GET_DOUBLE_VAL(key);
|
double f = GET_DOUBLE_VAL(key);
|
||||||
|
@ -105,11 +106,12 @@ uint32_t taosDoubleHash(const char *key, uint32_t UNUSED_PARAM(len)) {
|
||||||
if (FLT_EQUAL(f, 0.0)) {
|
if (FLT_EQUAL(f, 0.0)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (f >= (DBL_MAX/BASE - DLT) || f <= (DBL_MIN/BASE - DLT)){
|
if (fabs(f) < DBL_MAX/BASE - DLT) {
|
||||||
return 0x7fc00000;
|
|
||||||
}
|
|
||||||
int t = (int)(round(BASE * (f + DLT)));
|
int t = (int)(round(BASE * (f + DLT)));
|
||||||
return (uint32_t)t;
|
return (uint32_t)t;
|
||||||
|
} else {
|
||||||
|
return 0x7fc00000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
uint32_t taosIntHash_64(const char *key, uint32_t UNUSED_PARAM(len)) {
|
uint32_t taosIntHash_64(const char *key, uint32_t UNUSED_PARAM(len)) {
|
||||||
uint64_t val = *(uint64_t *)key;
|
uint64_t val = *(uint64_t *)key;
|
||||||
|
|
Loading…
Reference in New Issue