1 hive mapper数量:
hadoop mapper数量以及hive对此的优化:
hadoop2中,
5000个100M左右的文件,则会产生5000个map任务,建立5000个进程来执行销毁成本较高,
hive默认是使用CombileFileInputFormat,对小文件进行合并,来减少mapper数,
每个进程的开启和关闭耗时,涉及cpu io 带宽 jvm等。
hive-default.xml.template中默认设置如下:
<property> <name>hive.input.format</name> <value>org.apache.hadoop.hive.ql.io.CombineHiveInputFormat</value> <description>The default input format. Set this to HiveInputFormat if you encounter problems with CombineHiveInputFormat.</description> </property>
这样在hive执行mapper task时,会对大量小文件进行合并,让涉及到要操作的文件数据所存储的小文件先进行文件块合并,减少操作的split后在对合并后的文件进行mapper task操作(比如要对 10个50M的存储hdfs文件进行mapper操作,先处理成5个100M的在对这5个文件进行处理这样从10个mapper进程减少到5个)
疑问: hive>descirbe extended stu;后看到表stu都是 textinputformat textoutputformat,
那么这个表的两个format和hive配置文件默认的CombineHiveInputFormat各自使用场景区别在哪?
目前没理解好,找不到答案。
总结: hive mapper数量由两个因素决定 1 inputsplit 2 CombineHiveInputFormat
2 hive reducer数量:
这是默认reducer task任务个数, hive-default.xml.template中设置为:
<property> <name>hive.exec.reducers.max</name> <value>1009</value> <description> max number of reducers will be used. If the one specified in the configuration parameter mapred.reduce.tasks is negative, Hive will use this one as the max number of reducers when automatically determine number of reducers. </description> </property>
hive中查看当前设置的reducer任务个数:
hive>set mapred.reduce.tasks mapred.reduce.tasks=-1
数值为-1时,hive会自动推测决定reduce task数量,而最大数值在上面配置文件中配置好了为1009
如果reduce task个数超过这个数值时,就会排队等待,
设置hivereducer个数:
hive (default)> set mapred.reduce.tasks; mapred.reduce.tasks=3
设置后就意味着hive.exec.reducer.max=3
每个reduce任务处理的数据量也是由限定的,hive-default.xml.template中设置为:
<property> <name>hive.exec.reducers.bytes.per.reducer</name> <value>256000000</value> <description>size per reducer.The default is 256Mb, i.e if the input size is 1G, it will use 4 reducers.</description> </property>
默认是256M,如果给reducer输入的数据量是1G,那么按照默认规则就会分拆成4个reducer。
reducer 任务个数 :
min(向上取整(reduce输入文件大小/reducer默认处理大小) , hive.exec.reducer.max)
eg:
1G的reduce输入数据
hive.exec.reducers.bytes.per.reducer=256M
mapred.reduce.tasks=-1 或者 hive.exec.reducer.max=1009
那么真实产生recuder个数为:
min(向上取整(1G/256m), 1009) = 4;
1T的reduce数据则为 min(向上取整(1T/256m), 1009) = 1009;
相关推荐
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
赠送jar包:flink-connector-hive_2.11-1.12.7.jar; 赠送原API文档:flink-connector-hive_2.11-1.12.7-javadoc.jar; 赠送源代码:flink-connector-hive_2.11-1.12.7-sources.jar; 赠送Maven依赖信息文件:flink-...
hive-jdbc-3.1.2-standalone适用于linux
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驱动
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 ...
hive-jdbc-1.2.1-standalone.jar hive-jdbc驱动jar包,欢迎下载
hive-jdbc-2.3.7-standalone,可用dbeaver连接hive数据库,在工具中进行数据库记录的新增改查
Hive连接的jar包——hive-jdbc-3.1.2-standalone.jar,使用数据库连接软件连接数据仓库时需要使用相应的驱动器驱动,希望对大家有所帮助
hive-jdbc-2.1.1-cdh6.2.0(ieda等jdbc链接hive2.1.1);cdh6.2.0安装的hive2.1.1
jdbc连接hive所需的一个包 ( hive-jdbc-3.1.2.jar)
Missing Hive Execution Jar: /hive/hive1.2.1/lib/hive-exec-*.jar
被编译的hive-hbase-handler-1.2.1.jar,用于在Hive中创建关联HBase表的jar,解决创建Hive关联HBase时报FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. org.apache.hadoop....
apache-hive-3.1.2-bin.tar.gz, 下载自:https://mirrors.bfsu.edu.cn/apache/hive/hive-3.1.2/, 上传至CSDN备份,本资源下载后需要解压缩zip文件,才是原本的apache-hive-3.1.2-bin.tar.gz文件
用java连接hive所必须的jar包,包括hadoop-commmon-2.6.4以及hive-jdbc-1.2.1-standalone
hive-hcatalog-core-1.2.1.jarhive-hcatalog-core-1.2.1.jarhive-hcatalog-core-1.2.1.jar