How to do range lookup and search in PySpark
问题 I try to code in PySpark a function which can do combination search and lookup values within a range. The following is the detailed description. I have two data sets. One data set, say D1 , is basically a lookup table, as in below: MinValue MaxValue Value1 Value2 --------------------------------- 1 1000 0.5 0.6 1001 2000 0.8 0.1 2001 4000 0.2 0.5 4001 9000 0.04 0.06 The other data set, say D2, is a table with millions of records, for example: ID InterestsRate Days ----------------------------