Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

JoltTransformJSON specification property fails with EL

avatar
Explorer

I am suffering the same problem described here.

I am setting the JoltSpecification property using expression language, but something it's going wrong.

My NiFi version is:

Powered by Apache NiFi - Version 1.5.0.3.1.1.0-35

02/25/2018 20:13:30 UTC

Tagged nifi-1.5.0-RC1


I create a POC with an UpdateAttribute that is creating the attribute 'transformRules' with the value:

[{"operation":"shift","spec":{"*":{"PartNr":"[&1].PartNumber","TcdMakeID":"[&1].Description","TcdCountryCode":"[&1].PartPrice"}}}]

Then I have a JoltTransformJSON processor that uses this attribute as Jolt Specification, and the components looks like this:

74554-screenshot-1.png

74555-screenshot-2.png

74556-screenshot-3.png

ideas about how can I solve this issue?

Thanks in advance.


74555-screenshot-2.png74556-screenshot-3.png74554-screenshot-1.png
1 ACCEPTED SOLUTION

avatar

Hi @Óscar Andreu, thank you for reporting the issue.

I was able to reproduce the issue. By looking at the code, there is a bug in how JoltTransformJSON validates the spec when it contains EL. The processor tries to check if the JoltSpec contains any custom transformation class to fail fast, but it fails to get a JoltSpec because EL can not return a valid spec at the validation phase.

I submitted an Apache JIRA for this and will try to fix it.

https://issues.apache.org/jira/browse/NIFI-5268

Thanks!

View solution in original post

2 REPLIES 2

avatar

Hi @Óscar Andreu, thank you for reporting the issue.

I was able to reproduce the issue. By looking at the code, there is a bug in how JoltTransformJSON validates the spec when it contains EL. The processor tries to check if the JoltSpec contains any custom transformation class to fail fast, but it fails to get a JoltSpec because EL can not return a valid spec at the validation phase.

I submitted an Apache JIRA for this and will try to fix it.

https://issues.apache.org/jira/browse/NIFI-5268

Thanks!

avatar
Explorer

Thank you!