parent
c5e5f4c663
commit
50865d282e
|
@ -1349,11 +1349,12 @@ static int32_t blockwiseApplyAllFunctions(SQueryRuntimeEnv *pRuntimeEnv, int32_t
|
||||||
*
|
*
|
||||||
* first filter the data block according to the value filter condition, then, if the top/bottom query applied,
|
* first filter the data block according to the value filter condition, then, if the top/bottom query applied,
|
||||||
* invoke the filter function to decide if the data block need to be accessed or not.
|
* invoke the filter function to decide if the data block need to be accessed or not.
|
||||||
|
* TODO handle the whole data block is NULL situation
|
||||||
* @param pQuery
|
* @param pQuery
|
||||||
* @param pField
|
* @param pField
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static bool needToLoadDataBlock(SQuery *pQuery, SField *pField, SQLFunctionCtx *pCtx) {
|
static bool needToLoadDataBlock(SQuery *pQuery, SField *pField, SQLFunctionCtx *pCtx, int32_t numOfTotalPoints) {
|
||||||
if (pField == NULL) {
|
if (pField == NULL) {
|
||||||
return false; // no need to load data
|
return false; // no need to load data
|
||||||
}
|
}
|
||||||
|
@ -1372,6 +1373,11 @@ static bool needToLoadDataBlock(SQuery *pQuery, SField *pField, SQLFunctionCtx *
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// all points in current column are NULL, no need to check its boundary value
|
||||||
|
if (pField[colIndex].numOfNullPoints == numOfTotalPoints) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (pFilterInfo->info.data.type == TSDB_DATA_TYPE_FLOAT) {
|
if (pFilterInfo->info.data.type == TSDB_DATA_TYPE_FLOAT) {
|
||||||
float minval = *(double *)(&pField[colIndex].min);
|
float minval = *(double *)(&pField[colIndex].min);
|
||||||
float maxval = *(double *)(&pField[colIndex].max);
|
float maxval = *(double *)(&pField[colIndex].max);
|
||||||
|
@ -6595,7 +6601,7 @@ int32_t LoadDatablockOnDemand(SCompBlock *pBlock, SField **pFields, uint8_t *blk
|
||||||
* filter the data block according to the value filter condition.
|
* filter the data block according to the value filter condition.
|
||||||
* no need to load the data block, continue for next block
|
* no need to load the data block, continue for next block
|
||||||
*/
|
*/
|
||||||
if (!needToLoadDataBlock(pQuery, *pFields, pRuntimeEnv->pCtx)) {
|
if (!needToLoadDataBlock(pQuery, *pFields, pRuntimeEnv->pCtx, pBlock->numOfPoints)) {
|
||||||
#if defined(_DEBUG_VIEW)
|
#if defined(_DEBUG_VIEW)
|
||||||
dTrace("QInfo:%p fileId:%d, slot:%d, block discarded by per-filter, ", GET_QINFO_ADDR(pQuery), pQuery->fileId,
|
dTrace("QInfo:%p fileId:%d, slot:%d, block discarded by per-filter, ", GET_QINFO_ADDR(pQuery), pQuery->fileId,
|
||||||
pQuery->slot);
|
pQuery->slot);
|
||||||
|
|
Loading…
Reference in New Issue