简体   繁体   English

Spark Java 中的内部连接

[英]Inner join in spark Java

I'm trying to join two files 10 GB each and using inner join.我正在尝试加入两个文件,每个文件 10 GB 并使用内部联接。 In my cluster there are 3 worker nodes.在我的集群中有 3 个工作节点。

Here is my configuration这是我的配置

Driver Memory: 5G
Executor Memory: 15 G
Cores/Executor: 1
spark.cores.max: 9

Both files are joining on the basis of ID column.两个文件都基于 ID 列加入。 There are 10 millions of records in each file.每个文件中有 1000 万条记录。

Its taking never ending time.它需要永无止境的时间。

Can anyone please suggest ?任何人都可以请建议吗?

You can try following options:您可以尝试以下选项:

  1. Re-partition data重新分区数据

  2. Fix skewed data issue if exists修复倾斜数据问题(如果存在)

  3. set spark.sql.shuffle.partitions (otherwise it will create 200 partitions by default)设置spark.sql.shuffle.partitions (否则默认创建200 个分区)

  4. Update Spark Configuration (considering one node is of - 15G RAM) and 9 Cores更新 Spark 配置(考虑一个节点是 - 15G RAM)和 9 个内核

Driver Memory: 2G
Executor Memory: 7G
cores: 4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM