Jarek Jarcec Cecho created SQOOP-2767:
-----------------------------------------

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


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)

Reply via email to