srowen commented on a change in pull request #30712:
URL: https://github.com/apache/spark/pull/30712#discussion_r598894617



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/jdbc/MsSqlServerDialect.scala
##########
@@ -48,7 +48,8 @@ private object MsSqlServerDialect extends JdbcDialect {
   }
 
   override def getJDBCType(dt: DataType): Option[JdbcType] = dt match {
-    case TimestampType => Some(JdbcType("DATETIME", java.sql.Types.TIMESTAMP))
+    case TimestampType => if(oldDateTime) {Some(JdbcType("DATETIME", 
java.sql.Types.TIMESTAMP))} 
+      else {Some(JdbcType("DATETIME2", java.sql.Types.TIMESTAMP))}

Review comment:
       I think this needs some minor style changes too - put the if-else on new 
lines, spaces around parens and braces.




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

Reply via email to