You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Jarek Jarcec Cecho (JIRA)" <ji...@apache.org> on 2015/12/30 20:10:49 UTC

[jira] [Updated] (SQOOP-2767) Test is failing SystemImportTest

     [ https://issues.apache.org/jira/browse/SQOOP-2767?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarek Jarcec Cecho updated SQOOP-2767:
--------------------------------------
    Attachment: SQOOP-2767.patch

Attaching patch fixing the problem. Rather then doing anything invasive, I've decided to take careful approach that is verifying if the column name is escaped before accessing the list and if so, removing the escape.

> Test is failing SystemImportTest
> --------------------------------
>
>                 Key: SQOOP-2767
>                 URL: https://issues.apache.org/jira/browse/SQOOP-2767
>             Project: Sqoop
>          Issue Type: Bug
>    Affects Versions: 1.4.6
>            Reporter: Jarek Jarcec Cecho
>            Assignee: Jarek Jarcec Cecho
>             Fix For: 1.4.7
>
>         Attachments: SQOOP-2767.patch
>
>
> I've noticed that {{SystemImportTest}} is constantly failing in my environment. I've dig into the problem and I've noticed that we're no longer able to import {{URITYPE}} from Oracle (it's always imported as {{NULL}}. 
> The test started failing after we made changes back in SQOOP-2723 - the generated select queries has changed from:
> {code}
> SELECT /*+ NO_INDEX(t) */ ID,BD,BF,B,C,CL,D,F,L,NC,NCL,N,NVC,R,uritype.geturl(U),IYM,IDS,T,TZ,TLTZ,RAWCOL,'6_2' data_chunk_id FROM oraoop_test t WHERE
> {code}
> To something like:
> {code}
> SELECT /*+ NO_INDEX(t) */ "ID","BD","BF","B","C","CL","D","F","L","NC","NCL","N","NVC","R","U","IYM","IDS","T","TZ","TLTZ","RAWCOL",'6_1' data_chunk_id FROM oraoop_test  t WHERE 
> {code}
> Notice how the column {{U}} is selected as {{uritype.getUrl()}} in first example and as simple {{U}} in the second one. The problem is that we're doing [special magic|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/oracle/OraOopDBRecordReader.java#L285] based on type in {{OraOopDBRecordReader}}.  The reason why this magic got broken is that we're building a list of all columns with types from the database and then searching for each individual column during select query generation. However the list contains unescaped columns whereas the "work column" is escaped. Hence the [find here|https://github.com/apache/sqoop/blob/trunk/src/java/org/apache/sqoop/manager/oracle/OraOopDBRecordReader.java#L283] always fails.



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