Sqoop
  1. Sqoop
  2. SQOOP-935

DATE columns in an Oracle database should be imported as a JDBC TIMESTAMP

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4.2
    • Fix Version/s: None
    • Component/s: connectors/oracle
    • Labels:
      None

      Description

      If not, data of DATE imported from orcale 9i-10g will be lack of time information. That's because the Oracle DATE SQL type contains both date and time information as does java.sql.Timestamp while 9i-10g drivers maps SQL DATE to JDBC DATE type which represents a date consisting of day, month, and year.

        Activity

        Hide
        Venkat Ranganathan added a comment -

        zhangguancheng

        Oracle date format has been changing with releases - 8, 9-10 and 11g-12c all have differing behaviors. One workaround is to specify a Oracle JDBC specific property

        The easiest way to do is to create connection parameter file and specify this in the file as per your requirement.
        oracle.jdbc.mapDateToTimestamp=<true or false>

        Assuming you saved this to a file name oraconn.props

        This is how you specify the connection parameter file in the sqoop command line

        sqoop import --connect jdbc:oracle:thin:@<host>:<port>:<sid> --table EMP --username <user> --password <pass> --connection-param-file <connparam-file> <rest of the parameters>

        where values within <,> should be substituted as needed.

        Can you check and update this JIRA

        Thanks

        Show
        Venkat Ranganathan added a comment - zhangguancheng Oracle date format has been changing with releases - 8, 9-10 and 11g-12c all have differing behaviors. One workaround is to specify a Oracle JDBC specific property The easiest way to do is to create connection parameter file and specify this in the file as per your requirement. oracle.jdbc.mapDateToTimestamp=<true or false> Assuming you saved this to a file name oraconn.props This is how you specify the connection parameter file in the sqoop command line sqoop import --connect jdbc:oracle:thin:@<host>:<port>:<sid> --table EMP --username <user> --password <pass> --connection-param-file <connparam-file> <rest of the parameters> where values within <,> should be substituted as needed. Can you check and update this JIRA Thanks

          People

          • Assignee:
            Unassigned
            Reporter:
            zhangguancheng
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development