You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Elemir Stevko <El...@versent.com.au> on 2018/11/19 01:47:40 UTC

Adding a new column to a CSV file

Hello,

I would like to add a timestamp as a new column to an existing CSV file that I read from S3. Is this possible with UpdateRecord processor?

Best regards,
Elemir

Re: Adding a new column to a CSV file

Posted by Elemir Stevko <El...@versent.com.au>.
Thanks a lot, Koji!


On 19/11/18, 5:16 pm, "Koji Kawamura" <ij...@gmail.com> wrote:

    Hi Elemir,
    
    Yes, you can use UpdateRecord to add a new timestamp column and set
    current timestamp.
    Important configurations:
    - The output schema has to have the whole columns, including the new
    timestamp column
    - You can use 'Literal Value' strategy at UpdateRecord to use
    ExpressionLanguage such as ${now():toNumber()}
    
    An example template is available here
    https://gist.github.com/ijokarumawak/69494de123379ddc0ceb3f4e275f1618
    
    Thanks,
    Koji
    On Mon, Nov 19, 2018 at 10:47 AM Elemir Stevko
    <El...@versent.com.au> wrote:
    >
    > Hello,
    >
    >
    >
    > I would like to add a timestamp as a new column to an existing CSV file that I read from S3. Is this possible with UpdateRecord processor?
    >
    >
    >
    > Best regards,
    >
    > Elemir
    


Re: Adding a new column to a CSV file

Posted by Koji Kawamura <ij...@gmail.com>.
Hi Elemir,

Yes, you can use UpdateRecord to add a new timestamp column and set
current timestamp.
Important configurations:
- The output schema has to have the whole columns, including the new
timestamp column
- You can use 'Literal Value' strategy at UpdateRecord to use
ExpressionLanguage such as ${now():toNumber()}

An example template is available here
https://gist.github.com/ijokarumawak/69494de123379ddc0ceb3f4e275f1618

Thanks,
Koji
On Mon, Nov 19, 2018 at 10:47 AM Elemir Stevko
<El...@versent.com.au> wrote:
>
> Hello,
>
>
>
> I would like to add a timestamp as a new column to an existing CSV file that I read from S3. Is this possible with UpdateRecord processor?
>
>
>
> Best regards,
>
> Elemir