如何通过查询加速大型配置单元表spark group?

dldeef67  于 2021-06-25  发布在  Hive
关注(0)|答案(0)|浏览(624)

我有一个输入表intab:

  1. create table intab (
  2. ds string comment 'date partition filed'
  3. , id1 string comment 'id1'
  4. , id2 string comment 'id2'
  5. , n int comment 'n'
  6. ) comment 'test'
  7. partition by list(ds)(partition default);

我需要计算outtab:

  1. create table outtab as select
  2. id1, id2, sum(n) as sum_n
  3. from intab group by id1, id2;

intab和outtab都作为rcfile存储在配置单元中。
当使用spark从大量输入计算outtab时,我经常遇到错误,如“error:transportresponsehandler:still have 1 requests outstanding when connection”和spark任务失败。
与中描述的问题类似https://forums.databricks.com/questions/10872/error-transportresponsehandler-still-have-1-reques-1.html,错误只出现在大输入端,即15tb。
“输入”选项卡非常大,有超过5000亿条记录和15 tb的存储容量。
我配置了以下spark参数,但没有帮助:

  1. spark.sql.shuffle.partitions=100000
  2. spark.blacklist.enabled=true
  3. spark.network.timeout=600s
  4. spark.sql.broadcastTimeout=1000
  5. spark.driver.maxResultSize=2g
  6. spark.executor.memoryOverhead=2048
  7. spark.dynamicAllocation.enabled=false
  8. spark.shuffle.service.enabled=false

我已经检查了groupby语句中使用的密钥对(id1,id2)上没有数据倾斜。
任何关于这个问题的帮助都是非常需要的,例如通过优化存储或分区结构,或spark ops等等。。。。
++
在输入数据表intab中,id1和id2有超过10亿个不同的值。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题