Created 12-19-2022 03:49 AM
Hello All,
I have encountered a rather weird bug with NiFi's SplitJson processor. I am using NiFi 1.18 and it's a three node cluster. I think the best way of explaining it will be to use as example, so here is how to recreate this bug:
I created this flow with the following sequence of steps:
It seems that, for some reason, the copied SplitJson continues operating using the path that it had at the moment of copying and not the one that is present in the settings of the processor. I've checked that after refreshing the view or even the page, the settings of the bottom SplitJson show $.test2.* (so it is not a issue of my browser client not conveying the change to the cluster successfully, as the value stays) and yet the output of the copied SplitJson continuous to be { "A": 1 } instead of { "B": 1 }.
Is this a known issue? If so is there a fix for it?
Perhaps someone could quickly check if this issue is still present on 1.19, we could update our cluster if it was fixed.
Best regards,
Aleksander
Created 12-20-2022 12:06 PM
@AlexLasecki
The issue here is unrelated to the copy and paste action taken. There is a bug in the code where the jsonPath cache is not cleared when the property value is changed after it has been initially set. So the same issue happens even if you do not copy and paste a splitJson processor configured with json path property value. All you need to do is change the json path value after after already having a value set. Original json path property value that is cached still gets used.
The following bug jira has been created and work is already in progress to address the issue.
https://issues.apache.org/jira/browse/NIFI-10998
For now as a workaround, you'll need to create a new SplitJson processor anytime you want to change the json path property value.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt
Created 12-19-2022 11:19 AM
@AlexLasecki
I can reproduce in 1.19.1 as well. Let me look more in to this issue. I'll respond again once I determine issue here.
Thanks,
Matt
Created 12-20-2022 12:06 PM
@AlexLasecki
The issue here is unrelated to the copy and paste action taken. There is a bug in the code where the jsonPath cache is not cleared when the property value is changed after it has been initially set. So the same issue happens even if you do not copy and paste a splitJson processor configured with json path property value. All you need to do is change the json path value after after already having a value set. Original json path property value that is cached still gets used.
The following bug jira has been created and work is already in progress to address the issue.
https://issues.apache.org/jira/browse/NIFI-10998
For now as a workaround, you'll need to create a new SplitJson processor anytime you want to change the json path property value.
If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped.
Thank you,
Matt