shivsood commented on a change in pull request #26301: [WIP] [SPARK-29644] 
[SQL] Corrected ShortType and ByteType mapping to SmallInt and TinyInt in 
JDBCUtils 
URL: https://github.com/apache/spark/pull/26301#discussion_r342360978
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/jdbc/JdbcUtils.scala
 ##########
 @@ -170,8 +170,8 @@ object JdbcUtils extends Logging {
       case LongType => Option(JdbcType("BIGINT", java.sql.Types.BIGINT))
       case DoubleType => Option(JdbcType("DOUBLE PRECISION", 
java.sql.Types.DOUBLE))
       case FloatType => Option(JdbcType("REAL", java.sql.Types.FLOAT))
-      case ShortType => Option(JdbcType("INTEGER", java.sql.Types.SMALLINT))
-      case ByteType => Option(JdbcType("BYTE", java.sql.Types.TINYINT))
+      case ShortType => Option(JdbcType("SMALLINT", java.sql.Types.SMALLINT))
 
 Review comment:
   Yes. When a DB does not support a particularity type or uses a different 
type then the respective dialect should be modified. e.g. Postgres does not 
support tinyint and you 'll see that in the PostfresDialect.scala ByteType also 
gets mapped to SMALLINT. Have added a sanity test in 
PostgresIntegrationSuite.scala.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to