Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Is it possible to create a table in mysql using nifi, the data comes in excel from?

Solved Go to solution
Highlighted

Is it possible to create a table in mysql using nifi, the data comes in excel from?

Contributor

Hi,

  I did nifi and mysql setup in stand alone machine, where I have scenario the input will be in excel form, i need to create table in mysql db.

I have seen processors where we can do UPDATE, INSERT, or DELETE SQL, does create will be possible?

 

Also Do I need to write custom processor to extract the column names from the excel?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Is it possible to create a table in mysql using nifi, the data comes in excel from?

Master Collaborator

@murali2425  It sure is possible.  I believe anything is possible in NiFi!!   The excel processor is: ConvertExcelToCSVProcessor 

 

I have also put an Excel to SQL template on my GitHub:

https://github.com/steven-dfheinz/NiFi-Templates

 

This template gets an excel file that contains product inventory data (sku, name, price, description, quantity, etc and routes the contents of the excel file to ConvertsExceltoCSV.  Then it splits the csv file line by line, parses each line for quantity and sku and uses those attributes to build an insert query, which is finally executed via PutSQL.

 

There are many different ways to deliver the Excel file too ConvertExceltoCsv, different ways to process the CSV, and different ways to insert into SQL.  The above is just one way I have used in the past.

 

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven @ DFHZ

View solution in original post

2 REPLIES 2

Re: Is it possible to create a table in mysql using nifi, the data comes in excel from?

Master Collaborator

@murali2425  It sure is possible.  I believe anything is possible in NiFi!!   The excel processor is: ConvertExcelToCSVProcessor 

 

I have also put an Excel to SQL template on my GitHub:

https://github.com/steven-dfheinz/NiFi-Templates

 

This template gets an excel file that contains product inventory data (sku, name, price, description, quantity, etc and routes the contents of the excel file to ConvertsExceltoCSV.  Then it splits the csv file line by line, parses each line for quantity and sku and uses those attributes to build an insert query, which is finally executed via PutSQL.

 

There are many different ways to deliver the Excel file too ConvertExceltoCsv, different ways to process the CSV, and different ways to insert into SQL.  The above is just one way I have used in the past.

 

 

 


 


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  


 


Thanks,



Steven @ DFHZ

View solution in original post

Highlighted

Re: Is it possible to create a table in mysql using nifi, the data comes in excel from?

Contributor

great and Thanks it was very useful for my work.

 

Here I will be having data in the excel, I need to extract the column names(1st row) and form the create the table with primary key and foreign key  and data(2nd row) in the database(mysql) from nifi.

Don't have an account?
Coming from Hortonworks? Activate your account here