Spark最佳方法查找Dataframe以提高性能 [英] Spark best approach Look-up Dataframe to improve performance
问题描述
Dataframe A(百万记录)列之一是create_date,modified_date
Dataframe A (millions of records) one of the column is create_date,modified_date
Dataframe B 500记录有start_date和end_date
Dataframe B 500 records has start_date and end_date
当前方法:
在a.create_date上从start_date和end_date之间的联接b中选择一个。
上述工作需要半小时或更长时间才能运行。
The above job takes half hour or more to run.
我提高了效果
推荐答案
DataFrames目前没有直接连接的方法。在执行连接之前,它将完全读取这两个表。
DataFrames currently doesn't have an approach for direct joins like that. It will fully read both tables before performing a join.
https:// issue。 apache.org/jira/browse/SPARK-16614
您可以使用RDD API利用 joinWithCassandraTable
function
You can use the RDD API to take advantage of the joinWithCassandraTable
function
这篇关于Spark最佳方法查找Dataframe以提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!