最近有些同事些sql进行查询时,sql语句里不指定partition字段,这样直接造成hive生成Hadoop的MapReduce任务时查询的数据量巨大,从而影响整个集群的性能。经研究可以通过配置Hive参数来预防此类错误,从而达到优化的目的。
在hive-site.xml中添加以下配置:
<property>
<name>hive.mapred.mode</name>
<value>strict</value>
</property>
这样,在提交类似一下SQL(where中不指定partition条件)时,将会抛出错误而不执行该sql:
hive> select *from access_raw limit 10;
FAILED: Error in semantic analysis: No partition predicate found for Alias "access_raw" Table "access_raw"
而正确书写SQL的方法为:
hive> select *from access_raw where log_date='2012-08-10' limit 10;
这样,就对sql语句进行了过滤。
分享到:
相关推荐
apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tarapache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tar apache-hive-2.1.1-bin.tarapache-hive-2.1.1-bin.tar apache-hive-2.1.1-...
含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-3.1.2-bin.tar.gz 含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-3.1.2-bin.tar.gz 含两个文件hive-jdbc-3.1.2-standalone.jar和apache-hive-...
02、hive-exec-2.1.1-cdh6.3.1.jar 03、hive-jdbc-2.1.1-cdh6.3.1.jar 04、hive-jdbc-2.1.1-cdh6.3.1-standalone.jar 05、hive-metastore-2.1.1-cdh6.3.1.jar 06、hive-service-2.1.1-cdh6.3.1.jar 07、libfb303-...
dbeaver连接hive时需要的驱动包hive-jdbc-uber-2.6.5.0-292.jar
hive-jdbc-3.1.2-standalone适用于linux
hive-jdbc-1.2.1-standalone.jar hive-jdbc驱动jar包,欢迎下载
hive-jdbc-2.1.1-cdh6.2.0(ieda等jdbc链接hive2.1.1);cdh6.2.0安装的hive2.1.1
Hive连接的jar包——hive-jdbc-3.1.2-standalone.jar,使用数据库连接软件连接数据仓库时需要使用相应的驱动器驱动,希望对大家有所帮助
hive-jdbc-2.3.7-standalone,可用dbeaver连接hive数据库,在工具中进行数据库记录的新增改查
hive-jdbc-uber-2.6.5.0-292.jar驱动
hive JDBC jar包全家桶。由于项目使用,此jar包从国外下载费了好大劲,现分享给大家。 cdh6.3.2版本的
hive-jdbc-uber-2.6.5.0-292.jar 驱动下载,hive-jdbc-uber-2.6.5.0-292.jar,hive-jdbc-uber-2.6.5.0-292.jar
hive-jdbc-uber-2.6.5.0-292.jar DbVisualizer (as of version 9.5.5) Below is an example configuration using DbVisualizer: Open the Diver Manager dialog ("Tools" > "Driver Manager...") and hit the ...
Missing Hive Execution Jar: /hive/hive1.2.1/lib/hive-exec-*.jar
用java连接hive所必须的jar包,包括hadoop-commmon-2.6.4以及hive-jdbc-1.2.1-standalone
hive-jdbc-2.1.0.jar
jdbc连接hive所需的一个包 ( hive-jdbc-3.1.2.jar)
kerberos的hive-jdbc-uber-3.1.2包和即席查询的yanagishima
hive2.1.1 show create table 表名,hive中文乱码,替换hive-exec-2.1.1.jar