Skip to content

http-x插件问题(已经解决,代码合并到了master分支了) #1497

@taoyameng

Description

@taoyameng

Search before asking

  • I had searched in the issues and found no similar question.

  • I had googled my question but i didn't get any help.

  • I had read the documentation: ChunJun doc but it didn't help me.

Description

根据chunjun文档里的http插件示例,使用sql模式运行,出错了,调试了半天暂时没有找到原因,下面是sql脚本和http接口的返回值信息

CREATE TABLE source
(
name VARCHAR,
age int,
sex varchar,
hobby varchar
)
WITH (
'connector' = 'http-x',
'url' = 'http://192.168.14.236:8090/test/test',
'intervalTime' = '3000',
'method' = 'get',
'decode' = 'json',
'dataSubject' = '${data}',
'fields' = 'name,age,sex,hobby',
'column' = '[
{
"name": "name",
"type": "string"
},
{
"name": "age",
"type": "int"
},
{
"name": "sex",
"type": "string"
},
{
"name": "hobby",
"type": "string"
}
]'
);
CREATE TABLE sink
(
name VARCHAR,
age int,
sex varchar,
hobby varchar
) WITH (
'connector' = 'stream-x'
);
INSERT INTO sink
SELECT *
FROM source u;

下面是http接口的返回值
{
"code":"0000",
"msg":"请求成功",
"data":[
{
"sex":"男",
"name":"臭桑",
"age":24,
"hobby":"打游戏"
}
],
"timestamp":"2023-02-09 13:28:39",
"total":0
}

最后是报错信息
image
其中 converter.toInternal(data) 这个方法接收的是string类型的参数,但是传递的是map

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions