【发布时间】:2021-12-13 18:53:26
【问题描述】:
我正在使用 Apache Nifi 进行 ETL 作业。在我的数据结构中,由于遗留数据,很少有字段为空或空。我想用一些逻辑数据填充它们。数据如下:
[
{
"id": 1234,
"business_date": "2021-11-30",
"order_date_time": "2021-11-30 12:10:45"
},
{
"id": 1,
"business_date": null,
"order_date_time": "2009-10-12 01:02:03"
},
{
"id": 2,
"business_date": "",
"order_date_time": "2007-01-02 03:04:05"
}
]
最终结果应该如下:
[
{
"id": 1234,
"business_date": "2021-11-30",
"order_date_time": "2021-11-30 12:10:45"
},
{
"id": 1,
"business_date": "2009-10-12",
"order_date_time": "2009-10-12 01:02:03"
},
{
"id": 2,
"business_date": "2007-01-02",
"order_date_time": "2007-01-02 03:04:05"
}
]
所以根据order_date_time,需要导出business_day,如果它为null或为空。
我读完了https://nifi.apache.org/docs/nifi-docs/html/record-path-guide.html 一切都是独立的,无法构造解决方案。
使用具有以下详细信息的 UpdateRecord 处理器:
/business_date --> ${field.value:isEmpty():format(/order_date_time, "YYYY-mm-dd")}
但这似乎不起作用
谁能教教如何做到这一点?
【问题讨论】:
-
@daggett - 是的,使用 UpdateRecord 也是如此。仍然没有完全过渡。编辑以上问题 FYR
标签: apache-nifi