Member since
11-16-2015
885
Posts
645
Kudos Received
244
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
500 | 02-02-2023 07:07 AM | |
1722 | 12-07-2021 09:19 AM | |
3053 | 03-20-2020 12:34 PM | |
10370 | 01-27-2020 07:57 AM | |
3464 | 08-09-2019 05:46 PM |
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
05-24-2019
02:37 AM
2 Kudos
You were so close! By using the [] syntax it just adds to the outgoing array, but you wanted to associate them with the same index, namely the one matched by the * "above" the fields. Put #2 inside your braces (#2 is a reference to the array index you're iterating over, "two levels up" from where you are in the spec): [{
"operation": "shift",
"spec": {
"nummer": "Nummer",
"table": {
"*": {
"zn": "Positionen.[#2].ZeileNr",
"datum": "Positionen.[#2].Datum"
}
}
}
}]
... View more
05-10-2019
06:18 PM
1 Kudo
To address your comment below, I missed the part where you want to call the outgoing field "color". Change this line (8): "$": "colorsLove[].&2" To this: "$": "colorsLove[].color"
... View more
05-10-2019
04:27 PM
1 Kudo
This Chain spec will add the hardcoded value 20190905 into the array (after removing empty values): [
{
"operation": "shift",
"spec": {
"color_*": {
"": "TRASH",
"*": {
"$": "colorsLove[].&2"
}
},
"*": "&"
}
},
{
"operation": "shift",
"spec": {
"colorsLove": {
"*": {
"#20190905": "colorsLove[#2].date",
"*": "colorsLove[#2].&"
}
},
"*": "&"
}
},
{
"operation": "remove",
"spec": {
"TRASH": ""
}
}
] You should be able to replace "#20190905" with a NiFi Expression Language statement, maybe something like: "#${now:toNumber():format('yyyyddMM')}" ... but I didn't try that part.
... View more
05-07-2019
01:58 PM
1 Kudo
What does the generated SQL coming from ConvertJSONToSQL look like? Are the fields correctly uppercased? Does your database lowercase the column names? Did you try setting the "Translate Field Names" property to "true" in ConvertJSONToSQL? Does the case of the table name in the SQL match the case of the table name in the DB? If you're using "dbo.xxxx" as the Table Name property in ConvertJSONToSQL, instead try using just "xxxx" as the Table Name, and setting either Catalog Name or Schema Name (depending on your DB) to "dbo" (or DBO if necessary).
... View more
05-07-2019
01:37 PM
You should be able to use SplitXml -> PutHDFS, using the Split Depth property to specify where to do the tag splitting. Each tag at that depth will be output as a separate flow file which you can send to HDFS via the PutHDFS processor. You may need to use UpdateAttribute to set the filename attribute, which is used by PutHDFS as the target filename.
... View more