Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.4.0-incubating, 1.4.1-incubating
-
None
-
PostgreSQL 9.1
Description
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.
Attachments
Attachments
1.
|
Create a unit test for SQOOP-445 Wrong query for getListColumnsQuery in PostgresqlManager | Resolved | Unassigned |
Activity
Davide Grohmann
created issue -
Cheolsoo Park
made changes -
Field | Original Value | New Value |
---|---|---|
Comment |
[ 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} ] |
Cheolsoo Park
made changes -
Assignee | Cheolsoo Park [ cheolsoo ] |
Cheolsoo Park
made changes -
Status | Open [ 1 ] | Patch Available [ 10002 ] |
Cheolsoo Park
made changes -
Attachment | SQOOP-445.patch [ 12524818 ] |
Cheolsoo Park
made changes -
Attachment | SQOOP-445.patch [ 12524819 ] |
Cheolsoo Park
made changes -
Resolution | Fixed [ 1 ] | |
Status | Patch Available [ 10002 ] | Resolved [ 5 ] |
Abhijeet Gaikwad
made changes -
Fix Version/s | 1.4.2 [ 12320141 ] |
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: