Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

JoltTransformJSON won't allow attribute / EL

Contributor

According to JoltTransformJSON documentation, the JoltSpecification properties supports Expression Language.

21417-jolt-transform-json.png

What I want is to use the FlowFile attribute containing the Jolt spec.

21418-jolt-transform-json-2.png

Unfortunately, this is invalid as signified by the caution symbol.

21419-jolt-transform-json-3.png

Is using attribute for Jolt specification property allowed?

3 REPLIES 3

Super Guru

What version of NiFi/HDF are you using? There was a validation bug (NIFI-3708) that was fixed in NiFi 1.2.0 / HDF 3.0. If that's not the cause, where are you setting the 'myattr' attribute? Is it possible the attribute can evaluate to empty in some cases? Please share screenshots/etc. of your flow and I will take a closer look, thanks!

Contributor

Yea, it looks like I'm using an older version that does not have that feature. The documentation I'm looking at is version 1.3.0.

Explorer

I am facing exactly the same problem.

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.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.