cloud-fan commented on code in PR #39062:
URL: https://github.com/apache/spark/pull/39062#discussion_r1108710573


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala:
##########
@@ -899,24 +899,15 @@ object JdbcUtils extends Logging with SQLConfHelper {
       schema: StructType,
       caseSensitive: Boolean,
       options: JdbcOptionsInWrite): Unit = {
+    val statement = conn.createStatement
     val dialect = JdbcDialects.get(options.url)
     val strSchema = schemaString(
       schema, caseSensitive, options.url, options.createTableColumnTypes)
-    val createTableOptions = options.createTableOptions
-    // Create the table if the table does not exist.
-    // To allow certain options to append when create a new table, which can be
-    // table_options or partition_options.
-    // E.g., "CREATE TABLE t (name string) ENGINE=InnoDB DEFAULT CHARSET=utf8"
-    val sql = s"CREATE TABLE $tableName ($strSchema) $createTableOptions"
-    executeStatement(conn, options, sql)
-    if (options.tableComment.nonEmpty) {
-      try {
-        executeStatement(

Review Comment:
   We can still leave the table comment statement execution here, unless there 
is a use case to allow dialect to override it as well.



-- 
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]

Reply via email to