You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Tom Ellis (JIRA)" <ji...@apache.org> on 2018/07/18 07:47:00 UTC
[jira] [Updated] (SQOOP-3344) Using --table fails for Sybase when
specifying a table name that includes owner
[ https://issues.apache.org/jira/browse/SQOOP-3344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tom Ellis updated SQOOP-3344:
-----------------------------
Attachment: SQOOP-3344.patch
> 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.6, 1.4.7
> Reporter: Tom Ellis
> Priority: Major
> Fix For: 3.0.0
>
> Attachments: SQOOP-3344.patch
>
>
> 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)