Conversation
8cacac6 to
5ea49a5
Compare
| @Override | ||
| public String constructUpsertQuery(String table, String[] fieldNames, String[] listKeys) { | ||
| if (listKeys == null) { | ||
| throw new IllegalArgumentException("Column names to be updated should not be null"); |
There was a problem hiding this comment.
what is the name for this config in UI?
Column names does not help understand which config are we exactly talking about.
Also, can we move these to sink config validations when UPSERT is selected?
There was a problem hiding this comment.
Yes, we also have this validation in Abstract DB sink
There was a problem hiding this comment.
The naming convention is taken from ETLDBOutputFormat and PostgresETLDBOutputFormat
There was a problem hiding this comment.
if we have these validations, why will there be a point when code reaches here without these properties present?
There was a problem hiding this comment.
Not sure, this was also taken from ETLDBOutputFormat and PostgresETLDBOutputFormat following the same style.
There was a problem hiding this comment.
This is just an error message, we can make the error message more descriptive here to include the config name atleast.
| if (listKeys == null) { | ||
| throw new IllegalArgumentException("Column names to be updated should not be null"); | ||
| } else if (fieldNames == null) { | ||
| throw new IllegalArgumentException("Field names should not be null"); |
There was a problem hiding this comment.
similar comment here.
Better to move these to sink config validations to fail early.
There was a problem hiding this comment.
This is input schema
There was a problem hiding this comment.
so these validations should move to source.
oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java
Show resolved
Hide resolved
oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java
Outdated
Show resolved
Hide resolved
oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java
Outdated
Show resolved
Hide resolved
oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java
Outdated
Show resolved
Hide resolved
…etermination # Conflicts: # oracle-plugin/src/main/java/io/cdap/plugin/oracle/OracleSourceDBRecord.java
This pull request introduces support for upsert operations in the Oracle batch sink plugin.
OracleETLDBOutputFormatthat extendsETLDBOutputFormatand implements theconstructUpsertQuerymethod, generating an Oracle-compatible MERGE-based upsert SQL statement.OracleSinkto use the newOracleETLDBOutputFormatby adding an output context withSinkOutputFormatProvider.UI Update