Page 1 of 1

Clarification on Range Lookups

Posted: Mon Sep 22, 2008 9:30 am
by Vinodanand
Hi ,
I used the look up stage with lookup type as Range in 8.x and have the following issue .


Layouts
Source File :Keys.txt

Contents :
Value
1
102

Reference File : Key_range.txt
Contents :
startvalue, endvalue, description
1 , 100 , A
101 ,200 ,B
Expected Output :
Contents :
Value,Description
1,A
2,B

Issue Description :
i) When I had the source,refernece and target columns defined as varchar the range look up did not work,all the records went to the reject link. But when I changed the dataype to Integer for the columns , Value (Source File ), Start & End value ( reference file) I had a hit and got the desired output .

ii) I decided to swap the source and the reference but kept the datatypes as varchar . So my new job had the following as source and reference files :

Source File : Key_range.txt
Reference File : Keys.txt

Now the look up worked and I got the expected result .

Does it mean that we cannot have integer datatype when the range is done on stream link ( i.e. when the source file is like keys.txt)

Thanks,
Vinod

Posted: Mon Sep 22, 2008 4:10 pm
by ray.wurlod
Integer is fine. There are known problems with VarChar when performing range lookups, at least in version 8.0.

Posted: Mon Sep 22, 2008 9:47 pm
by Vinodanand
Thanks Ray . But its puzzling that varchar / integer works when the range look up is done on the stream column .

So does it mean that I cannot have alphabet keys when the range is on the reference look up (key_range.txt).

Thanks,
Vinod

Posted: Tue Sep 23, 2008 12:57 am
by ray.wurlod
It's a known bug, but yes that's how it is at the moment.

Posted: Tue Sep 23, 2008 6:38 am
by Vinodanand
Thanks ray