HyukjinKwon commented on a change in pull request #32605:
URL: https://github.com/apache/spark/pull/32605#discussion_r636009037
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/jdbc/MySQLDialect.scala
##########
@@ -94,4 +94,23 @@ private case object MySQLDialect extends JdbcDialect {
override def getTableCommentQuery(table: String, comment: String): String = {
s"ALTER TABLE $table COMMENT = '$comment'"
}
+
+ override def getJDBCType(dt: DataType): Option[JdbcType] = dt match {
+ case IntegerType => Option(JdbcType("INTEGER", java.sql.Types.INTEGER))
Review comment:
I think you can remove other pattern matches and delegate it to
`getCommonJDBCType`:
https://github.com/apache/spark/blob/0494dc90af48ce7da0625485a4dc6917a244d580/sql/core/src/main/scala/org/apache/spark/sql/jdbc/PostgresDialect.scala#L94-L95
So to clarify we need to extra pattern matches, is it correct?
```scala
case DoubleType => Option(JdbcType("REAL", java.sql.Types.DOUBLE))
case FloatType => Option(JdbcType("FLOAT", java.sql.Types.FLOAT))
```
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]