Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7c8a7280
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看板
提交
7c8a7280
编写于
5月 17, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor:add the configuration of dataFormat
上级
63602094
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
4 deletion
+12
-4
include/common/tglobal.h
include/common/tglobal.h
+1
-0
source/client/src/clientSml.c
source/client/src/clientSml.c
+8
-4
source/common/src/tglobal.c
source/common/src/tglobal.c
+3
-0
未找到文件。
include/common/tglobal.h
浏览文件 @
7c8a7280
...
...
@@ -127,6 +127,7 @@ extern bool tsStartUdfd;
// schemaless
extern
char
tsSmlChildTableName
[];
extern
bool
tsSmlDataFormat
;
// internal
extern
int32_t
tsTransPullupInterval
;
...
...
source/client/src/clientSml.c
浏览文件 @
7c8a7280
...
...
@@ -166,7 +166,7 @@ typedef struct {
SMLProtocolType
protocol
;
int8_t
precision
;
bool
dataFormat
;
// true means that the name
, number
and order of keys in each line are the same(only for influx protocol)
bool
dataFormat
;
// true means that the name and order of keys in each line are the same(only for influx protocol)
SHashObj
*
childTables
;
SHashObj
*
superTables
;
...
...
@@ -1422,7 +1422,7 @@ static void smlDestroyInfo(SSmlHandle* info){
taosMemoryFreeClear
(
info
);
}
static
SSmlHandle
*
smlBuildSmlInfo
(
TAOS
*
taos
,
SRequestObj
*
request
,
SMLProtocolType
protocol
,
int8_t
precision
,
bool
dataFormat
){
static
SSmlHandle
*
smlBuildSmlInfo
(
TAOS
*
taos
,
SRequestObj
*
request
,
SMLProtocolType
protocol
,
int8_t
precision
){
int32_t
code
=
TSDB_CODE_SUCCESS
;
SSmlHandle
*
info
=
(
SSmlHandle
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SSmlHandle
));
if
(
NULL
==
info
)
{
...
...
@@ -1454,7 +1454,11 @@ static SSmlHandle* smlBuildSmlInfo(TAOS* taos, SRequestObj* request, SMLProtocol
info
->
precision
=
precision
;
info
->
protocol
=
protocol
;
info
->
dataFormat
=
dataFormat
;
if
(
protocol
==
TSDB_SML_LINE_PROTOCOL
){
info
->
dataFormat
=
tsSmlDataFormat
;
}
else
{
info
->
dataFormat
=
true
;
}
info
->
pRequest
=
request
;
info
->
msgBuf
.
buf
=
info
->
pRequest
->
msgBuf
;
info
->
msgBuf
.
len
=
ERROR_MSG_BUF_DEFAULT_SIZE
;
...
...
@@ -2335,7 +2339,7 @@ TAOS_RES* taos_schemaless_insert(TAOS* taos, char* lines[], int numLines, int pr
return
NULL
;
}
SSmlHandle
*
info
=
smlBuildSmlInfo
(
taos
,
request
,
(
SMLProtocolType
)
protocol
,
precision
,
true
);
SSmlHandle
*
info
=
smlBuildSmlInfo
(
taos
,
request
,
(
SMLProtocolType
)
protocol
,
precision
);
if
(
!
info
){
return
(
TAOS_RES
*
)
request
;
}
...
...
source/common/src/tglobal.c
浏览文件 @
7c8a7280
...
...
@@ -79,6 +79,7 @@ uint16_t tsTelemPort = 80;
// schemaless
char
tsSmlChildTableName
[
TSDB_TABLE_NAME_LEN
]
=
""
;
//user defined child table name can be specified in tag value.
//If set to empty system will generate table name using MD5 hash.
bool
tsSmlDataFormat
=
true
;
// true means that the name and order of cols in each line are the same(only for influx protocol)
// query
int32_t
tsQueryPolicy
=
1
;
...
...
@@ -324,6 +325,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddBool
(
pCfg
,
"keepColumnName"
,
tsKeepOriginalColumnName
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"queryPolicy"
,
tsQueryPolicy
,
1
,
3
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddString
(
pCfg
,
"smlChildTableName"
,
""
,
1
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"smlDataFormat"
,
tsSmlDataFormat
,
1
)
!=
0
)
return
-
1
;
tsNumOfTaskQueueThreads
=
tsNumOfCores
/
4
;
tsNumOfTaskQueueThreads
=
TRANGE
(
tsNumOfTaskQueueThreads
,
1
,
2
);
...
...
@@ -518,6 +520,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
}
tstrncpy
(
tsSmlChildTableName
,
cfgGetItem
(
pCfg
,
"smlChildTableName"
)
->
str
,
TSDB_TABLE_NAME_LEN
);
tsSmlDataFormat
=
cfgGetItem
(
pCfg
,
"smlDataFormat"
)
->
bval
;
tsShellActivityTimer
=
cfgGetItem
(
pCfg
,
"shellActivityTimer"
)
->
i32
;
tsCompressMsgSize
=
cfgGetItem
(
pCfg
,
"compressMsgSize"
)
->
i32
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录