panbingkun commented on code in PR #37031:
URL: https://github.com/apache/spark/pull/37031#discussion_r912439421


##########
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala:
##########
@@ -217,7 +219,7 @@ private case object MySQLDialect extends JdbcDialect with 
SQLConfHelper {
             // The only property we are building here is `COMMENT` because 
it's the only one
             // we can get from `SHOW INDEXES`.
             val properties = new util.Properties();
-            if (indexComment.nonEmpty) properties.put("COMMENT", indexComment)

Review Comment:
   > Yes, you are right! I investigated it carefully.
   > INDEX_COMMENT nullability is NO, the default value is empty String.
   
   mysql> desc INFORMATION_SCHEMA.STATISTICS;
   +---------------+---------------+------+-----+---------+-------+
   | Field         | Type          | Null | Key | Default | Extra |
   +---------------+---------------+------+-----+---------+-------+
   | TABLE_CATALOG | varchar(512)  | NO   |     |         |       |
   | TABLE_SCHEMA  | varchar(64)   | NO   |     |         |       |
   | TABLE_NAME    | varchar(64)   | NO   |     |         |       |
   | NON_UNIQUE    | bigint(1)     | NO   |     | 0       |       |
   | INDEX_SCHEMA  | varchar(64)   | NO   |     |         |       |
   | INDEX_NAME    | varchar(64)   | NO   |     |         |       |
   | SEQ_IN_INDEX  | bigint(2)     | NO   |     | 0       |       |
   | COLUMN_NAME   | varchar(64)   | NO   |     |         |       |
   | COLLATION     | varchar(1)    | YES  |     | NULL    |       |
   | CARDINALITY   | bigint(21)    | YES  |     | NULL    |       |
   | SUB_PART      | bigint(3)     | YES  |     | NULL    |       |
   | PACKED        | varchar(10)   | YES  |     | NULL    |       |
   | NULLABLE      | varchar(3)    | NO   |     |         |       |
   | INDEX_TYPE    | varchar(16)   | NO   |     |         |       |
   | COMMENT       | varchar(16)   | YES  |     | NULL    |       |
   **| INDEX_COMMENT | varchar(1024) | NO   |     |         |       |**
   +---------------+---------------+------+-----+---------+-------+



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