meta文件写入kafkajson数据出现ascii码
chenzhang88 opened this issue · 1 comments
meta.txt:
id||int||自增id[:inc(id,1)]
name||varchar(20)||学生名字[:name]
school||varchar(20)||学校名字[:enum(file:///home/redhat/zc/pythonstudy/names.txt)]
nickname||varchar(20)||学生小名[:enum(鬼泣, 高小王子, 歌神, 逗比)]
age||int||学生年龄[:age]
class_num||int||班级人数[:int(10, 100)]
score||decimal(4,2)||成绩[:decimal(4,2,1)]
phone||bigint||电话号码[:phone_number]
email||varchar(64)||家庭网络邮箱[:email]
ip||varchar(32)||IP地址[:ipv4]
address||text||家庭地址[:address]
为示例meta.data
生成数据示例:
{"id": 10, "name": "\u5f20\u5e73", "school": "\u8001\u548c\u5c71\u6280\u672f\u5b66\u6821", "nickname": "\u6b4c\u795e", "age": 11, "class_num": 98, "score": 88.67, "phone": "15684790138", "email": "owei@hotmail.com", "ip": "203.0.97.31", "address": "\u5c71\u4e1c\u7701\u79c0\u534e\u5e02\u6c99\u5e02\u6d77\u53e3\u8857r\u5ea7 834889"}
已修复:
修改utils.py 中的 json.dumps(map)
为
json.dumps(map, ensure_ascii=False)