You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Cristiano Silva <cr...@gmail.com> on 2021/05/02 19:39:51 UTC

CREATE TABLE code is generated automatically from csv.

Hello, I hope you are well.

Please, I would like to know how do I create a table from a csv.

I read the csv and a CREATE TABLE code is generated automatically,
according to the elements that were found in the first 10 (100, 1000, etc
...) lines.

Thank you very much!

Atenciosamente,
Cristiano Luís Turbino de França e Silva
==============================
                      GNU / Linux
    ,                ,       /       .-.
   /                  \     /      (e e)
  ((__-^^-,-^^-__))   /     _.`V'._
    `-_---' `---_-'      /    //~~W~~\\
  <__|o ` 'o|__>   /    //,           ,\\
        \   `  /       /    // |            | \\
         ):  :(      /      \) |            | (/
        :o_o:    /           \           /
          "-"    /              `w -  w'

Re: CREATE TABLE code is generated automatically from csv.

Posted by Cristiano Silva <cr...@gmail.com>.
Thank you Carlos.

I used the Pentaho PDI (Pentaho Data Integration - Spoon).
-------
In Pentaho there is a block: Input / CSV file input.
- this block, reads a CSV file, specifies the column names, specifies the
data type of each column, that is, obtains the fields from the CSV file.
-------
Then there is another block called: Output / Table output.
- the CSV file input block is connected to this Table output block, and
then, it has an SQL button, which when triggered generates the SQL code
(CREATE TABLE) with the fields that were detected in the CSV file input
block.
-------
Now I am migrating to Apache.

I would like to know if there is any way to do this that I mentioned
earlier in Apache.

Do you understand what I want to do?

Did I get it right?

Thank you very much!

Atenciosamente,
Cristiano Luís Turbino de França e Silva
==============================
                      GNU / Linux
    ,                ,       /       .-.
   /                  \     /      (e e)
  ((__-^^-,-^^-__))   /     _.`V'._
    `-_---' `---_-'      /    //~~W~~\\
  <__|o ` 'o|__>   /    //,           ,\\
        \   `  /       /    // |            | \\
         ):  :(      /      \) |            | (/
        :o_o:    /           \           /
          "-"    /              `w -  w'


On Mon, May 3, 2021 at 7:39 AM Carlos Manuel Fernandes (DSI) <
carlos.antonio.fernandes@cgd.pt> wrote:

> Hi Cristiano,
>
> Take a look on Nifi processor PutDatabaseRecord wich can read from a csv
>  source (and others json, avro,ect) and put the records on a  existent
> table on database.
>
> If you need to create a table based on the schema of CSV you probably need
> a custom script, take a look in this post:
> https://stackoverflow.com/questions/49053901/create-a-postgresql-table-from-avro-schema-in-nifi/49076714#49076714
> .
>
>
>
> Carlos
>
>
>
>
>
> *From:* Cristiano Silva [mailto:cristianoltfs@gmail.com]
> *Sent:* 2 de maio de 2021 20:40
> *To:* users@nifi.apache.org
> *Subject:* CREATE TABLE code is generated automatically from csv.
>
>
>
> **** ATENÇÃO: esta mensagem de e-mail tem origem externa!*
>
> *A cibersegurança é uma responsabilidade partilhada. Não aceda a links nem
> anexos de mensagens suspeitas ou inesperadas.*
>
> *CSIRT CGD ****
> ------------------------------
>
>
>
> Hello, I hope you are well.
>
> Please, I would like to know how do I create a table from a csv.
>
> I read the csv and a CREATE TABLE code is generated automatically,
> according to the elements that were found in the first 10 (100, 1000, etc
> ...) lines.
>
> Thank you very much!
>
>
>
> Atenciosamente,
>
> Cristiano Luís Turbino de França e Silva
>
> ==============================
>
>                       GNU / Linux
>     ,                ,       /       .-.
>    /                  \     /      (e e)
>   ((__-^^-,-^^-__))   /     _.`V'._
>     `-_---' `---_-'      /    //~~W~~\\
>   <__|o ` 'o|__>   /    //,           ,\\
>         \   `  /       /    // |            | \\
>          ):  :(      /      \) |            | (/
>         :o_o:    /           \           /
>           "-"    /              `w -  w'
>

RE: CREATE TABLE code is generated automatically from csv.

Posted by "Carlos Manuel Fernandes (DSI)" <ca...@cgd.pt>.
Hi Cristiano,
Take a look on Nifi processor PutDatabaseRecord wich can read from a csv  source (and others json, avro,ect) and put the records on a  existent table on database.
If you need to create a table based on the schema of CSV you probably need a custom script, take a look in this post: https://stackoverflow.com/questions/49053901/create-a-postgresql-table-from-avro-schema-in-nifi/49076714#49076714.

Carlos


From: Cristiano Silva [mailto:cristianoltfs@gmail.com]
Sent: 2 de maio de 2021 20:40
To: users@nifi.apache.org
Subject: CREATE TABLE code is generated automatically from csv.

*** ATENÇÃO: esta mensagem de e-mail tem origem externa!
A cibersegurança é uma responsabilidade partilhada. Não aceda a links nem anexos de mensagens suspeitas ou inesperadas.
CSIRT CGD ***
________________________________

Hello, I hope you are well.

Please, I would like to know how do I create a table from a csv.

I read the csv and a CREATE TABLE code is generated automatically, according to the elements that were found in the first 10 (100, 1000, etc ...) lines.

Thank you very much!

Atenciosamente,
Cristiano Luís Turbino de França e Silva
==============================
                      GNU / Linux
    ,                ,       /       .-.
   /                  \     /      (e e)
  ((__-^^-,-^^-__))   /     _.`V'._
    `-_---' `---_-'      /    //~~W~~\\
  <__|o ` 'o|__>   /    //,           ,\\
        \   `  /       /    // |            | \\
         ):  :(      /      \) |            | (/
        :o_o:    /           \           /
          "-"    /              `w -  w'