Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-3344

Using --table fails for Sybase when specifying a table name that includes owner

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.4.6, 1.4.7
    • 3.0.0
    • connectors/generic
    • None
    • Patch

    Description

      When attempting to use the --table parameter with a Sybase table that includes the owner definition (i.e. OWNER.TABLENAME) causes mappers to fail with:  

      com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '.'. at com.sybase.jdbc3.tds.Tds.a(Unknown Source)
      

       

      This is because in DataDrivenDBRecordReader an alias is added if the DB product name isn't one of the ones specified:

      if (!dbProductName.startsWith("ORACLE")
          && !dbProductName.startsWith("DB2")
          && !dbProductName.startsWith("MICROSOFT SQL SERVER")
          && !dbProductName.startsWith("POSTGRESQL")) {
        // The AS clause is required for hsqldb. Some other databases might have
        // issues with it, so we're skipping some of them.
        query.append(" AS ").append(tableName);

      Sybase breaks because just using the tablename includes the '.' character and this is invalid for a table alias. The patch attached includes adding "ADAPTIVE SERVER ENTERPRISE" as another product that adding the alias should be skipped for to keep consistency with the current code.  

      Attachments

        1. SQOOP-3344.patch
          0.9 kB
          Tom Ellis

        Activity

          People

            Unassigned Unassigned
            tellisnz Tom Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: