sjwiesman commented on a change in pull request #17264:
URL: https://github.com/apache/flink/pull/17264#discussion_r710261987
##########
File path:
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/dialect/JdbcDialect.java
##########
@@ -83,27 +86,37 @@ default void validate(TableSchema schema) throws
ValidationException {}
}
/**
- * Quotes the identifier. This is used to put quotes around the identifier
in case the column
- * name is a reserved keyword, or in case it contains characters that
require quotes (e.g.
- * space). Default using double quotes {@code "} to quote.
+ * Quotes the identifier.
+ *
+ * <p>Used to put quotes around the identifier if the column name is a
reserved keyword or
+ * contains characters requiring quotes (e.g., space). Default using
double quotes {@code "} to
+ * quote.
+ *
+ * @return the quoted identifier.
*/
default String quoteIdentifier(String identifier) {
return "\"" + identifier + "\"";
}
/**
- * Get dialect upsert statement, the database has its own upsert syntax,
such as Mysql using
- * DUPLICATE KEY UPDATE, and PostgreSQL using ON CONFLICT... DO UPDATE
SET..
+ * Constructs the dialects upsert statement if supported; such as MySQL's
{@code DUPLICATE KEY
+ * UPDATE}, or PostgreSQLs {@code ON CONFLICT... DO UPDATE SET..}.
+ *
+ * <p>If the dialect does not support native upsert statements, the writer
will fallback to
+ * {@code SELECT} + {@code Update}/{@code INSERT} which may have poor
performance.
*
- * @return None if dialect does not support upsert statement, the writer
will degrade to the use
- * of select + update/insert, this performance is poor.
+ * @return The upsert statement if supported, otherwise None.
*/
default Optional<String> getUpsertStatement(
String tableName, String[] fieldNames, String[] uniqueKeyFields) {
Review comment:
agreed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]