Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dcda885a
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看板
未验证
提交
dcda885a
编写于
1月 10, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
1月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9717 from taosdata/feature/3.0_wxy
TD-12678 datasink to json
上级
99ea015b
867f6ba8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
3 deletion
+34
-3
source/libs/planner/src/physicalPlanJson.c
source/libs/planner/src/physicalPlanJson.c
+34
-3
未找到文件。
source/libs/planner/src/physicalPlanJson.c
浏览文件 @
dcda885a
...
@@ -198,6 +198,29 @@ static bool schemaFromJson(const cJSON* json, void* obj) {
...
@@ -198,6 +198,29 @@ static bool schemaFromJson(const cJSON* json, void* obj) {
return
true
;
return
true
;
}
}
static
const
char
*
jkDataBlockSchemaSlotSchema
=
"SlotSchema"
;
static
const
char
*
jkDataBlockSchemaResultRowSize
=
"resultRowSize"
;
static
const
char
*
jkDataBlockSchemaPrecision
=
"Precision"
;
static
bool
dataBlockSchemaToJson
(
const
void
*
obj
,
cJSON
*
json
)
{
const
SDataBlockSchema
*
schema
=
(
const
SDataBlockSchema
*
)
obj
;
bool
res
=
addRawArray
(
json
,
jkDataBlockSchemaSlotSchema
,
schemaToJson
,
schema
->
pSchema
,
sizeof
(
SSlotSchema
),
schema
->
numOfCols
);
if
(
res
)
{
res
=
cJSON_AddNumberToObject
(
json
,
jkDataBlockSchemaResultRowSize
,
schema
->
resultRowSize
);
}
if
(
res
)
{
res
=
cJSON_AddNumberToObject
(
json
,
jkDataBlockSchemaPrecision
,
schema
->
precision
);
}
return
res
;
}
static
bool
dataBlockSchemaFromJson
(
const
cJSON
*
json
,
void
*
obj
)
{
SDataBlockSchema
*
schema
=
(
SDataBlockSchema
*
)
obj
;
schema
->
resultRowSize
=
getNumber
(
json
,
jkDataBlockSchemaResultRowSize
);
schema
->
precision
=
getNumber
(
json
,
jkDataBlockSchemaPrecision
);
return
fromRawArray
(
json
,
jkDataBlockSchemaSlotSchema
,
schemaFromJson
,
schema
->
pSchema
,
sizeof
(
SSlotSchema
),
&
schema
->
numOfCols
);
}
static
const
char
*
jkColumnFilterInfoLowerRelOptr
=
"LowerRelOptr"
;
static
const
char
*
jkColumnFilterInfoLowerRelOptr
=
"LowerRelOptr"
;
static
const
char
*
jkColumnFilterInfoUpperRelOptr
=
"UpperRelOptr"
;
static
const
char
*
jkColumnFilterInfoUpperRelOptr
=
"UpperRelOptr"
;
static
const
char
*
jkColumnFilterInfoFilterstr
=
"Filterstr"
;
static
const
char
*
jkColumnFilterInfoFilterstr
=
"Filterstr"
;
...
@@ -708,7 +731,7 @@ static bool phyNodeToJson(const void* obj, cJSON* jNode) {
...
@@ -708,7 +731,7 @@ static bool phyNodeToJson(const void* obj, cJSON* jNode) {
res
=
addArray
(
jNode
,
jkPnodeConditions
,
exprInfoToJson
,
phyNode
->
pConditions
);
res
=
addArray
(
jNode
,
jkPnodeConditions
,
exprInfoToJson
,
phyNode
->
pConditions
);
}
}
if
(
res
)
{
if
(
res
)
{
res
=
add
RawArray
(
jNode
,
jkPnodeSchema
,
schemaToJson
,
phyNode
->
targetSchema
.
pSchema
,
sizeof
(
SSlotSchema
),
phyNode
->
targetSchema
.
numOfCols
);
res
=
add
Object
(
jNode
,
jkPnodeSchema
,
dataBlockSchemaToJson
,
&
phyNode
->
targetSchema
);
}
}
if
(
res
)
{
if
(
res
)
{
res
=
addArray
(
jNode
,
jkPnodeChildren
,
phyNodeToJson
,
phyNode
->
pChildren
);
res
=
addArray
(
jNode
,
jkPnodeChildren
,
phyNodeToJson
,
phyNode
->
pChildren
);
...
@@ -728,7 +751,7 @@ static bool phyNodeFromJson(const cJSON* json, void* obj) {
...
@@ -728,7 +751,7 @@ static bool phyNodeFromJson(const cJSON* json, void* obj) {
res
=
fromArray
(
json
,
jkPnodeConditions
,
exprInfoFromJson
,
&
node
->
pConditions
,
sizeof
(
SExprInfo
));
res
=
fromArray
(
json
,
jkPnodeConditions
,
exprInfoFromJson
,
&
node
->
pConditions
,
sizeof
(
SExprInfo
));
}
}
if
(
res
)
{
if
(
res
)
{
res
=
from
RawArray
(
json
,
jkPnodeSchema
,
schemaFromJson
,
node
->
targetSchema
.
pSchema
,
sizeof
(
SSlotSchema
),
&
node
->
targetSchema
.
numOfCols
);
res
=
from
Object
(
json
,
jkPnodeSchema
,
dataBlockSchemaFromJson
,
&
node
->
targetSchema
,
true
);
}
}
if
(
res
)
{
if
(
res
)
{
res
=
fromArray
(
json
,
jkPnodeChildren
,
phyNodeFromJson
,
&
node
->
pChildren
,
sizeof
(
SSlotSchema
));
res
=
fromArray
(
json
,
jkPnodeChildren
,
phyNodeFromJson
,
&
node
->
pChildren
,
sizeof
(
SSlotSchema
));
...
@@ -786,6 +809,7 @@ static bool specificDataSinkFromJson(const cJSON* json, void* obj) {
...
@@ -786,6 +809,7 @@ static bool specificDataSinkFromJson(const cJSON* json, void* obj) {
}
}
static
const
char
*
jkDataSinkName
=
"Name"
;
static
const
char
*
jkDataSinkName
=
"Name"
;
static
const
char
*
jkDataSinkSchema
=
"Schema"
;
static
bool
dataSinkToJson
(
const
void
*
obj
,
cJSON
*
json
)
{
static
bool
dataSinkToJson
(
const
void
*
obj
,
cJSON
*
json
)
{
const
SDataSink
*
dsink
=
(
const
SDataSink
*
)
obj
;
const
SDataSink
*
dsink
=
(
const
SDataSink
*
)
obj
;
...
@@ -793,6 +817,9 @@ static bool dataSinkToJson(const void* obj, cJSON* json) {
...
@@ -793,6 +817,9 @@ static bool dataSinkToJson(const void* obj, cJSON* json) {
if
(
res
)
{
if
(
res
)
{
res
=
addObject
(
json
,
dsink
->
info
.
name
,
specificDataSinkToJson
,
dsink
);
res
=
addObject
(
json
,
dsink
->
info
.
name
,
specificDataSinkToJson
,
dsink
);
}
}
if
(
res
)
{
res
=
addObject
(
json
,
jkDataSinkSchema
,
dataBlockSchemaToJson
,
&
dsink
->
schema
);
}
return
res
;
return
res
;
}
}
...
@@ -800,7 +827,11 @@ static bool dataSinkFromJson(const cJSON* json, void* obj) {
...
@@ -800,7 +827,11 @@ static bool dataSinkFromJson(const cJSON* json, void* obj) {
SDataSink
*
dsink
=
(
SDataSink
*
)
obj
;
SDataSink
*
dsink
=
(
SDataSink
*
)
obj
;
dsink
->
info
.
name
=
getString
(
json
,
jkDataSinkName
);
dsink
->
info
.
name
=
getString
(
json
,
jkDataSinkName
);
dsink
->
info
.
type
=
dsinkNameToDsinkType
(
dsink
->
info
.
name
);
dsink
->
info
.
type
=
dsinkNameToDsinkType
(
dsink
->
info
.
name
);
return
fromObject
(
json
,
dsink
->
info
.
name
,
specificDataSinkFromJson
,
dsink
,
true
);
bool
res
=
fromObject
(
json
,
jkDataSinkSchema
,
dataBlockSchemaFromJson
,
&
dsink
->
schema
,
true
);
if
(
res
)
{
res
=
fromObject
(
json
,
dsink
->
info
.
name
,
specificDataSinkFromJson
,
dsink
,
true
);
}
return
res
;
}
}
static
const
char
*
jkIdQueryId
=
"QueryId"
;
static
const
char
*
jkIdQueryId
=
"QueryId"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录