hive on spark - 为什么 'select *' 不生成 spark app/executors?

hive on spark - why doesn't 'select *' spawn spark app/executors?

我已经在 Spark(执行引擎)上安装了 Hive (v2.3.4)。

这引发了火花app/executors:

select count(*) from s.t where h_code = 'KGD78' and h_no = '265'

为什么这不发射火花app/executors:

select * from s.t where h_code = 'KGD78' and h_no = '265'

这 - 第二种情况 - 是由于不太知名的 "hive.fetch.task.conversion" 参数。

根据设置方式,Hive 可以启动单个 "fetch task" 而不是 Map Reduce 作业,即使使用过滤器即 where 子句也是如此。

如果您 select * 或非分区列,它将启动提取任务而不是 MR 作业 - 单线程。单线程并不总是一件好事。 count(*) 应该不言而喻,你可能需要进行大量处理,第二种情况可以看作是一个游标。

您可以在 hive-site.xml 中将参数更改为 "minimal" 或 "none" 以避免此类处理。

发现得很好。