实时场景:增量的标志是mongodb里的一个字段为createtime,每次导入的数据范围是业务时间00:00到业务时间23:59 * {createtime :{$gte:ISODate("unknownT00:00:00.000+0800"),$lte:ISODate("unknownT23:59:59.999+0800")}}
注意:
* 1.不支持时间戳
* 2.query 可结合调度参数同步使用
* 3.详情请参见MongoDB查询语法。——此答案整理自钉群“DataWorks交流群(答疑@机器人)”
同步mongon表,按时间增量同步。
{
"type": "job",
"version": "2.0",
"steps": [
{
"stepType": "mongodb",
"parameter": {
"datasource": "mongo_member",
"envType": 0,
"cursorTimeoutInMs": "600000",
"query": "{'reportTimeStr':{'$gte':ISODate('${last_day}T00:00:00.424+0800')}}",
"column": [
{
"name": "_id",
"type": "string"
},
{
"name": "_class",
"type": "string"
},
{
"name": "did",
"type": "string"
},
{
"name": "stage",
"type": "string"
},
{
"name": "platform",
"type": "string"
},
{
"name": "channel",
"type": "string"
},
{
"name": "appVersion",
"type": "string"
},
{
"name": "reportWay",
"type": "string"
},
{
"name": "reportTime",
"type": "long"
},
{
"name": "reportTimeStr",
"type": "string"
},
{
"name": "reportDate",
"type": "string"
}
],
"tableComment": "This kind of datasource dosen't support get table comment. This is a comment produced by di.",
"batchSize": "1000",
"collectionName": "device_install_app_info"
},
"name": "Reader",
"category": "reader"
},
{
"stepType": "odps",
"parameter": {
"partition": "dt=${bizdate}",
"truncate": true,
"datasource": "odps_first",
"envType": 0,
"column": [
"id",
"class",
"did",
"stage",
"platform",
"chanel",
"appversion",
"reportway",
"reporttime",
"reporttimestr",
"reportdate"
],
"emptyAsNull": false,
"table": "ods_lx_mg_member_device_install_app_info"
},
"name": "Writer",
"category": "writer"
}
],
"setting": {
"errorLimit": {
"record": ""
},
"speed": {
"throttle": false,
"concurrent": 2
}
},
"order": {
"hops": [
{
"from": "Reader",
"to": "Writer"
}
]
}
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
DataWorks基于MaxCompute/Hologres/EMR/CDP等大数据引擎,为数据仓库/数据湖/湖仓一体等解决方案提供统一的全链路大数据开发治理平台。