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

[email protected] commented on SQOOP-387:
-----------------------------------------------------


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


Seem that the TRUNCATE statement may not return the number of affected rows 
like the DELETE statement does.  You may want to consider removing dependency 
on the return count as pointed out below.

An alternative option is to factor out more code to be overridden if the 
dependency is to be kept for other databases.



http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/SqlManager.java
<https://reviews.apache.org/r/4272/#comment12649>

    The return code seems to be 0 for a successful TRUNCATE.



http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/SqlManager.java
<https://reviews.apache.org/r/4272/#comment12650>

    The return count won't make sense for TRUNCATE here.



http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/SqlManager.java
<https://reviews.apache.org/r/4272/#comment12653>

    The return count would be 0 for a successful TRUNCATE.



http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/SqlManager.java
<https://reviews.apache.org/r/4272/#comment12655>

    Due to the reason mentioned above, this checking would fail for PostgreSQL 
now.


- Bilung


On 2012-03-09 17:31:41, Shinichi Yamashita wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/4272/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2012-03-09 17:31:41)
bq.  
bq.  
bq.  Review request for Sqoop and Bilung Lee.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  I fixed SQOOP-387 patch.
bq.  
bq.  1. I add getDeleteQuery method, which returns DELETE statement in 
SqlManager by default and returns TRUNCATE statement in PostgreSQLManager.
bq.  2. Modify deleteAllRecords method and migrateData method of SqlManager to 
use getDeleteQuery method.
bq.  
bq.  
bq.  This addresses bug SQOOP-387.
bq.      https://issues.apache.org/jira/browse/SQOOP-387
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    
http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/PostgresqlManager.java
 1298894 
bq.    
http://svn.apache.org/repos/asf/incubator/sqoop/trunk/src/java/org/apache/sqoop/manager/SqlManager.java
 1298894 
bq.  
bq.  Diff: https://reviews.apache.org/r/4272/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  ant test
bq.  I confirmed "TRUNCATE TABLE" query was executed in PostgreSQL.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  Shinichi
bq.  
bq.


                
> Use TRUNCATE for PostgreSQLManager
> ----------------------------------
>
>                 Key: SQOOP-387
>                 URL: https://issues.apache.org/jira/browse/SQOOP-387
>             Project: Sqoop
>          Issue Type: Improvement
>          Components: connectors/postgresql
>            Reporter: Shinichi Yamashita
>         Attachments: SQOOP-387.patch
>
>
> PostgreSQLManager uses "DELETE" sentence for procesing in staging-table.
> When it does "EXPORT" many times, the processing time is prolonged in 
> "DELETE".
> Therefore replace it with "TRUNCATE" sentence and improve performance.

--
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

        

Reply via email to