Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8e6ba9e7
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8e6ba9e7
编写于
12月 09, 2022
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opti:modify logic for telnet and json in schemaless
上级
bd18da35
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
24 deletion
+34
-24
source/client/src/clientSml.c
source/client/src/clientSml.c
+34
-24
未找到文件。
source/client/src/clientSml.c
浏览文件 @
8e6ba9e7
...
...
@@ -1870,6 +1870,8 @@ static int32_t smlParseTelnetTags(SSmlHandle *info, char *data, char *sqlEnd, SS
tinfo
->
key
=
key
;
nodeListSet
(
&
info
->
childTables
,
key
,
POINTER_BYTES
,
tinfo
);
}
info
->
currTableDataCtx
=
tinfo
->
tableDataCtx
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -2210,8 +2212,15 @@ static int64_t smlParseTSFromJSON(SSmlHandle *info, cJSON *root) {
"timestamp precision can only be seconds(10 digits) or milli seconds(13 digits)"
,
NULL
);
return
-
1
;
}
return
convertTimePrecision
(
timeDouble
,
fromPrecision
,
toPrecision
);
int64_t
tsInt64
=
timeDouble
;
if
(
fromPrecision
==
TSDB_TIME_PRECISION_SECONDS
){
if
(
smlFactorS
[
toPrecision
]
<
INT64_MAX
/
tsInt64
){
return
tsInt64
*
smlFactorS
[
toPrecision
];
}
return
-
1
;
}
else
{
return
convertTimePrecision
(
timeDouble
,
fromPrecision
,
toPrecision
);
}
}
else
if
(
cJSON_IsObject
(
timestamp
))
{
return
smlParseTSFromJSONObj
(
info
,
timestamp
,
toPrecision
);
}
else
{
...
...
@@ -2441,11 +2450,12 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *root, SSmlLineInfo
if
(
unlikely
(
cMeasure
==
NULL
)){
return
TSDB_CODE_TSC_INVALID_JSON
;
}
elements
->
tags
=
(
char
*
)
tags
;
if
(
is_same_child_table_json
(
elements
->
tags
,
info
->
preLine
.
tags
)
==
0
){
cJSON_DeleteItemFromObjectCaseSensitive
(
tags
,
JSON_METERS_NAME
);
return
TSDB_CODE_SUCCESS
;
}
cJSON_DeleteItemFromObjectCaseSensitive
(
tags
,
JSON_METERS_NAME
);
bool
isSameMeasure
=
IS_SAME_SUPER_TABLE
;
...
...
@@ -2558,29 +2568,28 @@ static int32_t smlParseTagsFromJSON(SSmlHandle *info, cJSON *root, SSmlLineInfo
cnt
++
;
}
void
*
oneTable
=
nodeListGet
(
info
->
childTables
,
elements
->
tags
,
POINTER_BYTES
,
is_same_child_table_json
);
if
((
oneTable
!=
NULL
))
{
return
TSDB_CODE_SUCCESS
;
}
SSmlTableInfo
*
tinfo
=
smlBuildTableInfo
(
1
,
elements
->
measure
,
elements
->
measureLen
);
if
(
unlikely
(
!
tinfo
))
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
preLineKV
);
i
++
){
taosArrayPush
(
tinfo
->
tags
,
taosArrayGet
(
preLineKV
,
i
));
}
smlSetCTableName
(
tinfo
);
if
(
info
->
dataFormat
)
{
info
->
currSTableMeta
->
uid
=
tinfo
->
uid
;
tinfo
->
tableDataCtx
=
smlInitTableDataCtx
(
info
->
pQuery
,
info
->
currSTableMeta
);
if
(
tinfo
->
tableDataCtx
==
NULL
){
smlBuildInvalidDataMsg
(
&
info
->
msgBuf
,
"smlInitTableDataCtx error"
,
NULL
);
return
TSDB_CODE_SML_INVALID_DATA
;
SSmlTableInfo
*
tinfo
=
(
SSmlTableInfo
*
)
nodeListGet
(
info
->
childTables
,
elements
->
tags
,
POINTER_BYTES
,
is_same_child_table_json
);
if
(
unlikely
(
tinfo
==
NULL
))
{
tinfo
=
smlBuildTableInfo
(
1
,
elements
->
measure
,
elements
->
measureLen
);
if
(
unlikely
(
!
tinfo
))
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
for
(
int
i
=
0
;
i
<
taosArrayGetSize
(
preLineKV
);
i
++
)
{
taosArrayPush
(
tinfo
->
tags
,
taosArrayGet
(
preLineKV
,
i
));
}
smlSetCTableName
(
tinfo
);
if
(
info
->
dataFormat
)
{
info
->
currSTableMeta
->
uid
=
tinfo
->
uid
;
tinfo
->
tableDataCtx
=
smlInitTableDataCtx
(
info
->
pQuery
,
info
->
currSTableMeta
);
if
(
tinfo
->
tableDataCtx
==
NULL
)
{
smlBuildInvalidDataMsg
(
&
info
->
msgBuf
,
"smlInitTableDataCtx error"
,
NULL
);
return
TSDB_CODE_SML_INVALID_DATA
;
}
}
}
nodeListSet
(
&
info
->
childTables
,
tags
,
POINTER_BYTES
,
tinfo
);
nodeListSet
(
&
info
->
childTables
,
tags
,
POINTER_BYTES
,
tinfo
);
}
info
->
currTableDataCtx
=
tinfo
->
tableDataCtx
;
return
ret
;
}
...
...
@@ -2797,6 +2806,7 @@ static int32_t smlParseJSON(SSmlHandle *info, char *payload) {
stmt
->
pTableBlockHashObj
=
taosHashInit
(
16
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BIGINT
),
true
,
HASH_NO_LOCK
);
continue
;
}
i
++
;
}
return
TSDB_CODE_SUCCESS
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录