diff options
author | Liang-Chi Hsieh <viirya@appier.com> | 2015-10-07 14:49:08 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-10-07 14:49:08 -0700 |
commit | c14aee4da97d4a7fcc8a2565a159edc74a5c8e10 (patch) | |
tree | b3e107b16a84a42514f8ced9c9c7f9c46145f1f4 /sql/core | |
parent | 94fc57afdf8ac6be35f13956232b6cf58857d047 (diff) | |
download | spark-c14aee4da97d4a7fcc8a2565a159edc74a5c8e10.tar.gz spark-c14aee4da97d4a7fcc8a2565a159edc74a5c8e10.tar.bz2 spark-c14aee4da97d4a7fcc8a2565a159edc74a5c8e10.zip |
[SPARK-10856][SQL] Mapping TimestampType to DATETIME for SQL Server jdbc dialect
JIRA: https://issues.apache.org/jira/browse/SPARK-10856
For Microsoft SQL Server, TimestampType should be mapped to DATETIME instead of TIMESTAMP.
Related information for the datatype mapping: https://msdn.microsoft.com/en-us/library/ms378878(v=sql.110).aspx
Author: Liang-Chi Hsieh <viirya@appier.com>
Closes #8978 from viirya/mysql-jdbc-timestamp.
Diffstat (limited to 'sql/core')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala index c70fea1c3f..5abbfbf7b3 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/jdbc/JdbcDialects.scala @@ -277,4 +277,9 @@ case object MsSqlServerDialect extends JdbcDialect { Some(StringType) } else None } + + override def getJDBCType(dt: DataType): Option[JdbcType] = dt match { + case TimestampType => Some(JdbcType("DATETIME", java.sql.Types.TIMESTAMP)) + case _ => None + } } |