如何使用Beam将输入的json(从文件读取)转换为Avro?

时间:2018-10-02 16:35:00

标签: json avro apache-beam

我有一个json文件,需要使用apap Beam转换为Avro。

[{
    "id": 1,
    "username": "mrscarter",
    "email_address": null,
    "phone_number": null,
    "first_name": "Beyonce",
    "last_name": "Knowles-Carter",
    "middle_name": null,
    "sex": null,
    "birthdate": "1981-09-04",
    "join_date": "2016-01-01",
    "previous_logins": 10000,
    "last_ip": "testing"
},

{    
    "id": 2,
    "username": "jayz",
    "email_address": null,
    "phone_number": null,
    "first_name": "Shawn",
    "last_name": "Carter",
    "middle_name": "Corey",
    "sex": null,
    "birthdate": "1969-12-04",
    "join_date": "2016-01-01",
    "previous_logins": 20000,
    "last_ip": null
}]

有人知道怎么做吗?我刚刚开始研究Beam,但在网上找不到很多示例

0 个答案:

没有答案