sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheolsoo Park (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-445) Wrong query for getListColumnsQuery in PostgresqlManager
Date Tue, 17 Apr 2012 06:11:47 GMT

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

Cheolsoo Park commented on SQOOP-445:
-------------------------------------

I manually tested the fix that Davide is proposing, and it seems to work perfectly. I don't
think that there are any backward compatibility issues that we have to worry about since nobody
shouldn't have relied on this behavior...? If anyone disagrees with me, please let me know.

Here are commands that I ran to verify the proposed fix:

{code}
sqooptest=# create table foo (i integer);
CREATE TABLE

sqooptest=# alter table foo drop column i;
ALTER TABLE

// without col.ATTISDROPPED = 'f'

sqooptest=# SELECT col.ATTNAME FROM PG_CATALOG.PG_NAMESPACE sch,  PG_CATALOG.PG_CLASS tab,
PG_CATALOG.PG_ATTRIBUTE col WHERE sch.OID = tab.RELNAMESPACE   AND tab.OID = col.ATTRELID
  AND sch.NSPNAME = (SELECT CURRENT_SCHEMA())   AND tab.RELNAME = 'foo' AND col.ATTNUM >=
1;
           attname            
------------------------------
 ........pg.dropped.1........
(1 row)

// with col.ATTISDROPPED = 'f'

sqooptest=# SELECT col.ATTNAME FROM PG_CATALOG.PG_NAMESPACE sch,  PG_CATALOG.PG_CLASS tab,
PG_CATALOG.PG_ATTRIBUTE col WHERE sch.OID = tab.RELNAMESPACE   AND tab.OID = col.ATTRELID
  AND sch.NSPNAME = (SELECT CURRENT_SCHEMA())   AND tab.RELNAME = 'foo' AND col.ATTNUM >=
1  AND col.ATTISDROPPED = 'f';
 attname 
---------
(0 rows)
{code}
                
> Wrong query for getListColumnsQuery in PostgresqlManager
> --------------------------------------------------------
>
>                 Key: SQOOP-445
>                 URL: https://issues.apache.org/jira/browse/SQOOP-445
>             Project: Sqoop
>          Issue Type: Bug
>          Components: connectors/postgresql
>    Affects Versions: 1.4.0-incubating, 1.4.1-incubating
>         Environment: PostgreSQL 9.1
>            Reporter: Davide Grohmann
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When querying for column available in a postgres table from postgres catalog, it returns
also the dropped columns from the table in object. It can be easily fixed adding the extra
constraint "AND col.ATTISDROPPED = 'f'" at the end of the query which sort out the dropped
columns.

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

        

Mime
View raw message