Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-1031

Provide default Java type mapping for MS Sql Datetimeoffset type

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.4
    • Component/s: None
    • Labels:
      None

      Description

      MS SQL database type datetimeoffset causes errors when importing to HDFS. We need to provide a default mapping in SQLServerManager which could still be overriden by users if wanted.
      In order to preserve time zone offset we use String instead of TimeStamp. This would still work when exporting the imported data back to MS SQL Server

      1. SQOOP-1031.1.patch
        2 kB
        Shuaishuai Nie

        Issue Links

          Activity

          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          Assigned to Shuaishuai Nie.

          Show
          jarcec Jarek Jarcec Cecho added a comment - Assigned to Shuaishuai Nie .
          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          Hi Shuaishuai Nie,
          thank you for your contribution! I'm curious where the value -155 is coming from? I did not find it either in Java 6 nor in Java 7 docs, so I'm wondering whether it's some sort of private extension of Microsoft SQL Server?

          Jarcec

          Show
          jarcec Jarek Jarcec Cecho added a comment - Hi Shuaishuai Nie , thank you for your contribution! I'm curious where the value -155 is coming from? I did not find it either in Java 6 nor in Java 7 docs, so I'm wondering whether it's some sort of private extension of Microsoft SQL Server? Jarcec
          Hide
          shuainie Shuaishuai Nie added a comment -

          Hi Jarek Jarcec Cecho, This value is the integer value mapped in JDBC driver for the Datetimeoffset type in Microsoft SQL Server. I think it is SQL server specific so it is not documented. Thanks

          Show
          shuainie Shuaishuai Nie added a comment - Hi Jarek Jarcec Cecho , This value is the integer value mapped in JDBC driver for the Datetimeoffset type in Microsoft SQL Server. I think it is SQL server specific so it is not documented. Thanks
          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          Thank you Shuaishuai Nie for the explanation! I'm a bit concerned about what will happen when the Java will adopt the value -155 for something else, but as that is more general issue outside scope of Sqoop, I'm +1 on the patch.

          Show
          jarcec Jarek Jarcec Cecho added a comment - Thank you Shuaishuai Nie for the explanation! I'm a bit concerned about what will happen when the Java will adopt the value -155 for something else, but as that is more general issue outside scope of Sqoop, I'm +1 on the patch.
          Show
          jarcec Jarek Jarcec Cecho added a comment - The patch is in: https://git-wip-us.apache.org/repos/asf?p=sqoop.git;a=commit;h=28af5122ea8778b5fcd6341a492d64283c706b08 Thank you Shuaishuai Nie for your contribution! Jarcec
          Hide
          hudson Hudson added a comment -

          Integrated in Sqoop-ant-jdk-1.6-hadoop23 #842 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/842/)
          SQOOP-1031: Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08)

          Result = SUCCESS
          jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08
          Files :

          • src/java/org/apache/sqoop/manager/SQLServerManager.java
          Show
          hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop23 #842 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/842/ ) SQOOP-1031 : Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08 Files : src/java/org/apache/sqoop/manager/SQLServerManager.java
          Hide
          hudson Hudson added a comment -

          Integrated in Sqoop-ant-jdk-1.6-hadoop20 #634 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/634/)
          SQOOP-1031: Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08)

          Result = SUCCESS
          jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08
          Files :

          • src/java/org/apache/sqoop/manager/SQLServerManager.java
          Show
          hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop20 #634 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/634/ ) SQOOP-1031 : Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08 Files : src/java/org/apache/sqoop/manager/SQLServerManager.java
          Hide
          hudson Hudson added a comment -

          Integrated in Sqoop-ant-jdk-1.6-hadoop100 #638 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/638/)
          SQOOP-1031: Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08)

          Result = SUCCESS
          jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08
          Files :

          • src/java/org/apache/sqoop/manager/SQLServerManager.java
          Show
          hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop100 #638 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/638/ ) SQOOP-1031 : Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08 Files : src/java/org/apache/sqoop/manager/SQLServerManager.java
          Hide
          hudson Hudson added a comment -

          Integrated in Sqoop-ant-jdk-1.6-hadoop200 #635 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/635/)
          SQOOP-1031: Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08)

          Result = SUCCESS
          jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08
          Files :

          • src/java/org/apache/sqoop/manager/SQLServerManager.java
          Show
          hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop200 #635 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/635/ ) SQOOP-1031 : Provide default Java type mapping for MS Sql Datetimeoffset type (Revision 28af5122ea8778b5fcd6341a492d64283c706b08) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=28af5122ea8778b5fcd6341a492d64283c706b08 Files : src/java/org/apache/sqoop/manager/SQLServerManager.java
          Hide
          shuainie Shuaishuai Nie added a comment -
          Show
          shuainie Shuaishuai Nie added a comment - Thank Jarek Jarcec Cecho !

            People

            • Assignee:
              shuainie Shuaishuai Nie
              Reporter:
              shuainie Shuaishuai Nie
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development