Nifi - Ingest text file into flowfiles and put them into a mySQL table

Поділитися
Вставка
  • Опубліковано 26 лис 2024

КОМЕНТАРІ • 64

  • @StevenKoon
    @StevenKoon  3 роки тому +7

    If you found this video helpful for learning about Nifi and ingesting text files. Then consider subscribing to the channel and getting notified about more video’s.
    Also feel free to leave a comment!

    • @samantr
      @samantr 3 роки тому

      This is great Steve . A few questions
      1. Can you please make this template available in your github ?
      2. If we want to add additional attributes into the SQL via another constant csv file (eg. systemName ="ABC") or replace a parameter in the json before its converted to SQL, how can we do ? An advanced version of this tutorial might be very helpful.
      Thanks a lot for this !

  • @pukar67
    @pukar67 2 роки тому +2

    Does it only support row by row insert or update? How to implement bulk inserts though db specific load utilities?
    Would you please help?

  • @Mrsantoshbr4
    @Mrsantoshbr4 3 роки тому +1

    Tutorial helped me to fix a trivial bug in my processor configuration. Thanks Steven!!.

  • @annabeatriza83
    @annabeatriza83 3 роки тому +1

    I love this tutorial, it is so well explained and detailed :) I would love to see a video on how to read a fixed width file using Nifi, as I'm struggling with this assignment at work!

  • @bigoper
    @bigoper 2 роки тому +1

    What a great video! Thank you!

  • @greatjobbuddy
    @greatjobbuddy 3 роки тому +1

    So So So helpful. Thanks for making this.

  • @radko123ful
    @radko123ful Місяць тому

    Good work. But is possible to group multple sql operation in one single databse transaction ? Example: First delete all records from table, next insert multiple records ? Any bad insert rollback delete and previous inserts ?

  • @gauravpande602
    @gauravpande602 3 роки тому +3

    It was an amazing tutorial. Thanks Steven !!

    • @StevenKoon
      @StevenKoon  3 роки тому +1

      Thank you! It's been great to see it so helpful to everyone.

  • @alanmejia6375
    @alanmejia6375 4 роки тому +1

    Thanks a lot Steven! You are making a great Job.

  • @osmanAnalytics
    @osmanAnalytics Рік тому +1

    Thank you for your videos!

  • @fedesardo
    @fedesardo 3 роки тому +2

    Thanks for the tutorial, just starting with nifi. Could you please share a link to pull all the csv files? Regards from Argentina

    • @StevenKoon
      @StevenKoon  3 роки тому +1

      Sorry about this. That was one of the first video's I did. It was before I started to include the resources in my Git repo. Let me see about doing a different video on txt files and I will make sure to include the resources and Nifi template for download.

  • @arpankhetani7818
    @arpankhetani7818 2 роки тому +1

    Hello Steven, your videos on Apache Nifi are very interesting and helpful , I was trying to understand Apache Nifi to AWS , using api request processor InvokeAWSGatewayApi , but cant send a file in post request . . Can you make a video on sending api requests to aws , and specially covering sending files via API request.

  • @AnandKumar-dc2bf
    @AnandKumar-dc2bf 3 роки тому +2

    Amazing content Steven 👌

  • @rafaeldelgado7860
    @rafaeldelgado7860 3 роки тому

    Awesome demo! Thanks for sharing!

    • @StevenKoon
      @StevenKoon  3 роки тому

      It's great that the video was helpful.

  • @Maksim77ster
    @Maksim77ster 4 роки тому +2

    First of all thanks for this video!
    And I also had a question.
    Why not use a processor "PutDatabaseRecord" for the same purposes? It seems to me that it looks much more logical and easier to understand.

    • @StevenKoon
      @StevenKoon  4 роки тому +3

      I use "PutDatabaseRecord" all the time for my dataflows. Just depends on what I'm doing with the flowfiles as well. I thought I had already covered it in a video. I'll look to get it in one of my next couple of videos. Thanks for asking about it.

  • @nunosilva2128
    @nunosilva2128 3 роки тому +1

    Thanks for the tutorial...but I have a question...I have a executeSQL processor to get records from a table with a timestamp of the latest 10 minutes...this outputs do n flowfiles (1 row per flowfile)...I I run this processor every 5m (so I get a overlap of records, intended)....after that, I pickup those flowfiles and convert them from avro2json, then json2sql and send them to a putSQL processor to another database...I was expecting that the putSQL considered a flowfile as a transaction, in case of a flowfile data was already in the destination database, it discarded, moved to the next flowfile, extracted the data and try the INSERT INTO tablename...but if I have 3 flowfiles, with different data, only 1 flowfile data already in destination database, it fails all 3 flowfiles data insert...any hint/tip?

    • @StevenKoon
      @StevenKoon  3 роки тому

      Nuno Silva, If possible I would check /logs/nifi-app.log and see what the reason is that it give you for why the flowfiles were rejected during the putsql. Since the putsql processor construct normal sql statements. I sounds to me that there could be a constraint on the table that isn't allowing the flowfiles to insert. If there was a unique id in the table that you are inserting into then you timestamp would not help. I hope I understood the problem correctly but in any case I think you would fine the most help form checking out the logs and seeing that the error was for those flowfiles that didn't write.

    • @nunosilva2128
      @nunosilva2128 3 роки тому

      @@StevenKoon they say i'm violating a primary key and give me the ok value...I select all records from the table with that pk and returns no data (no record with that pk)...And this happens because the previous flowfile with one row had on deed a record with a pk already on the Database)

  • @ahmedmnif5084
    @ahmedmnif5084 4 роки тому +1

    excellent explanation

  • @MohamedMontaser91
    @MohamedMontaser91 5 місяців тому

    does this csv files needs to be binded in a volume to the docker container?

  • @dungtrananh1522
    @dungtrananh1522 Рік тому +1

    Dear sir, why do we need to convert flow file into json before making the insert sql statement?

    • @StevenKoon
      @StevenKoon  Рік тому

      Good question. You don't need to. Another way to do the flow in this video is GetFile>PutDatabaseRecord. In the PutDatabaseRecord you can configure the Record Reader for the schema of you CSV files and directly Insert into the table with only two processors total.

  • @faizaattatfa6887
    @faizaattatfa6887 Рік тому

    can u make a video on how to use docker wit nifi and sql?

  • @gridplan
    @gridplan 4 роки тому +1

    Excellent tutorial. Thank you for creating/posting it. I like that I can inspect the queue at each step. For a given queue entry, is it possible to determine the line number in the CSV that produced it?

    • @StevenKoon
      @StevenKoon  3 роки тому

      Thank you for watching it.

  • @NotaThing13
    @NotaThing13 3 роки тому +1

    Well done dude 👍👏👏🌶🔥

  • @rkvm301
    @rkvm301 3 роки тому

    great tutorial, thanks Steven !!

    • @StevenKoon
      @StevenKoon  3 роки тому

      That's great to hear. Thanks!

  • @גלעדציסמדיה
    @גלעדציסמדיה 4 роки тому +1

    Greetings,
    First, I wanted to thank you for the tutorial.
    I've been trying to connect to orientdb database in the same way you connect to mysql and it fails. Do you know how to connect to orientdb, with emphasis on filling in the fields: Connection URL, Class Name and the path.
    thank you very much!

    • @StevenKoon
      @StevenKoon  4 роки тому

      Let me get Orientdb setup in a docker container and I'll see if I can successfully insert data into so I can share the connection configuration with you.

  • @ΝικοςΚασαρακης
    @ΝικοςΚασαρακης 2 роки тому

    Hi i saw that at the getfile after some time, if you have lets say 10 out, and it does not do anything (stoped or the queue on the connector is full), after some time it begins to reduce it until it gets back to 0. What does this mean and why this is happening? Also is this usefull for something? And how much is the time that reduces them?(for example every 10 sec? every 4-5 secs?) thank u

  • @InventarioGintracom
    @InventarioGintracom 7 місяців тому

    Thanks for the video, maybe can you guide me how to download the JDBC driver for be enable, the DBCP connection pool, i can't make it change the Status to "Enabled"

    • @WolfSparc
      @WolfSparc 8 днів тому

      If it is stuck as "enabling" rather than "enabled" then it is having issues establishing a connection. Edit your controller service and ensure you point to the driver file itself : /path/to/nifi-install/lib/mssql-jdbc-12.8.1.jre11.jar

  • @samsal073
    @samsal073 4 роки тому +1

    Hi Steven,
    Thanks for the video. I have a question regarding the ConverntJsontoSQL & PutSQL, can you use them against MS SQL?

    • @StevenKoon
      @StevenKoon  4 роки тому +1

      Yes, absolutely. I do it all the time at work. Let me get an example setup for you to look at on the connection configuration.

    • @samsal073
      @samsal073 4 роки тому +2

      @@StevenKoon Thank you Steven. Im kind of new to nifi and its been a while sine I used java since I come from .net environment, so forgive me if my questions seem to be trivial. I was able finally to figure it out but it took me a while to know how to populate values for (DB connection URL, Driver Class Name & Driver Location) fields. The documentation on this is very lacking so an example would be definitely helpful for people coming from the Microsoft world. Here is how I populate those fields in my case with [Place Holders]:
      DB Conn. Url: jdbc:sqlserver://[ServerName];databaseName=[DbName]
      DB Driver Class Name: com.microsoft.sqlserver.jdbc.SQLServerDriver
      DB Driver Location: [Installation path]\sqljdbc_8.2\enu\mssql-jdbc-8.2.2.jre8.jar
      One problem I faced is when I tried to use "IntegratedSecurity=ture" instead of providing credential but I got an error on that. So if you can explain how to do it would be greatly appreciated. Thanks

    • @eliaskamyabify
      @eliaskamyabify 4 роки тому +1

      @@samsal073 hi samer saleh! have u got ur problem solved? I face the same problem

    • @samsal073
      @samsal073 4 роки тому +1

      @@eliaskamyabify yes, if you follow my answer to see how you setup the dbpoolconnection service. Also steven has a video that shows how to connect to sql server.

  • @chriskeo392
    @chriskeo392 3 роки тому +1

    More content please?!??
    I'd gladly pay for a full revitalized tutorial on udemy.
    Apacha Airflow/Nifi: from zero to hero!

  • @luchardin224
    @luchardin224 3 роки тому +1

    Hi man, i'm learning to use nifi for my work, i'm having an issue with the put json to sql processor, i cant find the folder where i have my drivers of mysql, i'm trying to find them for downloading, but it seems more difficult than i thought, is there any other way to put the json into my database without declaring the driver?

    • @luchardin224
      @luchardin224 3 роки тому

      BTW excellent job

    • @StevenKoon
      @StevenKoon  3 роки тому

      If you check out this video ua-cam.com/video/0YROsMuqpFo/v-deo.html you will see in the comments that there is a link to mysql jdbc drivers. All you need to do is place the drivers into a directory on your Nifi server that Nifi has access to and use that to configure the mySql connection for your database if you are trying to place the data into a table in the database.

  • @ΝικοςΚασαρακης
    @ΝικοςΚασαρακης 2 роки тому

    What do the controller services really do? What would have happen if you didnt use csvreader ? I cant get the meaning of controller services
    Thank u

    • @WolfSparc
      @WolfSparc 7 днів тому

      I tend to think of them as a connection string to your destination. For Example you might have one that points to database ABC on server 1, and another that points to database XYZ on server 1 as well. Now your processors can use these ready made connection strings from a drop down menu. No need to add connection details to each component you put on the canvas. Only one place to update the passwd when it needs changing too.

  • @hevertoncss
    @hevertoncss 4 роки тому

    thank you very much, great content! your video helped me a lot in learning the tool!

  • @DuyTran-ex3nm
    @DuyTran-ex3nm 3 роки тому +1

    how to get path in Database Driver Location in docker

    • @StevenKoon
      @StevenKoon  3 роки тому +1

      When running Nifi in a docker container. I setup in my Nifi docekr-compose file a volume. So I bind a folder from the host machine to a folder in the container. I can then place file into the host machine folder that will appear inside of the container. This will make it possible to a database drivers to nifi and other files.
      You can see a example of a docker-compose that does this here: github.com/skoonData/docker-compose/blob/main/nifi_cluster.yaml
      Look at the volumes section where the type is "bind"

    • @DuyTran-ex3nm
      @DuyTran-ex3nm 3 роки тому +1

      @@StevenKoon thank you Steven!

  • @ikramgherbi3140
    @ikramgherbi3140 8 місяців тому

    Thank you very much

  • @pdpbasak
    @pdpbasak 4 роки тому +1

    Please make the videos by zooming in a bit. It's difficult to watch!

  • @yassiengalal9404
    @yassiengalal9404 2 місяці тому

    how to get the url of the driver and jdbc ?

  • @mc3420
    @mc3420 2 роки тому

    👍👍

  • @irischeng2321
    @irischeng2321 Рік тому

    cool👍