我想要按日期篩選 AWS Database Migration Service (AWS DMS) 任務。
解決方法
若要按日期篩選 AWS DMS 任務,請使用資料表對應。輸入資料表對應時,請使用下列其中一個值作為 filter-operator 參數:
- **lte:**小於或等於一個值
- **ste:**小於或等於一個值 (lte 別名)
- **gte:**大於或等於一個值
- **eq:**等於一個值
- **noteq:**不等於一個值
- **between:**等於兩個值或介於兩者之間
- **notbetween:**不等於兩個值或介於兩者之間
下列 JSON 範例篩選條件使用 gte 和 date_of_record >= 2019-01-08:
{
"rules": [
{
"rule-type": "selection",
"rule-id": "1",
"rule-name": "1",
"object-locator": {
"schema-name": "testonly",
"table-name": "myTable_test"
},
"rule-action": "include",
"filters": [
{
"filter-type": "source",
"column-name": "date_of_record",
"filter-conditions": [
{
"filter-operator": "gte",
"value": "2019-01-08"
}
]
}
]
}
]
}
注意: 匯入資料時,AWS DMS 會使用日期格式 YYYY-MM-DD 和時間格式 YYYY-MM-DD HH:MM:SS 進行篩選。
相關資訊
使用資料表對應來指定任務設定
使用來源篩選條件
按時間和日期篩選