[
https://issues.apache.org/jira/browse/NIFI-8122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275450#comment-17275450
]
Matt Burgess commented on NIFI-8122:
------------------------------------
ConvertJSONToSQL is "deprecated" in the sense that where possible you should be
using PutDatabaseRecord instead. As of NIFI-6934 you can use Upsert in
PutDatabaseRecord for the RDBMSs that support it (PostgreSQL, e.g.). AFAIK
"Upsert" isn't a standard (for example, Oracle makes you use MERGE which is a
standard) and since we've been focusing efforts on PutDatabaseRecord to avoid
the need for ConvertJSONToSQL, this case is IMO unlikely to get picked up by
the community. Having said that, someone could apply the changes from NIFI-6934
to ConvertJSONToSQL and issue a PR here.
> Support "upsert" functionality in ConvertJSONtoSQL processor
> ------------------------------------------------------------
>
> Key: NIFI-8122
> URL: https://issues.apache.org/jira/browse/NIFI-8122
> Project: Apache NiFi
> Issue Type: New Feature
> Components: Extensions
> Affects Versions: 1.12.1
> Reporter: Romeo Kienzer
> Priority: Major
>
> The ConvertJSONtoSQL processor doesn't Support "upsert" functionality, only
> insert, update and delete. As the ConvertJSONtoSQL already has a working jdbc
> connection to query metadata on the target table I think it would be
> straightforward to query the target table to decide if on a given row in a
> flow file an insert or an update has to be created.
> I don't know if I'm getting something completely wrong here, but the Nifi
> community only speaks about "workarounds" when it comes to upsert. So this
> way we would have a clean implementation (although it requires one additional
> query roundtrip per row), but at least there should be an index on the key
> fields
--
This message was sent by Atlassian Jira
(v8.3.4#803005)