Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Insert else update into hive table using NIFI

avatar
New Member

I am planning to read from db2 database and do a update else insert into a hive table. what processors should be used to achive this.

1 ACCEPTED SOLUTION

avatar
Guru

Hi @Sateesh Mandumula

For reading from the RDBMS, you can use processors like QueryDatabaseTable or ExecuteSQL. Hive now supports Merge which should cover your update else insert requirement, you can try using a PutHiveQL and seeing if you can issue the merge command using that. Here are some relevant links to the documentation that should help:

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache...

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache...

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Merge

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-hive-nar/1.3.0/org.apache.nif...

View solution in original post

1 REPLY 1

avatar
Guru

Hi @Sateesh Mandumula

For reading from the RDBMS, you can use processors like QueryDatabaseTable or ExecuteSQL. Hive now supports Merge which should cover your update else insert requirement, you can try using a PutHiveQL and seeing if you can issue the merge command using that. Here are some relevant links to the documentation that should help:

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache...

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.3.0/org.apache...

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-Merge

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-hive-nar/1.3.0/org.apache.nif...