Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

is there some processor in Nifi to do csv processing?

New Contributor

I would like to do two operation in csv file.

1) sort the csv flow file on particular column

2) process records in csv row by row and update the value of second one with value of first like below.


Expected result:

Before

AAAA N

AAAA Y

AAAA Y

BBBB Y

BBBB Y

CCCC N

CCCC Y


After

AAAA N

AAAA N

AAAA N

BBBB Y

BBBB Y

CCCC N

CCCC N


Can we do it in Nifi processor or do we need to use some script to achieve this. Any other suggestions would be appreciated.


Thanks,

ram


1 REPLY 1

Super Guru

@Ram S

You need to use QueryRecord processor for this case and add new query to the processor by using Apache Calcite SQL syntax. Use Window functions using lag to get previous row value for all the other rows in a partition.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.