在 Batch 模式下:

1. Hive source 会去推断并发数,并发数由文件数决定。你也可以通过
table.exec.hive.infer-source-parallelism=false 来禁止并发推断,
 这时候就会用 job 并发。或者设置一个最大的推断并发数
table.exec.hive.infer-source-parallelism.max。[1]
2. 同上。
3. 这里跟 max-parallelism 应该没有关系,应该是你没有配置 max slot 的原因,source 申请的并发太多,而 yarn
一时半会儿没这么多资源,所以超时了。
   配上 slotmanager.number-of-slots.max 就可以防止 batch 作业无限制地去申请资源。

Best,
Jark

[1]:
https://ci.apache.org/projects/flink/flink-docs-master/dev/table/connectors/hive/hive_read_write.html#source-parallelism-inference
[2]:
https://ci.apache.org/projects/flink/flink-docs-master/deployment/config.html#slotmanager-number-of-slots-max

On Thu, 31 Dec 2020 at 14:56, jiangjiguang719 <[email protected]>
wrote:

> flink1.12版本,使用SQL Client提交任务,读hive表,对并行度有些疑问,以下是现象:
> flink-conf.yaml文件中的:
>   taskmanager.numberOfTaskSlots: 1   有效
>   parallelism.default: 1    无效,实际任务的并行度=hive表的文件 且 <= 160
> sql-client-defaults.yaml 文件中的:
>   execution:
>     parallelism: 10        无效
>     max-parallelism: 16     当hive表的文件数大于此值时,报资源不足  Deployment took more
> than 60 seconds. Please check if the requested resources are available in
> the YARN cluster
> 问题:
> 1、SQL Client提交任务 怎么设置并行度?
> 2、为啥parallelism参数是无效的?
> 3、当hive表文件数大于max-parallelism 时为啥 发布失败?

回复