sunxiaoguang commented on code in PR #49335: URL: https://github.com/apache/spark/pull/49335#discussion_r1911885139
########## sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala: ########## @@ -259,6 +311,8 @@ private case class MySQLDialect() extends JdbcDialect with SQLConfHelper with No case StringType => Option(JdbcType("LONGTEXT", java.sql.Types.LONGVARCHAR)) case ByteType => Option(JdbcType("TINYINT", java.sql.Types.TINYINT)) case ShortType => Option(JdbcType("SMALLINT", java.sql.Types.SMALLINT)) + // We override getJDBCType so that DoubleType is mapped to DOUBLE instead. + case DoubleType => Option(JdbcType("DOUBLE", java.sql.Types.DOUBLE)) Review Comment: This change is to make the use of `DOUBLE` which is a synonym of `DOUBLE PRECISION`. But it is compatible in cast function from MySQL 5.7, which is still widely used, all the way up to the latest MySQL 9.1. -- 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-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org