beliefer commented on code in PR #41518:
URL: https://github.com/apache/spark/pull/41518#discussion_r1223800177
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -878,6 +898,7 @@ object JdbcUtils extends Logging with SQLConfHelper {
df: DataFrame,
tableSchema: Option[StructType],
isCaseSensitive: Boolean,
+ upsert: Boolean,
Review Comment:
Shall we avoid add parameter?
Please reuse `JdbcOptionsInWrite`.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1344,6 +1344,14 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
tableDoesNotSupportError("truncates", table)
}
+ def tableDoesNotSupportUpsertsError(table: String): Throwable = {
+ new AnalysisException(
+ errorClass = "_LEGACY_ERROR_TEMP_1121",
+ messageParameters = Map(
+ "cmd" -> "upserts",
+ "table" -> table))
Review Comment:
`tableDoesNotSupportError("upserts", table)`
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -284,6 +288,8 @@ object JDBCOptions {
val JDBC_BATCH_FETCH_SIZE = newOption("fetchsize")
val JDBC_TRUNCATE = newOption("truncate")
val JDBC_CASCADE_TRUNCATE = newOption("cascadeTruncate")
+ val JDBC_UPSERT = newOption("upsert")
Review Comment:
`upserts` or `upsert` ?
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JDBCOptions.scala:
##########
@@ -158,8 +158,12 @@ class JDBCOptions(
// ------------------------------------------------------------
// if to truncate the table from the JDBC database
val isTruncate = parameters.getOrElse(JDBC_TRUNCATE, "false").toBoolean
-
Review Comment:
It seems not necessary!
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]