shivsood commented on a change in pull request #24969: [SPARK-28151][SQL]
ByteType, ShortType and FloatTypes are not correctly mapped for read/write of
SQLServer tables
URL: https://github.com/apache/spark/pull/24969#discussion_r301220804
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala
##########
@@ -895,6 +895,24 @@ class JDBCSuite extends QueryTest
"BIT")
assert(msSqlServerDialect.getJDBCType(BinaryType).map(_.databaseTypeDefinition).get
==
"VARBINARY(MAX)")
+
assert(msSqlServerDialect.getJDBCType(ByteType).map(_.databaseTypeDefinition).get
==
+ "TINYINT")
+
+
assert(msSqlServerDialect.getJDBCType(ShortType).map(_.databaseTypeDefinition).get
==
+ "SMALLINT")
+ }
+
+ test("MsSqlServerDialect catalyst type mapping") {
+ val msSqlServerDialect = JdbcDialects.get("jdbc:sqlserver")
+ val metadata = new MetadataBuilder().putLong("scale", 1)
+
+
assert(msSqlServerDialect.getCatalystType(java.sql.Types.TINYINT,"TINYINT",1,metadata).get
==
Review comment:
Thanks dongjoon. I have resolved these.
----------------------------------------------------------------
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]