You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/02/07 05:31:44 UTC
[GitHub] [spark] huaxingao commented on a change in pull request #35355: [SPARK-38054][SQL] DS V2 supports list namespaces of MySQL dialect
huaxingao commented on a change in pull request #35355:
URL: https://github.com/apache/spark/pull/35355#discussion_r800325893
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
##########
@@ -979,8 +979,23 @@ object JdbcUtils extends Logging with SQLConfHelper {
namespace: String,
comment: String): Unit = {
val dialect = JdbcDialects.get(options.url)
+ val schemaCommentQuery = if (comment.isEmpty) {
+ comment
+ } else {
+ dialect.getSchemaCommentQuery(namespace, comment)
+ }
executeStatement(conn, options, s"CREATE SCHEMA ${dialect.quoteIdentifier(namespace)}")
- if (!comment.isEmpty) createNamespaceComment(conn, options, namespace, comment)
+ if (comment.nonEmpty) executeStatement(conn, options, schemaCommentQuery)
Review comment:
I guess
```
val dialect = JdbcDialects.get(options.url)
executeStatement(conn, options, s"CREATE SCHEMA ${dialect.quoteIdentifier(namespace)}")
if (comment.nonEmpty) {
executeStatement(conn, options, dialect.getSchemaCommentQuery(namespace, comment))
}
```
--
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: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org