Member since
11-16-2015
890
Posts
649
Kudos Received
245
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
2029 | 02-22-2024 12:38 PM | |
1006 | 02-02-2023 07:07 AM | |
2485 | 12-07-2021 09:19 AM | |
3729 | 03-20-2020 12:34 PM | |
12541 | 01-27-2020 07:57 AM |
03-04-2020
12:20 PM
You can call a REST API from Nashorn/Javascript in ExecuteScript, but since Nashorn doesn't have access to a DOM per se, you'll need to use Java classes for the API call, check this link for an example: https://gist.github.com/billybong/a462152889b6616deb02
... View more
02-14-2020
05:55 AM
For small XML files, you could use ExtractText to get the entire content into an attribute, then UpdateRecord with an XMLReader, adding a property for your new field (let's say "/content") and whatever writer you wish. You will have to specify the output schema for the writer, to include all the fields parsed by the XMLReader in addition to a CLOB/BLOB/String "content" field. If you want to exclude fields from the XML then just exclude them from the output schema. Then you can use a similar Reader (AvroReader if you use an AvroRecordSetWriter, e.g.) in PutDatabaseRecord. If this doesn't work for your use case, you may need to use SplitXml and work on individual records. This will degrade the performance of PutDatabaseRecord unless you merge the records back together later (using MergeRecord for example).
... View more
02-11-2020
06:00 AM
2 Kudos
That error indicates that your CSVReader is not treating the first line as a header, and thus even if you specify an explicit schema, if you don't set Treat First Line As Header to true, the reader will think the header line is a data line, and when it tries to parse it as data (numbers, e.g.) it will fail.
... View more
01-27-2020
07:57 AM
1 Kudo
In NiFi 1.10 we updated Groovy to 2.5.0 (NIFI-5254), which itself moved the date utils out to a module which is not included with groovy-all by default. Due to an oversight, the new module(s) were not included with the Groovy components, causing your script to break. I have written up NIFI-7069 to track the inclusion of this module going forward. In the meantime the blog post I linked to above explains how to use the Java 8 (not GDK) date/time classes instead, not just as a workaround but as an improvement.
... View more
08-09-2019
05:46 PM
If I am reading your use case correctly, I think you're looking for what the ForkRecord processor does; it allows you to fork a (usually single) record into multiple records based on a Record Path (similar to JSONPath but different syntax and expressiveness), possibly keeping the "root" elements common to each outgoing record.
... View more
07-31-2019
07:56 PM
If it works in NiFi 1.5 and not in 1.9.2, then the DBCP libraries probably got updated to DBCP 2, where the latter will call isValid() on the connection if a validation query is not set (see https://sourceforge.net/p/jtds/discussion/104388/thread/bbfbcf24/). Have you set the Validation Query property on the DatabaseConnectionPool? If not, set it to "SELECT 1" and try again, hopefully that will work. If that doesn't, you can try adding a user-defined property called "validationQuery" and set it to "SELECT 1". That should add it as a property on the JDBC connection itself. Another workaround would be to use the official SQL Server driver (although I assume you chose jTDS on purpose).
... View more
07-02-2019
09:37 PM
PutSQL actually doesn't want the semicolon at the end (that's for command-line and other stuff that allow multiple statements), do you get the same error if you leave the semicolon off?
... View more
06-27-2019
05:32 PM
In the script, you're creating a variable `objList` that (for the first input format) points at the top-level array of objects, so you can call max() directly on that array (I think technically it's a List under the hood). In the second input format, objList will be pointing to the top-level object, so you'll need to get the array member `table` out of the object. Update the "def max" line to this: def max = objList.table.max {Date.parse("yyyyMMddHHmmss",it.elem_stand)}
... View more
05-30-2019
02:19 PM
The JsonPath Expression is meant to identify an array, then SplitJson will split each element into its own flow file. Try "$.data" as your JsonPath Expression, and use the "splits" relationship to send things downstream. The "original" relationship will contain the incoming flow file, which doesn't sound like what you want.
... View more
05-29-2019
04:39 PM
In nifi-assembly/target you'll find the built system as you mention, including a "conf" folder that contains (among other things) a file called bootstrap.conf. In that file there's a commented out JVM property to enable attachment by a debugger (the preceding line says "Enable Remote Debugging". When you uncomment that argument and start NiFi, it will listen on port 8000 for a debugger to attach. You can then attach a debugger from your IDE (Eclipse, NetBeans, IntelliJ, etc.). You can change the port and/or set "suspend=y" if you want it to wait until a debugger is attached before continuing startup, the latter is helpful if you are debugging something early in the startup sequence. Otherwise you can wait for NiFi to finish starting up and then attach whenever you like.
... View more