products一个商品价格变化的表,orders商品订单,记录每次购买商品和日期
基于Spark SQL中的不等值join实现orders和products的匹配,统计每个订单中商品对应当时的价格

缓慢变化的商品价格表
旺仔牛奶,发生过一次价格变更

scala> val products = sc.parallelize(Array(
     |   ("旺仔牛奶", "2017-01-01", "2018-01-01", 4),
     |   ("旺仔牛奶", "2018-01-02", "2020-01-01", 5),
     |   ("王老吉", "2017-01-02", "2019-01-01", 5),
     |   ("卫龙辣条", "2010-01-01", "2020-01-01", 2)
     | )).toDF("name", "startDate", "endDate", "price")
products: org.apache.spark.sql.DataFrame = [name: string, startDate: string ... 2 more fields]