Member since
07-10-2024
3
Posts
1
Kudos Received
0
Solutions
07-11-2024
12:14 AM
@SAMSAL , do you think this way is simpler for production and support than Groovy? As an experiment, I created my solution with Groovy yesterday (four processors: Kafka -> Groovy -> ExtractText -> PutSql). My boss believes that we need only simple NiFi blocks. I have about 120 tables with 2000 columns. I need to convert milliseconds to timestamps, escape quotes, replace nulls with SQL 'NULL', and get a list of primary keys from the database. Can I do this with simple blocks? For me, Groovy is the simplest way. Why does the NiFi community not recommend using Groovy? Maybe I need an API creator script to generate simple block assemblies? What is the best practice in the NiFi world?
... View more
07-10-2024
06:56 AM
Thank you for your replay! Version is 2.0.0-M3 Tagged nifi-2.0.0-M3-RC1 From f2215c6 on branch UNKNOWN. I will to try your solution tomorrow. Thank you again!
... View more
07-10-2024
04:47 AM
1 Kudo
Hi everyone! I have json from kafka: [ {
"before" : {
"old_key1" : old_value1,
"old_key2" : old_value2,
"old_key3" : old_value3,
"old_key4" : old_value4
},
"after" : {
"new_key1" : new_value1,
"new_key2" : new_value2,
"new_key3" : new_value3,
"new_key4" : new_value4
},
"table" : "table_name",
"op" : "u", -- operation ['u-update', 'c-insert', 'd-delete']
"tm" : 1720539441000000000 - timestamp of changes
} ] I need execute on database sql like: update table_name
set new_key1=new_value1,
new_key2=new_value2,
new_key3=new_value3,
new_key4=new_value4
where
old_key1=old_value1 and
old_key2=old_value2 and
old_key3=old_value3 and
old_key4=old_value4; What's the best way to update rows in a database with before and after values by NiFi. I can`t use a groovy script because our team know sql only and if I produce it on groovy, I must support this alone. I have tried create sql by jolt, but all values without quotes and I can`t test a type. I think a have two ways: 1) insert all data to sql and create sql by sql 2) Create new Processor with ability of create the sql (But 🙂 I can do it by groovy)
... View more
Labels:
- Labels:
-
Apache NiFi