1datagrip 连接hive时运行select count报错,但是该语句在虚拟机上面运行可以完成
在虚拟机上能运行出结果说明代码是没有问题的
运行的代码:
select province,count(distinct market) as market_count from farm_analyze group by province;
报错截图:
2解决方法
2.1在datagrip上运行以下语句
set hive.exec.mode.local.auto=true;
然后再重新运行一开始的语句,若还是不成功就继续下一步
2.2检查集群文件配置
yarn-site.xml文件里面的内存设置调大一点
2.3重启yarn![](https://i-blog.csdnimg.cn/blog_migrate/7f1a3b96d17b99d31b405831a452640d.png)
2.4重启hive
2.5重新测试连接然后再运行语句
set hive.exec.mode.local.auto=true;
select province,count(distinct market) as market_count from farm_analyze group by province;
应该就能成功了