sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Attila Szabo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SQOOP-3124) Fix ordering in column list query of PostgreSQL connector
Date Tue, 17 Jan 2017 15:29:26 GMT

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

Attila Szabo commented on SQOOP-3124:
-------------------------------------

Hey [~vasas],

Do I understand correctly from the details, that the problem is the following:
if the logical order is different from the order we do select right now without the "ORDER
BY" clause, then the fields could be positioned in the map reduce file differently than the
table logics, and could be problematic to the end users?

Thanks,
Attila

ps.: Next time please do not forget to press "patch available" button ;-)

> Fix ordering in column list query of PostgreSQL connector
> ---------------------------------------------------------
>
>                 Key: SQOOP-3124
>                 URL: https://issues.apache.org/jira/browse/SQOOP-3124
>             Project: Sqoop
>          Issue Type: Bug
>    Affects Versions: 1.4.6
>            Reporter: Szabolcs Vasas
>            Assignee: Szabolcs Vasas
>             Fix For: 1.4.7
>
>         Attachments: SQOOP-3124.patch
>
>
> PostgreSQL connector gets the lit of column names from pg_attribute system catalog table
using the following query:
> {code}
> 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 = ?   AND col.ATTNUM >= 1  AND col.ATTISDROPPED = 'f'
> {code}
> This SELECT statement does not contain an ORDER BY clause so the order of the result
set is not guaranteed to be the column order defined during table creation and this can cause
issues for the users.
> The task is to make sure that the result set of this query is sorted by the attnum column
of the pg_attribute table (https://wiki.postgresql.org/wiki/Alter_column_position).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message