提交 82714623 编写于 作者: H Haojun Liao

[td-1369]

上级 9768c30b
...@@ -51,13 +51,15 @@ static FORCE_INLINE char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int3 ...@@ -51,13 +51,15 @@ static FORCE_INLINE char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int3
assert(pResult != NULL && pRuntimeEnv != NULL); assert(pResult != NULL && pRuntimeEnv != NULL);
SQuery *pQuery = pRuntimeEnv->pQuery; SQuery *pQuery = pRuntimeEnv->pQuery;
// tFilePage *page = getResBufPage(pRuntimeEnv->pResultBuf, pResult->pos.pageId);
int32_t realRowId = (int32_t)(pResult->pos.rowId * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, pRuntimeEnv->topBotQuery, pRuntimeEnv->stableQuery)); int32_t realRowId = (int32_t)(pResult->pos.rowId * GET_ROW_PARAM_FOR_MULTIOUTPUT(pQuery, pRuntimeEnv->topBotQuery, pRuntimeEnv->stableQuery));
return ((char *)page->data) + pRuntimeEnv->offset[columnIndex] * pRuntimeEnv->numOfRowsPerPage + return ((char *)page->data) + pRuntimeEnv->offset[columnIndex] * pRuntimeEnv->numOfRowsPerPage +
pQuery->pSelectExpr[columnIndex].bytes * realRowId; pQuery->pSelectExpr[columnIndex].bytes * realRowId;
} }
bool isNull_filter(SColumnFilterElem *pFilter, char* minval, char* maxval);
bool notNull_filter(SColumnFilterElem *pFilter, char* minval, char* maxval);
__filter_func_t *getRangeFilterFuncArray(int32_t type); __filter_func_t *getRangeFilterFuncArray(int32_t type);
__filter_func_t *getValueFilterFuncArray(int32_t type); __filter_func_t *getValueFilterFuncArray(int32_t type);
......
...@@ -205,6 +205,23 @@ bool doFilterData(SQuery *pQuery, int32_t elemPos) { ...@@ -205,6 +205,23 @@ bool doFilterData(SQuery *pQuery, int32_t elemPos) {
for (int32_t j = 0; j < pFilterInfo->numOfFilters; ++j) { for (int32_t j = 0; j < pFilterInfo->numOfFilters; ++j) {
SColumnFilterElem *pFilterElem = &pFilterInfo->pFilters[j]; SColumnFilterElem *pFilterElem = &pFilterInfo->pFilters[j];
bool isnull = isNull(pElem, pFilterInfo->info.type);
if (isnull) {
if (pFilterElem->fp == isNull_filter) {
qualified = true;
break;
} else {
continue;
}
} else {
if (pFilterElem->fp == notNull_filter) {
qualified = true;
break;
} else if (pFilterElem->fp == isNull_filter) {
continue;
}
}
if (pFilterElem->fp(pFilterElem, pElem, pElem)) { if (pFilterElem->fp(pFilterElem, pElem, pElem)) {
qualified = true; qualified = true;
break; break;
......
...@@ -285,69 +285,12 @@ bool nequal_nchar(SColumnFilterElem *pFilter, char* minval, char *maxval) { ...@@ -285,69 +285,12 @@ bool nequal_nchar(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return wcsncmp((wchar_t *)pFilter->filterInfo.pz, varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE) != 0; return wcsncmp((wchar_t *)pFilter->filterInfo.pz, varDataVal(minval), varDataLen(minval)/TSDB_NCHAR_SIZE) != 0;
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
bool isNull_i8(SColumnFilterElem *pFilter, char* minval, char *maxval) { bool isNull_filter(SColumnFilterElem *pFilter, char* minval, char* maxval) {
return isNull(minval, TSDB_DATA_TYPE_TINYINT); return true;
}
bool isNull_i16(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_SMALLINT);
}
bool isNull_i32(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_INT);
}
bool isNull_i64(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_BIGINT);
}
bool isNull_ds(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_FLOAT);
}
bool isNull_dd(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_DOUBLE);
}
bool isNull_binary(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_BINARY);
}
bool isNull_nchar(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_NCHAR);
}
////////////////////////////////////////////////////////////////
bool notNull_i8(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_TINYINT);
}
bool notNull_i16(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_SMALLINT);
}
bool notNull_i32(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_INT);
}
bool notNull_i64(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_BIGINT);
}
bool notNull_ds(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_FLOAT);
}
bool notNull_dd(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return isNull(minval, TSDB_DATA_TYPE_DOUBLE);
}
bool notNull_binary(SColumnFilterElem *pFilter, char* minval, char *maxval) {
return !isNull(minval, TSDB_DATA_TYPE_BINARY);
} }
bool notNull_nchar(SColumnFilterElem *pFilter, char* minval, char *maxval) { bool notNull_filter(SColumnFilterElem *pFilter, char* minval, char* maxval) {
return !isNull(minval, TSDB_DATA_TYPE_NCHAR); return true;
} }
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
...@@ -463,8 +406,8 @@ bool (*filterFunc_i8[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -463,8 +406,8 @@ bool (*filterFunc_i8[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i8, largeEqual_i8,
nequal_i8, nequal_i8,
NULL, NULL,
isNull_i8, isNull_filter,
notNull_i8, notNull_filter,
}; };
bool (*filterFunc_i16[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*filterFunc_i16[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
...@@ -476,8 +419,8 @@ bool (*filterFunc_i16[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -476,8 +419,8 @@ bool (*filterFunc_i16[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i16, largeEqual_i16,
nequal_i16, nequal_i16,
NULL, NULL,
isNull_i16, isNull_filter,
notNull_i16, notNull_filter,
}; };
bool (*filterFunc_i32[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*filterFunc_i32[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
...@@ -489,8 +432,8 @@ bool (*filterFunc_i32[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -489,8 +432,8 @@ bool (*filterFunc_i32[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i32, largeEqual_i32,
nequal_i32, nequal_i32,
NULL, NULL,
isNull_i32, isNull_filter,
notNull_i32, notNull_filter,
}; };
bool (*filterFunc_i64[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*filterFunc_i64[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
...@@ -502,8 +445,8 @@ bool (*filterFunc_i64[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -502,8 +445,8 @@ bool (*filterFunc_i64[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i64, largeEqual_i64,
nequal_i64, nequal_i64,
NULL, NULL,
isNull_i64, isNull_filter,
notNull_i64, notNull_filter,
}; };
bool (*filterFunc_ds[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*filterFunc_ds[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
...@@ -515,8 +458,8 @@ bool (*filterFunc_ds[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -515,8 +458,8 @@ bool (*filterFunc_ds[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_ds, largeEqual_ds,
nequal_ds, nequal_ds,
NULL, NULL,
isNull_ds, isNull_filter,
notNull_ds, notNull_filter,
}; };
bool (*filterFunc_dd[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*filterFunc_dd[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
...@@ -528,8 +471,8 @@ bool (*filterFunc_dd[])(SColumnFilterElem *pFilter, char *minval, char *maxval) ...@@ -528,8 +471,8 @@ bool (*filterFunc_dd[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_dd, largeEqual_dd,
nequal_dd, nequal_dd,
NULL, NULL,
isNull_dd, isNull_filter,
notNull_dd, notNull_filter,
}; };
bool (*filterFunc_str[])(SColumnFilterElem* pFilter, char* minval, char *maxval) = { bool (*filterFunc_str[])(SColumnFilterElem* pFilter, char* minval, char *maxval) = {
...@@ -541,8 +484,8 @@ bool (*filterFunc_str[])(SColumnFilterElem* pFilter, char* minval, char *maxval) ...@@ -541,8 +484,8 @@ bool (*filterFunc_str[])(SColumnFilterElem* pFilter, char* minval, char *maxval)
NULL, NULL,
nequal_str, nequal_str,
like_str, like_str,
isNull_binary, isNull_filter,
notNull_binary, notNull_filter,
}; };
bool (*filterFunc_nchar[])(SColumnFilterElem* pFitler, char* minval, char* maxval) = { bool (*filterFunc_nchar[])(SColumnFilterElem* pFitler, char* minval, char* maxval) = {
...@@ -554,8 +497,8 @@ bool (*filterFunc_nchar[])(SColumnFilterElem* pFitler, char* minval, char* maxva ...@@ -554,8 +497,8 @@ bool (*filterFunc_nchar[])(SColumnFilterElem* pFitler, char* minval, char* maxva
NULL, NULL,
nequal_nchar, nequal_nchar,
like_nchar, like_nchar,
isNull_nchar, isNull_filter,
notNull_nchar, notNull_filter,
}; };
bool (*rangeFilterFunc_i8[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = { bool (*rangeFilterFunc_i8[])(SColumnFilterElem *pFilter, char *minval, char *maxval) = {
......
#sleep 2000 sleep 2000
#run general/parser/alter.sim run general/parser/alter.sim
#sleep 2000 sleep 2000
#run general/parser/alter1.sim run general/parser/alter1.sim
#sleep 2000 sleep 2000
#run general/parser/alter_stable.sim run general/parser/alter_stable.sim
#sleep 2000 sleep 2000
#run general/parser/auto_create_tb.sim run general/parser/auto_create_tb.sim
#sleep 2000 sleep 2000
#run general/parser/auto_create_tb_drop_tb.sim run general/parser/auto_create_tb_drop_tb.sim
#sleep 2000 sleep 2000
#run general/parser/col_arithmetic_operation.sim run general/parser/col_arithmetic_operation.sim
#sleep 2000 sleep 2000
#run general/parser/columnValue.sim run general/parser/columnValue.sim
#sleep 2000 sleep 2000
#run general/parser/commit.sim run general/parser/commit.sim
#sleep 2000 sleep 2000
#run general/parser/create_db.sim run general/parser/create_db.sim
#sleep 2000 sleep 2000
#run general/parser/create_mt.sim run general/parser/create_mt.sim
#sleep 2000 sleep 2000
#run general/parser/create_tb.sim run general/parser/create_tb.sim
#sleep 2000 sleep 2000
#run general/parser/dbtbnameValidate.sim run general/parser/dbtbnameValidate.sim
#sleep 2000 sleep 2000
#run general/parser/fill.sim run general/parser/fill.sim
#sleep 2000 sleep 2000
#run general/parser/fill_stb.sim run general/parser/fill_stb.sim
#sleep 2000 sleep 2000
##run general/parser/fill_us.sim # #run general/parser/fill_us.sim #
#sleep 2000 sleep 2000
#run general/parser/first_last.sim run general/parser/first_last.sim
#sleep 2000 sleep 2000
#run general/parser/import_commit1.sim run general/parser/import_commit1.sim
#sleep 2000 sleep 2000
#run general/parser/import_commit2.sim run general/parser/import_commit2.sim
#sleep 2000 sleep 2000
#run general/parser/import_commit3.sim run general/parser/import_commit3.sim
#sleep 2000 sleep 2000
##run general/parser/import_file.sim #run general/parser/import_file.sim
#sleep 2000 sleep 2000
#run general/parser/insert_tb.sim run general/parser/insert_tb.sim
#sleep 2000 sleep 2000
#run general/parser/tags_dynamically_specifiy.sim run general/parser/tags_dynamically_specifiy.sim
#sleep 2000 sleep 2000
#run general/parser/interp.sim run general/parser/interp.sim
#sleep 2000 sleep 2000
#run general/parser/lastrow.sim run general/parser/lastrow.sim
#sleep 2000 sleep 2000
#run general/parser/limit.sim run general/parser/limit.sim
#sleep 2000 sleep 2000
#run general/parser/limit1.sim run general/parser/limit1.sim
#sleep 2000 sleep 2000
#run general/parser/limit1_tblocks100.sim run general/parser/limit1_tblocks100.sim
#sleep 2000 sleep 2000
#run general/parser/limit2.sim run general/parser/limit2.sim
#sleep 2000 sleep 2000
#run general/parser/mixed_blocks.sim run general/parser/mixed_blocks.sim
#sleep 2000 sleep 2000
#run general/parser/nchar.sim run general/parser/nchar.sim
#sleep 2000 sleep 2000
#run general/parser/null_char.sim run general/parser/null_char.sim
#sleep 2000 sleep 2000
#run general/parser/selectResNum.sim run general/parser/selectResNum.sim
#sleep 2000 sleep 2000
#run general/parser/select_across_vnodes.sim run general/parser/select_across_vnodes.sim
#sleep 2000 sleep 2000
#run general/parser/select_from_cache_disk.sim run general/parser/select_from_cache_disk.sim
#sleep 2000 sleep 2000
#run general/parser/set_tag_vals.sim run general/parser/set_tag_vals.sim
#sleep 2000 sleep 2000
#run general/parser/single_row_in_tb.sim run general/parser/single_row_in_tb.sim
#sleep 2000 sleep 2000
#run general/parser/slimit.sim run general/parser/slimit.sim
#sleep 2000 sleep 2000
#run general/parser/slimit1.sim run general/parser/slimit1.sim
#sleep 2000 sleep 2000
#run general/parser/slimit_alter_tags.sim run general/parser/slimit_alter_tags.sim
#sleep 2000 sleep 2000
#run general/parser/tbnameIn.sim run general/parser/tbnameIn.sim
#sleep 2000 sleep 2000
#run general/parser/slimit_alter_tags.sim # persistent failed run general/parser/slimit_alter_tags.sim # persistent failed
#sleep 2000 sleep 2000
#run general/parser/join.sim run general/parser/join.sim
sleep 2000 sleep 2000
run general/parser/join_multivnode.sim run general/parser/join_multivnode.sim
sleep 2000 sleep 2000
...@@ -99,10 +99,13 @@ run general/parser/union.sim ...@@ -99,10 +99,13 @@ run general/parser/union.sim
sleep 2000 sleep 2000
run general/parser/constCol.sim run general/parser/constCol.sim
sleep 2000 sleep 2000
run general/parser/where.sim
sleep 2000
run general/parser/timestamp.sim run general/parser/timestamp.sim
sleep 2000 sleep 2000
run general/parser/sliding.sim run general/parser/sliding.sim
#sleep 2000 #sleep 2000
#run general/parser/repeatStream.sim #run general/parser/repeatStream.sim
#sleep 2000 #sleep 2000
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册