Member since
11-16-2015
905
Posts
666
Kudos Received
249
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 510 | 09-30-2025 05:23 AM | |
| 826 | 06-26-2025 01:21 PM | |
| 752 | 06-19-2025 02:48 PM | |
| 935 | 05-30-2025 01:53 PM | |
| 11686 | 02-22-2024 12:38 PM |
06-19-2018
04:47 PM
1 Kudo
ConvertAvroToORC is in the Hive bundle which uses Avro 1.7.7, which does not support logical types such as decimal. This is discussed in NIFI-5079, where it was decided to add support via a PutORC processor in the upcoming Hive 3 bundle (slated for NiFi 1.7.0 and HDF 3.2). If you are using a version of NiFi prior to 1.6.0, then upgrading may help solve the original conversion issue when fetching from SQLServer (via NIFI-4846). However if you're converting to ORC you will still run into the issue above. A workaround might be to store the Avro directly to HDFS and put the Hive table atop the Avro data vs ORC data.
... View more
06-18-2018
06:18 PM
IIRC Jython returns the last thing evaluated, so you shouldn't need a "return" statement? Also the ExecuteScript processor does not (currently) use any return value from a script so you should just be able to let the script finish, and ensure any "return" statements are in function declarations, not the top-level script.
... View more
06-13-2018
01:56 AM
If your custom code can send flow files with attributes containing the source and destination information, you can use FetchS3Object to get the file from S3, then PutFile to put it in a local file share. If your custom code does not use the NiFi API, then consider ExecuteScript with Groovy (specifying your JARs in the Module Directory property) and calling the code from there, or perhaps even ExecuteStreamCommand if you want to (or must) call it from the command line. For the former option, I discuss how to use modules in code in part 3 of my ExecuteScript Cookbook series (and the other parts have related examples).
... View more
06-12-2018
01:47 PM
You're probably better served with MergeRecord, that will output the merged JSON records as an array
... View more
06-06-2018
06:41 PM
2 Kudos
Try this Chain spec in JoltTransformJSON: [
{
"operation": "shift",
"spec": {
"Records": {
"*": {
"Name": {
"tag-master": {
"@2": "Records[&3]"
},
"*": {
"@2": "Records[#3].PayLoad.Children[]"
}
}
}
},
"*": "&"
}
}
] It matches tag-master separately, puts it back into the Records array as-is, then for each tag-detail match, puts it into a Children array in the tag-master's PayLoad object.
... View more
06-01-2018
06:28 PM
MonitorActivity is kind of an "inverse" processor, it does work when nothing's happened. So in your case, MonitorActivity downstream from QueryES would actually generate a flow file when none has been generated from QueryES. This in a sense emulates the behavior of NIFI-3576, by emitting a flow file where there are no query results (after X time has passed, not after the query is complete). Your original question was about empty results, I don't think this would apply when you get Y results but expect Z.
... View more
05-31-2018
08:20 PM
1 Kudo
You are running into NIFI-3576, this will be included in the next release of NiFi (1.7.0). As a workaround, you could try a MonitorActivity processor after QueryESHttp, if its Threshold Duration exceeds the Run Schedule of QueryESHttp (plus any time it would take to complete the query), then it would issue a flow file you could use to route back to QueryESHttp to try again. In this case I believe you'd need to "prime" QueryESHttp with an initial flow file.
... View more
05-30-2018
11:16 PM
1 Kudo
ExecuteScript makes two relationships available, REL_SUCCESS and REL_FAILURE, you can use session.transfer(flowFile, relationship) to do the routing. Check my ExecuteScript Cookbook series (part 1) for examples on how to transfer a flow file. Once you have a boolean or other determining factor on where to route it, you can use the example to do the transfer. If you have multiple relationships, and you can't use RouteOnAttribute due to the conditions being in the content, consider QueryRecord as you can use a SQL statement to do routing on the content. If that doesn't satisfy your use case, you can use InvokeScriptedProcessor to define relationships on the fly, based on some condition (perhaps user-defined properties like RouteOnAttribute and QueryRecord use). Consult the code for these processors for examples on how to implement this with InvokeScriptedProcessor.
... View more
05-30-2018
09:58 PM
Yeah that's true, I misread the first sentence of your question and was thinking conversion to JSON only, my bad
... View more