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

Generated Java class does not distinguish date and timestamp in Oracle DB

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: codegen
    • Labels:
      None

      Description

      In genereated Java class, both date and timestamp are considered as timestamps. For examples, the following getter method is generated for a date column:

       
      public void readFields(ResultSet __dbResults) throws SQLException {
        this.__cur_result_set = __dbResults;
        this.DATA_COL0 = JdbcWritableBridge.readTimestamp(1, __dbResults);
      }
      

      This happens because both date and timestamp is labeled as Types.TIMESTAMP by ConnManager. The fix seems straightforward. In ClassWriter, the new method getColTypeNamesForTable introduced by Bilung at SQOOP-352 should replace getColTypes().

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              cheolsoo Cheolsoo Park
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: