将PostGreSql的JSON类型同步到ODPS里的String类型,目前的数据集成是不支持,但是可以在字段映射界面用相应的函数做类型转换。
Q: 用户的request列是json类型,将其同步到odps的string类型报下面的问题。

json_col::json#>>'{}'
里的json_col是PostGreSql相应的列名: {
"configuration": {
"reader": {
"plugin": "postgresql",
"parameter": {
"datasource": "l_PostGreSql",
"column": [
"json_col::json#>>'{}'"
],
"where": "",
"splitPk": "",
"table": "public.json_table"
}
},
"writer": {
"plugin": "stream",
"parameter": {
"print": "true"
}
},
"setting": {
"speed": {
"concurrent": "1",
"mbps": "1"
}
}
},
"type": "job",
"version": "1.0"
}
对应的向导模式界面:
关于PostGreSql里的类型转换可以参考文档:
函数转换官方文档 https://www.postgresql.org/docs/current/functions-json.html#FUNCTIONS-JSON-OP-TABLE注意:其他的数据库本身支持相应的函数转换类型也可以根据上面的方法运用在数据集成里。
DataWorks百问百答历史记录
请点击这里查看>>更多DataWorks技术和产品信息,欢迎加入
【DataWorks钉钉交流群】