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

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

问题描述

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

目前的方法:

从 start_date 和 end_date 之间的 a.create_date 上的连接 b 中选择 a.*,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://issues.apache.org/jira/browse/SPARK-16614

您可以使用 RDD API 来利用 joinWithCassandraTable 函数

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最佳方法查找数据帧以提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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