数据框A(数百万条记录)其中一列是create_date,modified_date
数据框 B 500 条记录具有 start_date 和 end_date
目前的方法:
Select a.*,b.* from a join b on a.create_date between start_date and end_date
上述作业需要半小时或更长时间才能运行。
我怎样才能提高性能
![spark job details](https://i.stack.imgur.com/oAui7.png)
![enter image description here](https://i.stack.imgur.com/4kjdO.png)
DataFrames 目前没有这样的直接连接方法。在执行连接之前它将完全读取两个表。
https://issues.apache.org/jira/browse/SPARK-16614
您可以使用 RDD API 来利用joinWithCassandraTable
功能
https://github.com/datastax/spark-cassandra-connector/blob/master/doc/2_loading.md#using-joinwithcassandratable
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)