You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "jiraposter@reviews.apache.org (JIRA)" <ji...@apache.org> on 2012/05/16 00:29:09 UTC

[jira] [Commented] (SQOOP-476) If table name is a qualified name, Sqoop import fails in DB2

    [ https://issues.apache.org/jira/browse/SQOOP-476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13276293#comment-13276293 ] 

jiraposter@reviews.apache.org commented on SQOOP-476:
-----------------------------------------------------


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4674/#review7917
-----------------------------------------------------------


Thanks for the patch!  It looks good overall.  One comment though.  It seems that two DB2 record readers are 
provided, but only one of them is actually used by the Db2Manager and is tested by the test case.  Unless the 
generic JDBC manager also works, there is probably no need for the other record reader.

- Bilung


On 2012-04-07 00:30:40, Cheolsoo Park wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4674/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-04-07 00:30:40)
bq.  
bq.  
bq.  Review request for Sqoop.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  During the import job, Sqoop uses the following select query:
bq.  
bq.  SELECT <column names> FROM <table name> AS <table name>
bq.  
bq.  This causes a SQL syntax error for DB2 if table name has a dot "." in it.
bq.  
bq.  
bq.  The changes include:
bq.  
bq.  1) Create DB2-specific DBInputFormat/DBRecordReader + DataDrivenDBInputFormat. Note that DataDrivenDBRecordReader is not subclassed since DB2-specific logic is implemented directly in its getSelectQuery() method.
bq.  
bq.  2) Add a unit test that imports data from a table that has a qualified name.
bq.  
bq.  
bq.  This addresses bug SQOOP-476.
bq.      https://issues.apache.org/jira/browse/SQOOP-476
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    /src/java/org/apache/sqoop/mapreduce/db/DBInputFormat.java 1310644 
bq.    /src/java/org/apache/sqoop/mapreduce/db/DataDrivenDBRecordReader.java 1310644 
bq.    /src/java/org/apache/sqoop/mapreduce/db/Db2DBRecordReader.java PRE-CREATION 
bq.    /src/java/org/apache/sqoop/mapreduce/db/Db2DataDrivenDBInputFormat.java PRE-CREATION 
bq.    /src/java/org/apache/sqoop/mapreduce/db/Db2DataDrivenDBRecordReader.java PRE-CREATION 
bq.    /src/test/com/cloudera/sqoop/manager/DB2ManagerImportManualTest.java 1310644 
bq.    /src/java/org/apache/sqoop/manager/Db2Manager.java 1310644 
bq.  
bq.  Diff: https://reviews.apache.org/r/4674/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Cheolsoo
bq.  
bq.


                
> If table name is a qualified name, Sqoop import fails in DB2
> ------------------------------------------------------------
>
>                 Key: SQOOP-476
>                 URL: https://issues.apache.org/jira/browse/SQOOP-476
>             Project: Sqoop
>          Issue Type: Bug
>            Reporter: Cheolsoo Park
>            Assignee: Cheolsoo Park
>
> In DB2, it is OK to have a dot "." in table name, but it is not in alias. For example, the following query fails:
> {code}
> SELECT * FROM foo.bar AS foo.bar
> SQL0104N  An unexpected token "." was found following "from foo.bar as foo".  
> Expected tokens may include:  ",".  SQLSTATE=42601
> {code}
> During the import job, Sqoop uses the following select query:
> {code}
> SELECT <column names> FROM <table name> AS <table name>
> {code}
> As can be seen, it can be a problem for DB2 if table name has a dot "." in it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira