Spark最佳方法查找Dataframe以提高性能 [英] Spark best approach Look-up Dataframe to improve performance

查看:582
本文介绍了Spark最佳方法查找Dataframe以提高性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

https://github.com/datastax/spark-cassandra-connector/blob/master/doc/2_loading.md#using-joinwithcassandratable

这篇关于Spark最佳方法查找Dataframe以提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆