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 2021/05/20 11:20:20 UTC
[GitHub] [spark] HyukjinKwon commented on a change in pull request #32605: [WIP][SPARK-35446] Override getJDBCType in MySQLDialect to map FloatType to FLOAT
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org