Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
9aae8d37
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9aae8d37
编写于
10月 09, 2021
作者:
Z
zhaoyanggh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change name
上级
e78b1e47
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+16
-16
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
9aae8d37
...
...
@@ -303,7 +303,7 @@ typedef struct SSuperTable_S {
uint64_t
lenOfTagOfOneRow
;
char
*
sampleDataBuf
;
bool
s
ampleTs
;
bool
useS
ampleTs
;
uint32_t
tagSource
;
// 0: rand, 1: tag sample
char
*
tagDataBuf
;
...
...
@@ -2762,8 +2762,8 @@ static int printfInsertMeta() {
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFormat
);
printf
(
" sampleFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
sampleFile
);
printf
(
"
s
ampleTs:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
s
ampleTs
?
"yes"
:
"no"
);
printf
(
"
useS
ampleTs:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
useS
ampleTs
?
"yes"
:
"no"
);
printf
(
" tagsFile:
\033
[33m%s
\033
[0m
\n
"
,
g_Dbs
.
db
[
i
].
superTbls
[
j
].
tagsFile
);
printf
(
" columnCount:
\033
[33m%d
\033
[0m
\n
"
,
...
...
@@ -5708,20 +5708,20 @@ static bool getMetaFromInsertJsonFile(cJSON* root) {
goto
PARSE_OVER
;
}
cJSON
*
sampleTs
=
cJSON_GetObjectItem
(
stbInfo
,
"
sample_ts"
);
if
(
sampleTs
&&
s
ampleTs
->
type
==
cJSON_String
&&
s
ampleTs
->
valuestring
!=
NULL
)
{
if
(
0
==
strncasecmp
(
s
ampleTs
->
valuestring
,
"yes"
,
3
))
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
s
ampleTs
=
true
;
}
else
if
(
0
==
strncasecmp
(
s
ampleTs
->
valuestring
,
"no"
,
2
)){
g_Dbs
.
db
[
i
].
superTbls
[
j
].
s
ampleTs
=
false
;
cJSON
*
useSampleTs
=
cJSON_GetObjectItem
(
stbInfo
,
"use_
sample_ts"
);
if
(
useSampleTs
&&
useS
ampleTs
->
type
==
cJSON_String
&&
useS
ampleTs
->
valuestring
!=
NULL
)
{
if
(
0
==
strncasecmp
(
useS
ampleTs
->
valuestring
,
"yes"
,
3
))
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
useS
ampleTs
=
true
;
}
else
if
(
0
==
strncasecmp
(
useS
ampleTs
->
valuestring
,
"no"
,
2
)){
g_Dbs
.
db
[
i
].
superTbls
[
j
].
useS
ampleTs
=
false
;
}
else
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
s
ampleTs
=
false
;
g_Dbs
.
db
[
i
].
superTbls
[
j
].
useS
ampleTs
=
false
;
}
}
else
if
(
!
s
ampleTs
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
s
ampleTs
=
false
;
}
else
if
(
!
useS
ampleTs
)
{
g_Dbs
.
db
[
i
].
superTbls
[
j
].
useS
ampleTs
=
false
;
}
else
{
errorPrint
(
"%s"
,
"failed to read json, sample_ts not found
\n
"
);
errorPrint
(
"%s"
,
"failed to read json,
use_
sample_ts not found
\n
"
);
goto
PARSE_OVER
;
}
...
...
@@ -6485,7 +6485,7 @@ static int getRowDataFromSample(
}
int
dataLen
=
0
;
if
(
stbInfo
->
s
ampleTs
)
{
if
(
stbInfo
->
useS
ampleTs
)
{
dataLen
+=
snprintf
(
dataBuf
+
dataLen
,
maxLen
-
dataLen
,
"(%s"
,
stbInfo
->
sampleDataBuf
...
...
@@ -6931,7 +6931,7 @@ static int prepareSampleForStb(SSuperTable *stbInfo) {
int
ret
;
if
(
0
==
strncasecmp
(
stbInfo
->
dataSource
,
"sample"
,
strlen
(
"sample"
)))
{
if
(
stbInfo
->
s
ampleTs
)
{
if
(
stbInfo
->
useS
ampleTs
)
{
getAndSetRowsFromCsvFile
(
stbInfo
);
}
ret
=
generateSampleFromCsvForStb
(
stbInfo
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录