Member since
11-16-2015
892
Posts
650
Kudos Received
245
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
5640 | 02-22-2024 12:38 PM | |
1386 | 02-02-2023 07:07 AM | |
3079 | 12-07-2021 09:19 AM | |
4200 | 03-20-2020 12:34 PM | |
14144 | 01-27-2020 07:57 AM |
11-28-2018
03:03 PM
Yes please share any workaround / alternate solution if you have one. Looking at the code, PostgreSQL returns OTHER (1111) for JSON and JSONB types, which we don't currently handle when creating a schema, hence the error. I have written NIFI-5845 to cover this improvement.
... View more
09-06-2017
03:30 PM
The first solution works! Thanks @Matt Burgess Here's the RouteOnAttribute configurations.
... View more
10-30-2017
06:23 PM
1 Kudo
In later versions of NiFi, you may also consider using the "record-aware" processors and their associated Record Readers/Writers, these were developed to avoid this multiple-split problem as well as the volume of associated provenance generated by each split flow file in the flow.
... View more
08-29-2017
05:48 PM
@Wesley Bohannon Glad you came up with a solution. Sorry I did not get back to you sooner. Vacation got in the way. 🙂
... View more
08-11-2017
06:17 PM
+1 for an OrcRecordSetWriter
... View more
07-28-2017
01:03 AM
What are some sample values for those parameters? Could they have spaces in them? Perhaps try putting quotes around each of the arguments like "${to}"?
... View more
07-11-2017
07:08 PM
Wow the solution to remove the extra lines was creating a giant bottleneck... Hmm
... View more
06-21-2017
04:33 PM
5 Kudos
The answer in this StackOverflow post refers to documentation saying an array will be returned; this appears to be happening after the JSONPath is evaluated (which is why appending a [0] does not work). The post also implies the answer: in NiFi, you can choose "json" as the Return Type and "flowfile-attribute" as the Destination in EvaluateJsonPath (let's say your dynamic property has key "my.attr" and a value of your JSONPath expression above), then follow that processor with an UpdateAttribute processor, setting "my.attr" to the following: ${my.attr:jsonPath('$[0]')} This will overwrite the original "my.attr" value by hoisting the value out of the array. If you need that value back in the content, you can follow this with a ReplaceText processor to replace the Entire Text with the value of "my.attr".
... View more
06-26-2017
05:05 PM
1 Kudo
Alright, so I ended up with simple script and one processor in NiFi. Modules for reload should be provided in "modules_list" property of the processor (comma delimited). Script body: import sys, json
def class_reloader(modules_to_reload):
reload_msg = ""
all_module_names = sys.modules.keys()
all_module_names.sort()
for mn in all_module_names:
m = sys.modules[mn]
# -- find full match of names with given modules
if mn in modules_to_reload:
try:
reload(m)
reload_msg = reload_msg + mn + "|"
except:
return 1, reload_msg
continue
# -- find if mn is submodule of any given one
for mtr in modules_to_reload:
if mn.startswith(mtr+'.'):
try:
reload(m)
reload_msg = reload_msg + mn + "|"
break
except:
return 1, reload_msg
return 0, reload_msg
#-------------------------------#
flowFile = session.create()
if(flowFile != None):
modules_prop = modules_list.getValue()
ml = []
if modules_prop:
ml = modules_prop.split(',')
cr = class_reloader(ml)
flowFile = session.putAttribute(flowFile, 'class_reload_result', str(cr[0]))
flowFile = session.putAttribute(flowFile, 'class_reload_found', str(cr[1]))
session.transfer(flowFile, REL_SUCCESS)
# implicit return at the end
The code can be improved to navigate to FAILURE relationship in case of non-zero response code from the method. It's not perfect solution, but will work in most cases.
If you have better one - please share! 🙂
... View more
06-21-2017
06:24 PM
I tested this with Arabic characters in my text field, and it worked fine. You're saying you still get the error when using my suggested lines?
... View more