Finding efficiently all relevant sub ranges for bigdata tables in Hive/ Spark
问题 Following this question, I would like to ask. I have 2 tables: The first table - MajorRange row | From | To | Group .... -----|--------|---------|--------- 1 | 1200 | 1500 | A 2 | 2200 | 2700 | B 3 | 1700 | 1900 | C 4 | 2100 | 2150 | D ... The second table - SubRange row | From | To | Group .... -----|--------|---------|--------- 1 | 1208 | 1300 | E 2 | 1400 | 1600 | F 3 | 1700 | 2100 | G 4 | 2100 | 2500 | H ... The output table should be the all the SubRange groups who has overlap over the