huangxiaopingRD commented on code in PR #39062:
URL: https://github.com/apache/spark/pull/39062#discussion_r1108745093


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala:
##########
@@ -135,6 +135,38 @@ abstract class JdbcDialect extends Serializable with 
Logging {
     s""""$colName""""
   }
 
+  /**
+   * Get the SQL that should be used to create a table. Dialects can
+   * override this method to return a SQL that works best in a particular 
database.
+   * 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"
+   * @param tableName The name of the table.
+   * @param strSchema The scheme string corresponding to the dialect, the 
schemaString method of
+   *                  JdbcUtils has provided the function of calculating the 
scheme string
+   *                  for different databases
+   * @param createTableOptions The string of the options that to allow certain 
options to append
+   *                           when create a new table, which can be 
table_options
+   *                           or partition_options.
+   */
+  def createTable(
+      statement: Statement,
+      tableName: String,
+      strSchema: String,
+      options: JdbcOptionsInWrite): Unit = {
+    val createTableQuery = getCreateTableQuery(tableName, strSchema, 
options.createTableOptions)

Review Comment:
   This is a reference to other logic, similar to `getAddColumnQuery`, dialect 
only needs to override syntax-related things, and does not need to care about 
other common logic



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