Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dc6bdab4
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dc6bdab4
编写于
5月 03, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh(index): add prefix query
上级
8e7cf4a6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
46 addition
and
41 deletion
+46
-41
include/libs/index/index.h
include/libs/index/index.h
+2
-2
source/libs/executor/src/indexoperator.c
source/libs/executor/src/indexoperator.c
+5
-2
source/libs/index/inc/indexInt.h
source/libs/index/inc/indexInt.h
+3
-2
source/libs/index/src/index.c
source/libs/index/src/index.c
+3
-2
source/libs/index/test/indexTests.cc
source/libs/index/test/indexTests.cc
+25
-25
source/libs/index/test/jsonUT.cc
source/libs/index/test/jsonUT.cc
+8
-8
未找到文件。
include/libs/index/index.h
浏览文件 @
dc6bdab4
...
...
@@ -168,8 +168,8 @@ void indexOptsDestroy(SIndexOpts* opts);
* @param:
*/
SIndexTerm
*
indexTermCreate
(
int64_t
suid
,
SIndexOperOnColumn
operType
,
uint8_t
colType
,
const
char
*
colNam
e
,
int32_t
nColName
,
const
char
*
colVal
,
int32_t
nColVal
);
SIndexTerm
*
indexTermCreate
(
int64_t
suid
,
SIndexOperOnColumn
operType
,
int8_t
qType
,
uint8_t
colTyp
e
,
const
char
*
colName
,
int32_t
nColName
,
const
char
*
colVal
,
int32_t
nColVal
);
void
indexTermDestroy
(
SIndexTerm
*
p
);
/*
...
...
source/libs/executor/src/indexoperator.c
浏览文件 @
dc6bdab4
...
...
@@ -247,8 +247,11 @@ static int32_t sifExecFunction(SFunctionNode *node, SIFCtx *ctx, SIFParam *outpu
return
TSDB_CODE_QRY_INVALID_INPUT
;
}
static
int32_t
sifDoIndex
(
SIFParam
*
left
,
SIFParam
*
right
,
int8_t
operType
,
SIFParam
*
output
)
{
SIndexTerm
*
tm
=
indexTermCreate
(
left
->
suid
,
DEFAULT
,
left
->
colValType
,
left
->
colName
,
strlen
(
left
->
colName
),
right
->
condValue
,
strlen
(
right
->
condValue
));
SIndexTerm
*
tm
=
indexTermCreate
(
left
->
suid
,
DEFAULT
,
operType
,
left
->
colValType
,
left
->
colName
,
strlen
(
left
->
colName
),
right
->
condValue
,
strlen
(
right
->
condValue
));
if
(
operType
==
OP_TYPE_LOWER_EQUAL
||
operType
==
OP_TYPE_GREATER_EQUAL
||
operType
==
OP_TYPE_GREATER_THAN
||
operType
==
OP_TYPE_LOWER_THAN
)
{
}
if
(
tm
==
NULL
)
{
return
TSDB_CODE_QRY_OUT_OF_MEMORY
;
}
...
...
source/libs/index/inc/indexInt.h
浏览文件 @
dc6bdab4
...
...
@@ -57,7 +57,7 @@ struct SIndex {
char
*
path
;
SIndexStat
stat
;
SIndexStat
stat
;
TdThreadMutex
mtx
;
};
...
...
@@ -86,6 +86,7 @@ typedef struct SIndexTerm {
int32_t
nColName
;
char
*
colVal
;
int32_t
nColVal
;
int8_t
qType
;
// just use for range
}
SIndexTerm
;
typedef
struct
SIndexTermQuery
{
...
...
@@ -165,7 +166,7 @@ int32_t indexSerialCacheKey(ICacheKey* key, char* buf);
} while (0)
#define INDEX_TYPE_CONTAIN_EXTERN_TYPE(ty, exTy) (((ty >> 4) & (exTy)) != 0)
#define INDEX_TYPE_GET_TYPE(ty) (ty & 0x0F)
#define INDEX_TYPE_GET_TYPE(ty)
(ty & 0x0F)
#define INDEX_TYPE_ADD_EXTERN_TYPE(ty, exTy) \
do { \
uint8_t oldTy = ty; \
...
...
source/libs/index/src/index.c
浏览文件 @
dc6bdab4
...
...
@@ -244,8 +244,8 @@ int indexMultiTermQueryAdd(SIndexMultiTermQuery* pQuery, SIndexTerm* term, EInde
return
0
;
}
SIndexTerm
*
indexTermCreate
(
int64_t
suid
,
SIndexOperOnColumn
oper
,
uint8_t
colType
,
const
char
*
colNam
e
,
int32_t
nColName
,
const
char
*
colVal
,
int32_t
nColVal
)
{
SIndexTerm
*
indexTermCreate
(
int64_t
suid
,
SIndexOperOnColumn
oper
,
int8_t
queryType
,
uint8_t
colTyp
e
,
const
char
*
colName
,
int32_t
nColName
,
const
char
*
colVal
,
int32_t
nColVal
)
{
SIndexTerm
*
tm
=
(
SIndexTerm
*
)
taosMemoryCalloc
(
1
,
(
sizeof
(
SIndexTerm
)));
if
(
tm
==
NULL
)
{
return
NULL
;
...
...
@@ -262,6 +262,7 @@ SIndexTerm* indexTermCreate(int64_t suid, SIndexOperOnColumn oper, uint8_t colTy
tm
->
colVal
=
(
char
*
)
taosMemoryCalloc
(
1
,
nColVal
+
1
);
memcpy
(
tm
->
colVal
,
colVal
,
nColVal
);
tm
->
nColVal
=
nColVal
;
tm
->
qType
=
queryType
;
return
tm
;
}
...
...
source/libs/index/test/indexTests.cc
浏览文件 @
dc6bdab4
...
...
@@ -483,9 +483,9 @@ TEST_F(IndexTFileEnv, test_tfile_write) {
std
::
string
colName
(
"voltage"
);
std
::
string
colVal
(
"ab"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SArray
*
result
=
(
SArray
*
)
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
fObj
->
Get
(
&
query
,
result
);
...
...
@@ -557,7 +557,7 @@ TEST_F(IndexCacheEnv, cache_test) {
std
::
string
colName
(
"voltage"
);
{
std
::
string
colVal
(
"v1"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
...
...
@@ -565,28 +565,28 @@ TEST_F(IndexCacheEnv, cache_test) {
}
{
std
::
string
colVal
(
"v3"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
}
{
std
::
string
colVal
(
"v2"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
}
{
std
::
string
colVal
(
"v3"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
}
{
std
::
string
colVal
(
"v3"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
...
...
@@ -595,14 +595,14 @@ TEST_F(IndexCacheEnv, cache_test) {
std
::
cout
<<
"--------first----------"
<<
std
::
endl
;
{
std
::
string
colVal
(
"v3"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
othColId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
}
{
std
::
string
colVal
(
"v4"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
othColId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
...
...
@@ -613,7 +613,7 @@ TEST_F(IndexCacheEnv, cache_test) {
std
::
string
colVal
(
"v4"
);
for
(
size_t
i
=
0
;
i
<
10
;
i
++
)
{
colVal
[
colVal
.
size
()
-
1
]
=
'a'
+
i
;
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
coj
->
Put
(
term
,
colId
,
version
++
,
suid
++
);
indexTermDestroy
(
term
);
...
...
@@ -623,9 +623,9 @@ TEST_F(IndexCacheEnv, cache_test) {
// begin query
{
std
::
string
colVal
(
"v3"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SArray
*
ret
=
(
SArray
*
)
taosArrayInit
(
4
,
sizeof
(
suid
));
STermValueType
valType
;
...
...
@@ -638,9 +638,9 @@ TEST_F(IndexCacheEnv, cache_test) {
}
{
std
::
string
colVal
(
"v2"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SIndexTermQuery
query
=
{
term
,
QUERY_TERM
};
SArray
*
ret
=
(
SArray
*
)
taosArrayInit
(
4
,
sizeof
(
suid
));
STermValueType
valType
;
...
...
@@ -670,7 +670,7 @@ class IndexObj {
return
ret
;
}
void
Del
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
,
uint64_t
uid
)
{
SIndexTerm
*
term
=
indexTermCreate
(
0
,
DEL_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
DEL_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -679,7 +679,7 @@ class IndexObj {
}
int
WriteMillonData
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
=
"Hello world"
,
size_t
numOfTable
=
100
*
10000
)
{
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -701,7 +701,7 @@ class IndexObj {
// opt
tColVal
[
taosRand
()
%
colValSize
]
=
'a'
+
k
%
26
;
}
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
tColVal
.
c_str
(),
tColVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -737,7 +737,7 @@ class IndexObj {
int
SearchOne
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
)
{
SIndexMultiTermQuery
*
mq
=
indexMultiTermQueryCreate
(
MUST
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
indexMultiTermQueryAdd
(
mq
,
term
,
QUERY_TERM
);
...
...
@@ -759,7 +759,7 @@ class IndexObj {
}
int
SearchOneTarget
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
,
uint64_t
val
)
{
SIndexMultiTermQuery
*
mq
=
indexMultiTermQueryCreate
(
MUST
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
indexMultiTermQueryAdd
(
mq
,
term
,
QUERY_TERM
);
...
...
@@ -784,7 +784,7 @@ class IndexObj {
void
PutOne
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
)
{
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
indexMultiTermAdd
(
terms
,
term
);
Put
(
terms
,
10
);
...
...
@@ -792,7 +792,7 @@ class IndexObj {
}
void
PutOneTarge
(
const
std
::
string
&
colName
,
const
std
::
string
&
colVal
,
uint64_t
val
)
{
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
indexMultiTermAdd
(
terms
,
term
);
Put
(
terms
,
val
);
...
...
@@ -832,7 +832,7 @@ TEST_F(IndexEnv2, testIndexOpen) {
{
std
::
string
colName
(
"tag1"
),
colVal
(
"Hello"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -847,7 +847,7 @@ TEST_F(IndexEnv2, testIndexOpen) {
size_t
size
=
200
;
std
::
string
colName
(
"tag1"
),
colVal
(
"hello"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -862,7 +862,7 @@ TEST_F(IndexEnv2, testIndexOpen) {
size_t
size
=
200
;
std
::
string
colName
(
"tag1"
),
colVal
(
"Hello"
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
indexMultiTermAdd
(
terms
,
term
);
...
...
@@ -877,7 +877,7 @@ TEST_F(IndexEnv2, testIndexOpen) {
{
std
::
string
colName
(
"tag1"
),
colVal
(
"Hello"
);
SIndexMultiTermQuery
*
mq
=
indexMultiTermQueryCreate
(
MUST
);
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
0
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
indexMultiTermQueryAdd
(
mq
,
term
,
QUERY_TERM
);
...
...
source/libs/index/test/jsonUT.cc
浏览文件 @
dc6bdab4
...
...
@@ -40,7 +40,7 @@ TEST_F(JsonEnv, testWrite) {
{
std
::
string
colName
(
"test"
);
std
::
string
colVal
(
"ab"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -53,7 +53,7 @@ TEST_F(JsonEnv, testWrite) {
{
std
::
string
colName
(
"voltage"
);
std
::
string
colVal
(
"ab1"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -66,7 +66,7 @@ TEST_F(JsonEnv, testWrite) {
{
std
::
string
colName
(
"voltage"
);
std
::
string
colVal
(
"123"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -81,7 +81,7 @@ TEST_F(JsonEnv, testWrite) {
std
::
string
colVal
(
"ab"
);
SIndexMultiTermQuery
*
mq
=
indexMultiTermQueryCreate
(
MUST
);
SIndexTerm
*
q
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
q
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
...
...
@@ -95,7 +95,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
{
std
::
string
colName
(
"test"
);
std
::
string
colVal
(
"ab"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -110,7 +110,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
std
::
string
colVal
(
"abxxxxxxxxxxxx"
);
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
colVal
[
i
%
colVal
.
size
()]
=
'0'
+
i
%
128
;
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -124,7 +124,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
{
std
::
string
colName
(
"voltagefdadfa"
);
std
::
string
colVal
(
"abxxxxxxxxxxxx"
);
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
term
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SIndexMultiTerm
*
terms
=
indexMultiTermCreate
();
...
...
@@ -139,7 +139,7 @@ TEST_F(JsonEnv, testWriteMillonData) {
std
::
string
colVal
(
"ab"
);
SIndexMultiTermQuery
*
mq
=
indexMultiTermQueryCreate
(
MUST
);
SIndexTerm
*
q
=
indexTermCreate
(
1
,
ADD_VALUE
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
SIndexTerm
*
q
=
indexTermCreate
(
1
,
ADD_VALUE
,
0
,
TSDB_DATA_TYPE_BINARY
,
colName
.
c_str
(),
colName
.
size
(),
colVal
.
c_str
(),
colVal
.
size
());
SArray
*
result
=
taosArrayInit
(
1
,
sizeof
(
uint64_t
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录