nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Lagemann <sebast...@wearerealitygames.com>
Subject how to update nifi to the latest jolt version?
Date Thu, 10 Nov 2016 18:00:41 GMT
Hello,

I’m trying to use the latest jolt specification, especially the operation "modify-overwrite-beta“,
introduced with jolt version 0.0.22. It seems that currently only version 0.0.21 is used by
nifi (see nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/pom.xml). I tried
to update to the latest jolt version (from 0.0.21 to 0.0.24) in the corresponding pom.xml
and packaged the whole package (after I removed one failing test in nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/StandardHttpResponseMapperSpec.groovy,
not the way to go but need some fast results :-)).
Nifi is using the new .nar file but unfortunately the jolt processor is still complaining
that the jolt specification is invalid (see below).

Does anyone has a hint/idea how to use the latest jolt version, I had already in mind of extracting
the processor from the nifi standard bar bundle and create a new named processor for testing,
but I guess there must be an easier solution?

The jolt spec I’m using:
[
  {
    "operation": "modify-overwrite",
    "spec": {
      "lastElementOfType": "=lastElement(@(1,type))"
    }
  },
  {
    "operation": "shift",
    "spec": {
      "value": "@(1,lastElementOfType)",
      "_meta": {
        "appId": "appId",
        "userId": "userId"
      }
    }
  }
]

The data I’m using:
  {
    "type":["user","profile","personalInfo", "firstName"],
    "value":"testname",
    "_meta":{"appId":"test","userId":"56c1614b677c35cc3f28fbd0"}
  }

The expected flow file content afterwards:
{
  "appId" : "test",
  "firstName" : "testname",
  "playerId" : "56c1614b677c35cc3f28fbd0"
}

The jolt demo from http://jolt-demo.appspot.com/#inception <http://jolt-demo.appspot.com/#inception>
delivers the expected results.

Thanks,

Sebastian


Mime
View raw message