我有被設計成拉使用GET微處理器鳴叫的流動和我使用JOLTTransformJSON處理器以提取幾個屬性,包括主題標籤,我的顛簸規格如下阿帕奇Nifi JOLTTransformJSON處理器
[
{
"operation": "shift",
"spec": {
"entities": {
"hashtags": {
"*": "hashtags"
}
},
"text": "content",
"id": "id",
"timestamp_ms": "timestamp",
"retweet_count": "retweetcount",
"url": "url"
}
},
{
"operation": "default",
"spec": {
"type": "twitter"
}
},
{
"operation": "cardinality",
"spec": {
"hashtags": "MANY"
}
}
]
時鳴叫聲輸出包含主題標籤的JOLTTransformJSON處理器輸出給我那些#標籤以如下方式
{
"hashtags": [{
"text": "Venus",
"indices": [16,
22]
},
{
"text": "Cancer",
"indices": [69,
76]
},
{
"text": "ascendant",
"indices": [86,
96]
}],
"content": "acmc_clock_euro #Venus is now (16h58m01s UT) setting at 10°32'50.2'' #Cancer opposite #ascendant at Helsinki, SF",
"id": 895332436975931393,
"timestamp": "1502298862104",
"retweetcount": 0,
"url": "https://twitter.com/pe602/status/895332436975931393",
"type": "twitter"
}
但如果主題標記數組爲空如下
"entities": {
"hashtags": []
輸出將不會包含井號標籤,如何使輸出具有井號標籤元素,但是如果twitter操作沒有使用JOLT處理器的井號標籤,則爲空數組。
謝謝,但它沒有按預期工作。 –