I'm using nifi to process json using Apache NIFI.
This is the input json:
{"key": "C919", "cells": [["year","2017",1497999002676770]]}
I'm using the following jsonpath expression:
$.cells[?(@[0]=='year')][1]
And in evaluatejsonpath processor, I got the following error:
EvaluateJsonPath[id=015c1006-dd8a-1d92-5eb2-9ed9822065f8] Unable to return a scalar value for the expression $['cells'][?][1] for FlowFile 69572. Evaluated value was [1999]. Transferring to failure.
But the return value is a scalar value here, It is 1999. And if I change the json expression to $.cells[?(@[0]=='year')][1][0]. It not allowed and throws error.
EvaluateJsonPath[id=015c1006-dd8a-1d92-5eb2-9ed9822065f8] EvaluateJsonPath[id=015c1006-dd8a-1d92-5eb2-9ed9822065f8] failed to process session due to com.jayway.jsonpath.InvalidPathException: Filter: [0] can only be applied to arrays. Current context is: 1999: com.jayway.jsonpath.InvalidPathException: Filter: [0] can only be applied to arrays. Current context is: 1999
Is it a bug in NIFI?