如何解决NIFI - Jolt 规范 - 连接
我正在尝试连接两个字符串。由于字符串名称包含 .
,因此不会在 concat 表达式中读取该特定字段。
json 输入:
{
"properties": [
{
"test.flu": "flu1","reportId": 11
},{
"test.flu": "flu2","reportId": 12
}
],"type": "node","labels": "label1"
}
震动规格:
[
{
"operation": "modify-default-beta","spec": {
"properties": {
"*": {
"id": "=concat(@(1,test.flu),' ',@(1,reportId))"
}
}
}
}
]
输出:
{
"properties": [
{
"test.flu": "flu1","reportId": 11,"id": " 11" // expected output: "flu1 11"
},"reportId": 12,"id": " 12"
}
],"labels": "label1"
}
由于我的连接字符串有一个句点,它不会读取该字符串。我相信这将是非常小的修复。期待获得帮助。
解决方法
您必须转义 .
字符才能更改其含义:
[
{
"operation": "modify-default-beta","spec": {
"properties": {
"*": {
"id": "=concat(@(1,test\\.flu),' ',@(1,reportId))"
}
}
}
}
]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。