Created on 03-25-2024 06:00 AM - edited 03-25-2024 08:14 AM
I am encountering the same issue. I attempted the method you suggested, but it didn't work. I'm trying to copy a table from my MySQL database to my local machine using Apache NiFi. I've configured the 'ConvertRecord' processor and added the 'CSVRecordSetWriter', but I'm still receiving files in JSON format. Can you please guide me if I'm making any mistakes?
Created 03-25-2024 07:30 AM
@sajidkhan Welcome to the Cloudera Community!
To help you get the best possible solution, I have tagged our NiFi experts @steven-matison @MattWho who may be able to assist you furth
Please keep us updated on your post, and we hope you find a satisfactory solution to your query.
Regards,
Diana Torres,Created 03-25-2024 08:08 AM
Thanks @DianaTorres I will wait. hope it they will provide some solution shortly.
Created on 03-25-2024 06:41 PM - edited 03-25-2024 06:42 PM
Hi @sajidkhan ,
Have you actually ran the flowfiles through the ConvertRecord processor? I noticed you have 8 files queued in the ExecuteSQL success relationship. If you open the flowfiles to inspect from there they are going to be in AVRO format since ExecuteSQL will produce such format by defualt. You have to right click the ConvertRecord Processor and select Start to get the files processed through (Keep the Put File processor Stopped) and then under the ConvertRecord success relationship you should have 8 converted flowfiles that you can inspect to see if they got converted to CSV. If the conversion was done accordingly then you can start the PutFile processor to save them to your local drive.
Since you seem to be new to Nifi, I would recommend referring to the following article to understand how Nifi and Nifi processors work:
https://docs.cloudera.com/cfm/2.0.4/nifi-user-guide/topics/nifi-processor_anatomy.html
https://nifi.apache.org/docs/nifi-docs/html/nifi-in-depth.html
https://nifi.apache.org/docs/nifi-docs/html/user-guide.html
https://nifi.apache.org/docs/nifi-docs/html/overview.html
If you find this is helpful please accept solution.
Thanks
Created 03-26-2024 04:09 AM
Hi @SAMSAL actually i just stopped the all processors thats why showing 8 file in Queued. but previously when i was running all processor it was giving me files in my local folder using putfileprocessor, but the issue is the file i am getting in not in csv formate i already show that in the first screenshort, however i use convert record processor.
Created 04-01-2024 07:46 PM
HI @sajidkhan,
I have tried below and seems records are getting successfully converted to csv.
option 1: As samsal suggest we can use the ConvertRecord to convert to specific file format.
option2: just try using the updaterecord processor and add some dummy calculation on it.
Output
Created 04-08-2024 09:14 AM
@sajidkhan Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.
Regards,
Diana Torres,