Member since
11-16-2015
911
Posts
668
Kudos Received
249
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 697 | 09-30-2025 05:23 AM | |
| 1070 | 06-26-2025 01:21 PM | |
| 929 | 06-19-2025 02:48 PM | |
| 1100 | 05-30-2025 01:53 PM | |
| 12259 | 02-22-2024 12:38 PM |
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
05-30-2018
03:39 AM
Are your files still in the source directory? GetFile defaults to removing the files you specify, so if something went wrong you might not have those files anymore, you'd need to set Keep Source File to true in that case (as Matt Clarke recommended). That's why the recommended option is ListFile->FetchFile, as it will keep track of the files it's seen and not fetch those again.
... View more
05-30-2018
03:06 AM
Adding to Bryan's answer, if you have the schema available to put in the registry, you can set it to Validate Field Names to false, meaning you could have field names defined in the Avro schema that do not conform to the stricter Avro rules. We should consider adding this property to readers that generate their own schema, such as CSVReader...
... View more
05-29-2018
05:31 PM
InferAvroSchema should have Schema Output Destination set to "flowfile-attribute", the outgoing flow file should contain the CSV data and an attribute called "inferred.avro.schema" which contains the schema to use. Then in ConvertCSVToAvro you can set the Record Schema property to "${inferred.avro.schema}" which will cause it to use the inferred schema for conversion. Since you are entering the CSV Header Definition manually, you may find it more helpful to create an Avro schema manually and use ConvertRecord instead of InferAvroSchema -> ConvertCSVToAvro. If you don't know the datatypes of the columns and are thus relying on InferAvroSchema to do that for you, you could still use ConvertRecord instead of ConvertCSVToAvro.
... View more
05-29-2018
05:03 PM
The HiveConnectionPool is a special type of DBCPConnectionPool, so instances of it get listed with all the others, as it is not the connection pool that doesn't support the operations, but the driver itself. What format is the input data in? You should be able to use ConvertRecord with a FreeFormTextWriter to generate SQL from your input data (don't forget the semicolon at the end of the line), then you can send that to PutHiveQL.
... View more