Member since
07-29-2020
574
Posts
318
Kudos Received
175
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
37 | 12-20-2024 05:49 AM | |
44 | 12-19-2024 08:33 PM | |
83 | 12-19-2024 06:48 AM | |
97 | 12-17-2024 12:56 PM | |
100 | 12-16-2024 04:38 AM |
06-16-2022
06:29 AM
The way PutDatabaseRecord works is basically once it reads the json , it will try to match the json keys to the DB columns hence the error you are getting if not being able to map fields to columns, in your case it will be looking for columns: name & surename to store their values, so it wont store the whole json in one field. I had similar situation where I needed to store json and the only way I can think of is first load the json into an attribute using the ExtractText Processor, then use PutSQL processor and write the insert statement to the target table where the column is the Data and the value is the attribute contain the json value for example ${JsonDataAttribute}. You have to be careful how big your json is, if its too big then you have to figure out another way, but if its small then no harm from saving into an attribute.
... View more
06-16-2022
05:55 AM
Hi, Can you explain what happen when you use the PutDatabaseRecrod Processor?
... View more
06-15-2022
05:59 AM
Hi, It could be an encoding issue that I faced a while back. please check out this post: https://community.cloudera.com/t5/Support-Questions/Illegal-Arg-Exception-when-parsing-CSV-file-though-the-split/td-p/300565 Try to change the character set to UTF-16 to see if that will work. Hope that helps. Thanks
... View more
06-14-2022
10:06 AM
first you need to check if there is an attribute called filename on the original flowfile and its the same passed the output stream flowfile. If there is, then you should specify it as "filename" in the merge content property and NOT as "${filename}".
... View more
06-14-2022
07:42 AM
how is the original flowfile is generated. usually you should have filename attribute set by default on the original flowfile. this should be unique for the flowfile and this filename could be passed to the output stream, can you check that?
... View more
06-14-2022
06:59 AM
Is there a unique attribute on the original flowfile (like filename) that gets set on the output stream ? if so, you can set the mergeContent processor property "Correlation Attribute Name" to the attribute containing the unique value that is shared between original and output, this way you guarantee that only related original and output are getting merged.
... View more
06-14-2022
06:01 AM
Hi, Not sure I fully understand your question. Can you please provide screenshot of the flow you have and explain the expected output of each processor? From what I can understand you want to keep the original file but somehow you want to attach the output of the command stream to it. There is property on the ExecuteCommandStream Processor called "Output Destination Attribute" where you can store the output stream as an attribute on the original flow file. if you want to modify the content of the flow file after that based on the new attribute then you can use ExecuteScript Processor.
... View more
06-12-2022
06:03 AM
Hi, Can you give an example? I think if the url in the flowfile content you can use ExtractText processor where you can create dynamic property and use regex to extract the pattern you need. If the url in an attribute then you can use UpdateAttribute where you can also create dynamic property and use Expression Language function like find(regex) to extract the domain for a given attribute. Example ${FullUrl.find(regex)}. To set the regex for finding domain from url, checkout this link: https://regex101.com/r/jN6kU2/1
... View more
06-10-2022
02:46 PM
1 Kudo
Hi, regarding the first point I dont think you can do that through regex, this is more of transformation operation and you might need to use JsonJolt Processor to do transromation first to simplify the json and store all id's in an array then use regular expression to extract the ids. It will complicate matter it might affect performance. What kind of SQL are you using ? Do you have any json functions in that sql? If that is the case I would recommend you deffer this process to SQL and utilize sql function to parse json. For example in MS SQL you can use OPENJSON function to transpose json into table and then you can use this table in your query. For the second point, this is because the way the extractText reg expression work it treats like group, so beside the main attribute you will get an indexed attribute for each matched group. You can read more about this here: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ExtractText/index.html You can also use this post to see if you can extract one attirbute. I just found about it: https://community.cloudera.com/t5/Support-Questions/Extract-whole-json-flowfilecontent-small-to-single-attribute/m-p/308960
... View more
06-10-2022
12:35 PM
1 Kudo
Hi, If I understood your question correctly, you want to place the file content into an attribute and store it in sql? If that is the case you can use ExtractText Processor. there you add dynamic property lets call it "IdArray" and set the regular expression to "(?s)(^.*$)" to capture everything in the file. Just be careful there is a size limit set of 1 MB to be captured if you think your data will be more then you can increase it. Hope that helps, if so please accept solution. Thanks
... View more