sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Ellis (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SQOOP-3344) Using --table fails for Sybase when specifying a table name that includes owner
Date Wed, 18 Jul 2018 07:46:00 GMT
Tom Ellis created SQOOP-3344:
--------------------------------

             Summary: Using --table fails for Sybase when specifying a table name that includes
owner
                 Key: SQOOP-3344
                 URL: https://issues.apache.org/jira/browse/SQOOP-3344
             Project: Sqoop
          Issue Type: Bug
          Components: connectors/generic
    Affects Versions: 1.4.7, 1.4.6
            Reporter: Tom Ellis
             Fix For: 3.0.0


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:  
{code:java}
com.sybase.jdbc3.jdbc.SybSQLException: Incorrect syntax near '.'. at com.sybase.jdbc3.tds.Tds.a(Unknown
Source)
{code}
 

This is because in DataDrivenDBRecordReader an alias is added if the DB product name isn't
one of the ones specified:
{code:java}
if (!dbProductName.startsWith("ORACLE")
    && !dbProductName.startsWith("DB2")
    && !dbProductName.startsWith("MICROSOFT SQL SERVER")
    && !dbProductName.startsWith("POSTGRESQL")
    && !dbProductName.startsWith("ADAPTIVE SERVER ENTERPRISE")) {
  // 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);{code}
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.  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message