Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
82714623
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
82714623
编写于
9月 10, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-1369]
上级
9768c30b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
128 addition
and
163 deletion
+128
-163
src/query/inc/qUtil.h
src/query/inc/qUtil.h
+4
-2
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+17
-0
src/query/src/qFilterfunc.c
src/query/src/qFilterfunc.c
+20
-77
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+87
-84
未找到文件。
src/query/inc/qUtil.h
浏览文件 @
82714623
...
...
@@ -50,14 +50,16 @@ static FORCE_INLINE char *getPosInResultPage(SQueryRuntimeEnv *pRuntimeEnv, int3
tFilePage
*
page
)
{
assert
(
pResult
!=
NULL
&&
pRuntimeEnv
!=
NULL
);
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
// tFilePage *page = getResBufPage(pRuntimeEnv->pResultBuf, pResult->pos.pageId);
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
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
+
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
*
getValueFilterFuncArray
(
int32_t
type
);
...
...
src/query/src/qExecutor.c
浏览文件 @
82714623
...
...
@@ -205,6 +205,23 @@ bool doFilterData(SQuery *pQuery, int32_t elemPos) {
for
(
int32_t
j
=
0
;
j
<
pFilterInfo
->
numOfFilters
;
++
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
))
{
qualified
=
true
;
break
;
...
...
src/query/src/qFilterfunc.c
浏览文件 @
82714623
...
...
@@ -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
;
}
////////////////////////////////////////////////////////////////
bool
isNull_i8
(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
{
return
isNull
(
minval
,
TSDB_DATA_TYPE_TINYINT
);
}
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
isNull_filter
(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
{
return
true
;
}
bool
notNull_
nchar
(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
{
return
!
isNull
(
minval
,
TSDB_DATA_TYPE_NCHAR
)
;
bool
notNull_
filter
(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
{
return
true
;
}
////////////////////////////////////////////////////////////////
...
...
@@ -463,8 +406,8 @@ bool (*filterFunc_i8[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i8
,
nequal_i8
,
NULL
,
isNull_
i8
,
notNull_
i8
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_i16
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -476,8 +419,8 @@ bool (*filterFunc_i16[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i16
,
nequal_i16
,
NULL
,
isNull_
i16
,
notNull_
i16
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_i32
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -489,8 +432,8 @@ bool (*filterFunc_i32[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i32
,
nequal_i32
,
NULL
,
isNull_
i32
,
notNull_
i32
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_i64
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -502,8 +445,8 @@ bool (*filterFunc_i64[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_i64
,
nequal_i64
,
NULL
,
isNull_
i64
,
notNull_
i64
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_ds
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -515,8 +458,8 @@ bool (*filterFunc_ds[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_ds
,
nequal_ds
,
NULL
,
isNull_
ds
,
notNull_
ds
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_dd
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -528,8 +471,8 @@ bool (*filterFunc_dd[])(SColumnFilterElem *pFilter, char *minval, char *maxval)
largeEqual_dd
,
nequal_dd
,
NULL
,
isNull_
dd
,
notNull_
dd
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_str
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -541,8 +484,8 @@ bool (*filterFunc_str[])(SColumnFilterElem* pFilter, char* minval, char *maxval)
NULL
,
nequal_str
,
like_str
,
isNull_
binary
,
notNull_
binary
,
isNull_
filter
,
notNull_
filter
,
};
bool
(
*
filterFunc_nchar
[])(
SColumnFilterElem
*
pFitler
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
@@ -554,8 +497,8 @@ bool (*filterFunc_nchar[])(SColumnFilterElem* pFitler, char* minval, char* maxva
NULL
,
nequal_nchar
,
like_nchar
,
isNull_
ncha
r
,
notNull_
ncha
r
,
isNull_
filte
r
,
notNull_
filte
r
,
};
bool
(
*
rangeFilterFunc_i8
[])(
SColumnFilterElem
*
pFilter
,
char
*
minval
,
char
*
maxval
)
=
{
...
...
tests/script/general/parser/testSuite.sim
浏览文件 @
82714623
#
sleep 2000
#
run general/parser/alter.sim
#
sleep 2000
#
run general/parser/alter1.sim
#
sleep 2000
#
run general/parser/alter_stable.sim
#
sleep 2000
#
run general/parser/auto_create_tb.sim
#
sleep 2000
#
run general/parser/auto_create_tb_drop_tb.sim
#
sleep 2000
#
run general/parser/col_arithmetic_operation.sim
#
sleep 2000
#
run general/parser/columnValue.sim
#
sleep 2000
#
run general/parser/commit.sim
#
sleep 2000
#
run general/parser/create_db.sim
#
sleep 2000
#
run general/parser/create_mt.sim
#
sleep 2000
#
run general/parser/create_tb.sim
#
sleep 2000
#
run general/parser/dbtbnameValidate.sim
#
sleep 2000
#
run general/parser/fill.sim
#
sleep 2000
#
run general/parser/fill_stb.sim
#
sleep 2000
#
#
run general/parser/fill_us.sim #
#
sleep 2000
#
run general/parser/first_last.sim
#
sleep 2000
#
run general/parser/import_commit1.sim
#
sleep 2000
#
run general/parser/import_commit2.sim
#
sleep 2000
#
run general/parser/import_commit3.sim
#
sleep 2000
#
#
run general/parser/import_file.sim
#
sleep 2000
#
run general/parser/insert_tb.sim
#
sleep 2000
#
run general/parser/tags_dynamically_specifiy.sim
#
sleep 2000
#
run general/parser/interp.sim
#
sleep 2000
#
run general/parser/lastrow.sim
#
sleep 2000
#
run general/parser/limit.sim
#
sleep 2000
#
run general/parser/limit1.sim
#
sleep 2000
#
run general/parser/limit1_tblocks100.sim
#
sleep 2000
#
run general/parser/limit2.sim
#
sleep 2000
#
run general/parser/mixed_blocks.sim
#
sleep 2000
#
run general/parser/nchar.sim
#
sleep 2000
#
run general/parser/null_char.sim
#
sleep 2000
#
run general/parser/selectResNum.sim
#
sleep 2000
#
run general/parser/select_across_vnodes.sim
#
sleep 2000
#
run general/parser/select_from_cache_disk.sim
#
sleep 2000
#
run general/parser/set_tag_vals.sim
#
sleep 2000
#
run general/parser/single_row_in_tb.sim
#
sleep 2000
#
run general/parser/slimit.sim
#
sleep 2000
#
run general/parser/slimit1.sim
#
sleep 2000
#
run general/parser/slimit_alter_tags.sim
#
sleep 2000
#
run general/parser/tbnameIn.sim
#
sleep 2000
#
run general/parser/slimit_alter_tags.sim # persistent failed
#
sleep 2000
#
run general/parser/join.sim
sleep 2000
run general/parser/alter.sim
sleep 2000
run general/parser/alter1.sim
sleep 2000
run general/parser/alter_stable.sim
sleep 2000
run general/parser/auto_create_tb.sim
sleep 2000
run general/parser/auto_create_tb_drop_tb.sim
sleep 2000
run general/parser/col_arithmetic_operation.sim
sleep 2000
run general/parser/columnValue.sim
sleep 2000
run general/parser/commit.sim
sleep 2000
run general/parser/create_db.sim
sleep 2000
run general/parser/create_mt.sim
sleep 2000
run general/parser/create_tb.sim
sleep 2000
run general/parser/dbtbnameValidate.sim
sleep 2000
run general/parser/fill.sim
sleep 2000
run general/parser/fill_stb.sim
sleep 2000
#run general/parser/fill_us.sim #
sleep 2000
run general/parser/first_last.sim
sleep 2000
run general/parser/import_commit1.sim
sleep 2000
run general/parser/import_commit2.sim
sleep 2000
run general/parser/import_commit3.sim
sleep 2000
#run general/parser/import_file.sim
sleep 2000
run general/parser/insert_tb.sim
sleep 2000
run general/parser/tags_dynamically_specifiy.sim
sleep 2000
run general/parser/interp.sim
sleep 2000
run general/parser/lastrow.sim
sleep 2000
run general/parser/limit.sim
sleep 2000
run general/parser/limit1.sim
sleep 2000
run general/parser/limit1_tblocks100.sim
sleep 2000
run general/parser/limit2.sim
sleep 2000
run general/parser/mixed_blocks.sim
sleep 2000
run general/parser/nchar.sim
sleep 2000
run general/parser/null_char.sim
sleep 2000
run general/parser/selectResNum.sim
sleep 2000
run general/parser/select_across_vnodes.sim
sleep 2000
run general/parser/select_from_cache_disk.sim
sleep 2000
run general/parser/set_tag_vals.sim
sleep 2000
run general/parser/single_row_in_tb.sim
sleep 2000
run general/parser/slimit.sim
sleep 2000
run general/parser/slimit1.sim
sleep 2000
run general/parser/slimit_alter_tags.sim
sleep 2000
run general/parser/tbnameIn.sim
sleep 2000
run general/parser/slimit_alter_tags.sim # persistent failed
sleep 2000
run general/parser/join.sim
sleep 2000
run general/parser/join_multivnode.sim
sleep 2000
...
...
@@ -99,10 +99,13 @@ run general/parser/union.sim
sleep 2000
run general/parser/constCol.sim
sleep 2000
run general/parser/where.sim
sleep 2000
run general/parser/timestamp.sim
sleep 2000
run general/parser/sliding.sim
#sleep 2000
#run general/parser/repeatStream.sim
#sleep 2000
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录