Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

RouteOnAttribute problem evaluating numeric data

RouteOnAttribute problem evaluating numeric data

New Contributor

62847-nifirouteevaluation.png

I am using EvaluateJsonPath to extract the data associated with a Json file "progress_percentage". The Json value is placed in an attribute ProgressPercentage. I am then trying to use Route on attribute to determine if the progress percentage has reached 100%. I can see the value 100 is extracted in the provenance data, but I can't seem to find the correct expression language to perform the evaluation successfully. The "route" is always failed to match. A Json snippet and the RouteOnAttribute Properties window is attached.

62846-progresspecentagejson.png

3 REPLIES 3

Re: RouteOnAttribute problem evaluating numeric data

Super Guru

@Regis Thomas

Your RouteonAttribute expression looks good and I have recreated/tried your RouteonAttribute expression, all are working as expected.

All extracted attributes are case sensitive in NiFi, make sure your extracted attribute from EvaluateJsonPath processor is ProgressPercentage(case sensitive), and in RouteOnAttribute Processor you are using same extracted attribute for routing.

Here is what i tried:-

InputJson:-

{
 "process_info": {
  "progress_percentage": "100"
 }
}

EvaluateJsonPath configs:-

62851-evaljson.png

ProgressPercentage

$.process_info.progress_percentage

RouteOnAttribute Configs:-

62852-routeonattribute.png

i tried with another expression for sanitize complete property as

${ProgressPercentage:equals(100)}
${ProgressPercentage:toNumber():equals('100')}

Both ways i have routed the input json to sanitizeComplete property.

Re: RouteOnAttribute problem evaluating numeric data

Super Guru

@Regis Thomas

Good to know that :)

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.

Re: RouteOnAttribute problem evaluating numeric data

New Contributor

@Shu Thanks for your reply, I actually had the Destination within EvaluateJsonPath properties wrong. I changed it to flow-file attribute and it is working now.

Don't have an account?
Coming from Hortonworks? Activate your account here