分享

Hive与HBase整合完整指导

本帖最后由 pig2 于 2014-5-14 19:00 编辑

一、引言

  最近的一次培训,用户特意提到Hadoop环境下HDFS中存储的文件如何才能导入到HBase,关于这部分基于HBase Java API的写入方式,之前曾经有过技术文章共享,本文就不再说明。本文基于Hive执行HDFS批量向HBase导入数据,讲解Hive与HBase的整合问题。这方面的文章已经很多,但是由于版本差异,可操作性不大,本文采用的版本均基于以下版本说明中的版本。

二、版本说明

1.png

三、配置指南3.1 创建配置文件  cp conf/hive-default.xml.template hive-default.xml  cp conf/hive-default.xml.template hive-site.xml  3.2 修改配置文件  基于hive-default.xml.template进行拷贝复制的hive-site.xml文件有问题,主要集中在<description></description>标签不配对的情况,需要根据错误提示进行修改,修改完成后的配置文件如下所示:

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
  3. <!--
  4.    Licensed to the Apache Software Foundation (ASF) under one or more
  5.    contributor license agreements.  See the NOTICE file distributed with
  6.    this work for additional information regarding copyright ownership.
  7.    The ASF licenses this file to You under the Apache License, Version 2.0
  8.    (the "License"); you may not use this file except in compliance with
  9.    the License.  You may obtain a copy of the License at
  10.        http://www.apache.org/licenses/LICENSE-2.0
  11.    Unless required by applicable law or agreed to in writing, software
  12.    distributed under the License is distributed on an "AS IS" BASIS,
  13.    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.    See the License for the specific language governing permissions and
  15.    limitations under the License.
  16. -->
  17. <configuration>
  18. <!-- WARNING!!! This file is provided for documentation purposes ONLY!     -->
  19. <!-- WARNING!!! Any changes you make to this file will be ignored by Hive. -->
  20. <!-- WARNING!!! You must make your changes in hive-site.xml instead.       -->
  21. <!-- Hive Execution Parameters -->
  22. <property>
  23.   <name>mapred.reduce.tasks</name>
  24.   <value>-1</value>
  25.     <description>The default number of reduce tasks per job.  Typically set
  26.   to a prime close to the number of available hosts.  Ignored when
  27.   mapred.job.tracker is "local". Hadoop set this to 1 by default, whereas hive uses -1 as its default value.
  28.   By setting this property to -1, Hive will automatically figure out what should be the number of reducers.
  29.   </description>
  30. </property>
  31. <property>
  32.   <name>hive.exec.reducers.bytes.per.reducer</name>
  33.   <value>1000000000</value>
  34.   <description>size per reducer.The default is 1G, i.e if the input size is 10G, it will use 10 reducers.</description>
  35. </property>
  36. <property>
  37.   <name>hive.exec.reducers.max</name>
  38.   <value>999</value>
  39.   <description>max number of reducers will be used. If the one
  40.     specified in the configuration parameter mapred.reduce.tasks is
  41.     negative, hive will use this one as the max number of reducers when
  42.     automatically determine number of reducers.</description>
  43. </property>
  44. <property>
  45.   <name>hive.cli.print.header</name>
  46.   <value>false</value>
  47.   <description>Whether to print the names of the columns in query output.</description>
  48. </property>
  49. <property>
  50.   <name>hive.cli.print.current.db</name>
  51.   <value>false</value>
  52.   <description>Whether to include the current database in the hive prompt.</description>
  53. </property>
  54. <property>
  55.   <name>hive.cli.prompt</name>
  56.   <value>hive</value>
  57.   <description>Command line prompt configuration value. Other hiveconf can be used in
  58.         this configuration value. Variable substitution will only be invoked at the hive
  59.         cli startup.</description>
  60. </property>
  61. <property>
  62.   <name>hive.exec.scratchdir</name>
  63.   <value>/tmp/hive-${user.name}</value>
  64.   <description>Scratch space for Hive jobs</description>
  65. </property>
  66. <property>
  67.   <name>hive.exec.local.scratchdir</name>
  68.   <value>/tmp/${user.name}</value>
  69.   <description>Local scratch space for Hive jobs</description>
  70. </property>
  71. <property>
  72.   <name>hive.test.mode</name>
  73.   <value>false</value>
  74.   <description>whether hive is running in test mode. If yes, it turns on sampling and prefixes the output tablename</description>
  75. </property>
  76. <property>
  77.   <name>hive.test.mode.prefix</name>
  78.   <value>test_</value>
  79.   <description>if hive is running in test mode, prefixes the output table by this string</description>
  80. </property>
  81. <!-- If the input table is not bucketed, the denominator of the tablesample is determinied by the parameter below   -->
  82. <!-- For example, the following query:                                                                              -->
  83. <!--   INSERT OVERWRITE TABLE dest                                                                                  -->
  84. <!--   SELECT col1 from src                                                                                         -->
  85. <!-- would be converted to                                                                                          -->
  86. <!--   INSERT OVERWRITE TABLE test_dest                                                                             -->
  87. <!--   SELECT col1 from src TABLESAMPLE (BUCKET 1 out of 32 on rand(1))                                             -->
  88. <property>
  89.   <name>hive.test.mode.samplefreq</name>
  90.   <value>32</value>
  91.   <description>if hive is running in test mode and table is not bucketed, sampling frequency</description>
  92. </property>
  93. <property>
  94.   <name>hive.test.mode.nosamplelist</name>
  95.   <value></value>
  96.   <description>if hive is running in test mode, dont sample the above comma seperated list of tables</description>
  97. </property>
  98. <property>
  99.   <name>hive.metastore.uris</name>
  100.   <value></value>
  101.   <description>Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.</description>
  102. </property>
  103. <property>
  104.   <name>javax.jdo.option.ConnectionURL</name>
  105.   <value>jdbc:derby:;databaseName=metastore_db;create=true</value>
  106.   <description>JDBC connect string for a JDBC metastore</description>
  107. </property>
  108. <property>
  109.   <name>javax.jdo.option.ConnectionDriverName</name>
  110.   <value>org.apache.derby.jdbc.EmbeddedDriver</value>
  111.   <description>Driver class name for a JDBC metastore</description>
  112. </property>
  113. <property>
  114.   <name>javax.jdo.PersistenceManagerFactoryClass</name>
  115.   <value>org.datanucleus.jdo.JDOPersistenceManagerFactory</value>
  116.   <description>class implementing the jdo persistence</description>
  117. </property>
  118. <property>
  119.   <name>javax.jdo.option.DetachAllOnCommit</name>
  120.   <value>true</value>
  121.   <description>detaches all objects from session so that they can be used after transaction is committed</description>
  122. </property>
  123. <property>
  124.   <name>javax.jdo.option.NonTransactionalRead</name>
  125.   <value>true</value>
  126.   <description>reads outside of transactions</description>
  127. </property>
  128. <property>
  129.   <name>javax.jdo.option.ConnectionUserName</name>
  130.   <value>APP</value>
  131.   <description>username to use against metastore database</description>
  132. </property>
  133. <property>
  134.   <name>javax.jdo.option.ConnectionPassword</name>
  135.   <value>mine</value>
  136.   <description>password to use against metastore database</description>
  137. </property>
  138. <property>
  139.   <name>javax.jdo.option.Multithreaded</name>
  140.   <value>true</value>
  141.   <description>Set this to true if multiple threads access metastore through JDO concurrently.</description>
  142. </property>
  143. <property>
  144.   <name>datanucleus.connectionPoolingType</name>
  145.   <value>DBCP</value>
  146.   <description>Uses a DBCP connection pool for JDBC metastore</description>
  147. </property>
  148. <property>
  149.   <name>datanucleus.validateTables</name>
  150.   <value>false</value>
  151.   <description>validates existing schema against code. turn this on if you want to verify existing schema </description>
  152. </property>
  153. <property>
  154.   <name>datanucleus.validateColumns</name>
  155.   <value>false</value>
  156.   <description>validates existing schema against code. turn this on if you want to verify existing schema </description>
  157. </property>
  158. <property>
  159.   <name>datanucleus.validateConstraints</name>
  160.   <value>false</value>
  161.   <description>validates existing schema against code. turn this on if you want to verify existing schema </description>
  162. </property>
  163. <property>
  164.   <name>datanucleus.storeManagerType</name>
  165.   <value>rdbms</value>
  166.   <description>metadata store type</description>
  167. </property>
  168. <property>
  169.   <name>datanucleus.autoCreateSchema</name>
  170.   <value>true</value>
  171.   <description>creates necessary schema on a startup if one doesn't exist. set this to false, after creating it once</description>
  172. </property>
  173. <property>
  174.   <name>datanucleus.autoStartMechanismMode</name>
  175.   <value>checked</value>
  176.   <description>throw exception if metadata tables are incorrect</description>
  177. </property>
  178. <property>
  179.   <name>datanucleus.transactionIsolation</name>
  180.   <value>read-committed</value>
  181.   <description>Default transaction isolation level for identity generation. </description>
  182. </property>
  183. <property>
  184.   <name>datanucleus.cache.level2</name>
  185.   <value>false</value>
  186.   <description>Use a level 2 cache. Turn this off if metadata is changed independently of hive metastore server</description>
  187. </property>
  188. <property>
  189.   <name>datanucleus.cache.level2.type</name>
  190.   <value>SOFT</value>
  191.   <description>SOFT=soft reference based cache, WEAK=weak reference based cache.</description>
  192. </property>
  193. <property>
  194.   <name>datanucleus.identifierFactory</name>
  195.   <value>datanucleus</value>
  196.   <description>Name of the identifier factory to use when generating table/column names etc. 'datanucleus' is used for backward compatibility</description>
  197. </property>
  198. <property>
  199.   <name>datanucleus.plugin.pluginRegistryBundleCheck</name>
  200.   <value>LOG</value>
  201.   <description>Defines what happens when plugin bundles are found and are duplicated [EXCEPTION|LOG|NONE]</description>
  202. </property>
  203. <property>
  204.   <name>hive.metastore.warehouse.dir</name>
  205.   <value>/user/hive/warehouse</value>
  206.   <description>location of default database for the warehouse</description>
  207. </property>
  208. <property>
  209.   <name>hive.metastore.execute.setugi</name>
  210.   <value>false</value>
  211.   <description>In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.</description>
  212. </property>
  213. <property>
  214.   <name>hive.metastore.event.listeners</name>
  215.   <value></value>
  216.   <description>list of comma seperated listeners for metastore events.</description>
  217. </property>
  218. <property>
  219.   <name>hive.metastore.partition.inherit.table.properties</name>
  220.   <value></value>
  221.   <description>list of comma seperated keys occurring in table properties which will get inherited to newly created partitions. * implies all the keys will get inherited.</description>
  222. </property>
  223. <property>
  224.   <name>hive.metadata.export.location</name>
  225.   <value></value>
  226.   <description>When used in conjunction with the org.apache.hadoop.hive.ql.parse.MetaDataExportListener pre event listener, it is the location to which the metadata will be exported. The default is an empty string, which results in the metadata being exported to the current user's home directory on HDFS.</description>
  227. </property>
  228. <property>
  229.   <name>hive.metadata.move.exported.metadata.to.trash</name>
  230.   <value></value>
  231.   <description>When used in conjunction with the org.apache.hadoop.hive.ql.parse.MetaDataExportListener pre event listener, this setting determines if the metadata that is exported will subsequently be moved to the user's trash directory alongside the dropped table data. This ensures that the metadata will be cleaned up along with the dropped table data.</description>
  232. </property>
  233. <property>
  234.   <name>hive.metastore.partition.name.whitelist.pattern</name>
  235.   <value></value>
  236.   <description>Partition names will be checked against this regex pattern and rejected if not matched.  To use, enable hive.metastore.pre.event.listeners=org.apache.hadoop.hive.metastore.PartitionNameWhitelistPreEventListener  Listener will not register if this property value is empty.</description>
  237. </property>
  238. <property>
  239.   <name>hive.metastore.end.function.listeners</name>
  240.   <value></value>
  241.   <description>list of comma separated listeners for the end of metastore functions.</description>
  242. </property>
  243. <property>
  244.   <name>hive.metastore.event.expiry.duration</name>
  245.   <value>0</value>
  246.   <description>Duration after which events expire from events table (in seconds)</description>
  247. </property>
  248. <property>
  249.   <name>hive.metastore.event.clean.freq</name>
  250.   <value>0</value>
  251.   <description>Frequency at which timer task runs to purge expired events in metastore(in seconds).</description>
  252. </property>
  253. <property>
  254.   <name>hive.metastore.connect.retries</name>
  255.   <value>5</value>
  256.   <description>Number of retries while opening a connection to metastore</description>
  257. </property>
  258. <property>
  259.   <name>hive.metastore.failure.retries</name>
  260.   <value>3</value>
  261.   <description>Number of retries upon failure of Thrift metastore calls</description>
  262. </property>
  263. <property>
  264.   <name>hive.metastore.client.connect.retry.delay</name>
  265.   <value>1</value>
  266.   <description>Number of seconds for the client to wait between consecutive connection attempts</description>
  267. </property>
  268. <property>
  269.   <name>hive.metastore.client.socket.timeout</name>
  270.   <value>20</value>
  271.   <description>MetaStore Client socket timeout in seconds</description>
  272. </property>
  273. <property>
  274.   <name>hive.metastore.rawstore.impl</name>
  275.   <value>org.apache.hadoop.hive.metastore.ObjectStore</value>
  276.   <description>Name of the class that implements org.apache.hadoop.hive.metastore.rawstore interface. This class is used to store and retrieval of raw metadata objects such as table, database</description>
  277. </property>
  278. <property>
  279.   <name>hive.metastore.batch.retrieve.max</name>
  280.   <value>300</value>
  281.   <description>Maximum number of objects (tables/partitions) can be retrieved from metastore in one batch. The higher the number, the less the number of round trips is needed to the Hive metastore server, but it may also cause higher memory requirement at the client side.</description>
  282. </property>
  283. <property>
  284.   <name>hive.metastore.batch.retrieve.table.partition.max</name>
  285.   <value>1000</value>
  286.   <description>Maximum number of table partitions that metastore internally retrieves in one batch.</description>
  287. </property>
  288. <property>
  289.   <name>hive.default.fileformat</name>
  290.   <value>TextFile</value>
  291.   <description>Default file format for CREATE TABLE statement. Options are TextFile and SequenceFile. Users can explicitly say CREATE TABLE ... STORED AS <TEXTFILE|SEQUENCEFILE> to override</description>
  292. </property>
  293. <property>
  294.   <name>hive.fileformat.check</name>
  295.   <value>true</value>
  296.   <description>Whether to check file format or not when loading data files</description>
  297. </property>
  298. <property>
  299.   <name>hive.map.aggr</name>
  300.   <value>true</value>
  301.   <description>Whether to use map-side aggregation in Hive Group By queries</description>
  302. </property>
  303. <property>
  304.   <name>hive.groupby.skewindata</name>
  305.   <value>false</value>
  306.   <description>Whether there is skew in data to optimize group by queries</description>
  307. </property>
  308. <property>
  309.   <name>hive.groupby.mapaggr.checkinterval</name>
  310.   <value>100000</value>
  311.   <description>Number of rows after which size of the grouping keys/aggregation classes is performed</description>
  312. </property>
  313. <property>
  314.   <name>hive.mapred.local.mem</name>
  315.   <value>0</value>
  316.   <description>For local mode, memory of the mappers/reducers</description>
  317. </property>
  318. <property>
  319.   <name>hive.mapjoin.followby.map.aggr.hash.percentmemory</name>
  320.   <value>0.3</value>
  321.   <description>Portion of total memory to be used by map-side grup aggregation hash table, when this group by is followed by map join</description>
  322. </property>
  323. <property>
  324.   <name>hive.map.aggr.hash.force.flush.memory.threshold</name>
  325.   <value>0.9</value>
  326.   <description>The max memory to be used by map-side grup aggregation hash table, if the memory usage is higher than this number, force to flush data</description>
  327. </property>
  328. <property>
  329.   <name>hive.map.aggr.hash.percentmemory</name>
  330.   <value>0.5</value>
  331.   <description>Portion of total memory to be used by map-side grup aggregation hash table</description>
  332. </property>
  333. <property>
  334.   <name>hive.map.aggr.hash.min.reduction</name>
  335.   <value>0.5</value>
  336.   <description>Hash aggregation will be turned off if the ratio between hash
  337.   table size and input rows is bigger than this number. Set to 1 to make sure
  338.   hash aggregation is never turned off.</description>
  339. </property>
  340. <property>
  341.   <name>hive.optimize.cp</name>
  342.   <value>true</value>
  343.   <description>Whether to enable column pruner</description>
  344. </property>
  345. <property>
  346.   <name>hive.optimize.index.filter</name>
  347.   <value>false</value>
  348.   <description>Whether to enable automatic use of indexes</description>
  349. </property>
  350. <property>
  351.   <name>hive.optimize.index.groupby</name>
  352.   <value>false</value>
  353.   <description>Whether to enable optimization of group-by queries using Aggregate indexes.</description>
  354. </property>
  355. <property>
  356.   <name>hive.optimize.ppd</name>
  357.   <value>true</value>
  358.   <description>Whether to enable predicate pushdown</description>
  359. </property>
  360. <property>
  361.   <name>hive.optimize.ppd.storage</name>
  362.   <value>true</value>
  363.   <description>Whether to push predicates down into storage handlers.  Ignored when hive.optimize.ppd is false.</description>
  364. </property>
  365. <property>
  366.   <name>hive.ppd.recognizetransivity</name>
  367.   <value>true</value>
  368.   <description>Whether to transitively replicate predicate filters over equijoin conditions.</description>
  369. </property>
  370. <property>
  371.   <name>hive.optimize.groupby</name>
  372.   <value>true</value>
  373.   <description>Whether to enable the bucketed group by from bucketed partitions/tables.</description>
  374. </property>
  375. <property>
  376.   <name>hive.optimize.skewjoin.compiletime</name>
  377.   <value>false</value>
  378.   <description>Whether to create a separate plan for skewed keys for the tables in the join.
  379.     This is based on the skewed keys stored in the metadata. At compile time, the plan is broken
  380.     into different joins: one for the skewed keys, and the other for the remaining keys. And then,
  381.     a union is performed for the 2 joins generated above. So unless the same skewed key is present
  382.     in both the joined tables, the join for the skewed key will be performed as a map-side join.
  383.     The main difference between this paramater and hive.optimize.skewjoin is that this parameter
  384.     uses the skew information stored in the metastore to optimize the plan at compile time itself.
  385.     If there is no skew information in the metadata, this parameter will not have any affect.
  386.     Both hive.optimize.skewjoin.compiletime and hive.optimize.skewjoin should be set to true.
  387.     Ideally, hive.optimize.skewjoin should be renamed as hive.optimize.skewjoin.runtime, but not doing
  388.     so for backward compatibility.
  389.     If the skew information is correctly stored in the metadata, hive.optimize.skewjoin.compiletime
  390.     would change the query plan to take care of it, and hive.optimize.skewjoin will be a no-op.
  391.   </description>
  392. </property>
  393. <property>
  394.   <name>hive.optimize.union.remove</name>
  395.   <value>false</value>
  396.   <description>
  397.     Whether to remove the union and push the operators between union and the filesink above
  398.     union. This avoids an extra scan of the output by union. This is independently useful for union
  399.     queries, and specially useful when hive.optimize.skewjoin.compiletime is set to true, since an
  400.     extra union is inserted.
  401.     The merge is triggered if either of hive.merge.mapfiles or hive.merge.mapredfiles is set to true.
  402.     If the user has set hive.merge.mapfiles to true and hive.merge.mapredfiles to false, the idea was the
  403.     number of reducers are few, so the number of files anyway are small. However, with this optimization,
  404.     we are increasing the number of files possibly by a big margin. So, we merge aggresively.
  405.    </description>
  406. </property>
  407. <property>
  408.   <name>hive.mapred.supports.subdirectories</name>
  409.   <value>false</value>
  410.       <description>Whether the version of hadoop which is running supports sub-directories for tables/partitions.
  411.     Many hive optimizations can be applied if the hadoop version supports sub-directories for
  412.     tables/partitions. It was added by MAPREDUCE-1501
  413.     </description>
  414. </property>
  415. <property>
  416.   <name>hive.multigroupby.singlemr</name>
  417.   <value>false</value>
  418.   <description>Whether to optimize multi group by query to generate single M/R
  419.   job plan. If the multi group by query has common group by keys, it will be
  420.   optimized to generate single M/R job.</description>
  421. </property>
  422. <property>
  423.   <name>hive.map.groupby.sorted</name>
  424.   <value>false</value>
  425.   <description>If the bucketing/sorting properties of the table exactly match the grouping key, whether to
  426.     perform the group by in the mapper by using BucketizedHiveInputFormat. The only downside to this
  427.     is that it limits the number of mappers to the number of files.
  428.   </description>
  429. </property>
  430. <property>
  431.   <name>hive.join.emit.interval</name>
  432.   <value>1000</value>
  433.   <description>How many rows in the right-most join operand Hive should buffer before emitting the join result. </description>
  434. </property>
  435. <property>
  436.   <name>hive.join.cache.size</name>
  437.   <value>25000</value>
  438.   <description>How many rows in the joining tables (except the streaming table) should be cached in memory. </description>
  439. </property>
  440. <property>
  441.   <name>hive.mapjoin.bucket.cache.size</name>
  442.   <value>100</value>
  443.   <description>How many values in each keys in the map-joined table should be cached in memory. </description>
  444. </property>
  445. <property>
  446.   <name>hive.mapjoin.cache.numrows</name>
  447.   <value>25000</value>
  448.   <description>How many rows should be cached by jdbm for map join. </description>
  449. </property>
  450. <property>
  451.   <name>hive.optimize.skewjoin</name>
  452.   <value>false</value>
  453.   <description>Whether to enable skew join optimization.
  454.     The algorithm is as follows: At runtime, detect the keys with a large skew. Instead of
  455.     processing those keys, store them temporarily in a hdfs directory. In a follow-up map-reduce
  456.     job, process those skewed keys. The same key need not be skewed for all the tables, and so,
  457.     the follow-up map-reduce job (for the skewed keys) would be much faster, since it would be a
  458.     map-join.
  459. </description>
  460. </property>
  461. <property>
  462.   <name>hive.exec.list.bucketing.default.dir</name>
  463.   <value>HIVE_DEFAULT_LIST_BUCKETING_DIR_NAME</value>
  464.   <description>Default directory name used in list bucketing.
  465.     List bucketing feature will create sub-directory for each skewed-value and a default directory
  466.     for non-skewed value. This config specifies the default name for the default directory.
  467.     Sub-directory is created by list bucketing DML and under partition directory. User doesn't need
  468.     to know how to construct the canonical path. It just gives user choice if they want to change
  469.     the default directory name.
  470.     For example, there are 2 skewed column c1 and c2. 2 skewed value: (1,a) and (2,b). subdirectory:
  471.     <partition-dir>/c1=1/c2=a/</partition-dir>
  472.     <partition-dir>/c1=2/c2=b/</partition-dir>
  473.     <partition-dir>/HIVE_DEFAULT_LIST_BUCKETING_DIR_NAME/HIVE_DEFAULT_LIST_BUCKETING_DIR_NAME/</partition-dir>
  474.     Note: This config won't impact users if they don't list bucketing.
  475.     </description>
  476. </property>
  477. <property>
  478.   <name>hive.skewjoin.key</name>
  479.   <value>100000</value>
  480.   <description>Determine if we get a skew key in join. If we see more
  481.     than the specified number of rows with the same key in join operator,
  482.     we think the key as a skew join key. </description>
  483. </property>
  484. <property>
  485.   <name>hive.skewjoin.mapjoin.map.tasks</name>
  486.   <value>10000</value>
  487.   <description> Determine the number of map task used in the follow up map join job
  488.     for a skew join. It should be used together with hive.skewjoin.mapjoin.min.split
  489.     to perform a fine grained control.</description>
  490. </property>
  491. <property>
  492.   <name>hive.skewjoin.mapjoin.min.split</name>
  493.   <value>33554432</value>
  494.   <description> Determine the number of map task at most used in the follow up map join job
  495.     for a skew join by specifying the minimum split size. It should be used together with
  496.     hive.skewjoin.mapjoin.map.tasks to perform a fine grained control.</description>
  497. </property>
  498. <property>
  499.   <name>hive.mapred.mode</name>
  500.   <value>nonstrict</value>
  501.   <description>The mode in which the hive operations are being performed.
  502.      In strict mode, some risky queries are not allowed to run. They include:
  503.        Cartesian Product.
  504.        No partition being picked up for a query.
  505.        Comparing bigints and strings.
  506.        Comparing bigints and doubles.
  507.        Orderby without limit.
  508.   </description>
  509. </property>
  510. <property>
  511.   <name>hive.enforce.bucketmapjoin</name>
  512.   <value>false</value>
  513.   <description>If the user asked for bucketed map-side join, and it cannot be performed,
  514.     should the query fail or not ? For eg, if the buckets in the tables being joined are
  515.     not a multiple of each other, bucketed map-side join cannot be performed, and the
  516.     query will fail if hive.enforce.bucketmapjoin is set to true.
  517.   </description>
  518. </property>
  519. <property>
  520.   <name>hive.exec.script.maxerrsize</name>
  521.   <value>100000</value>
  522.   <description>Maximum number of bytes a script is allowed to emit to standard error (per map-reduce task). This prevents runaway scripts from filling logs partitions to capacity </description>
  523. </property>
  524. <property>
  525.   <name>hive.exec.script.allow.partial.consumption</name>
  526.   <value>false</value>
  527.   <description> When enabled, this option allows a user script to exit successfully without consuming all the data from the standard input.
  528.   </description>
  529. </property>
  530. <property>
  531.   <name>hive.script.operator.id.env.var</name>
  532.   <value>HIVE_SCRIPT_OPERATOR_ID</value>
  533.   <description> Name of the environment variable that holds the unique script operator ID in the user's transform function (the custom mapper/reducer that the user has specified in the query)
  534.   </description>
  535. </property>
  536. <property>
  537.   <name>hive.script.operator.truncate.env</name>
  538.   <value>false</value>
  539.   <description>Truncate each environment variable for external script in scripts operator to 20KB (to fit system limits)</description>
  540. </property>
  541. <property>
  542.   <name>hive.exec.compress.output</name>
  543.   <value>false</value>
  544.   <description> This controls whether the final outputs of a query (to a local/hdfs file or a hive table) is compressed. The compression codec and other options are determined from hadoop config variables mapred.output.compress* </description>
  545. </property>
  546. <property>
  547.   <name>hive.exec.compress.intermediate</name>
  548.   <value>false</value>
  549.   <description> This controls whether intermediate files produced by hive between multiple map-reduce jobs are compressed. The compression codec and other options are determined from hadoop config variables mapred.output.compress* </description>
  550. </property>
  551. <property>
  552.   <name>hive.exec.parallel</name>
  553.   <value>false</value>
  554.   <description>Whether to execute jobs in parallel</description>
  555. </property>
  556. <property>
  557.   <name>hive.exec.parallel.thread.number</name>
  558.   <value>8</value>
  559.   <description>How many jobs at most can be executed in parallel</description>
  560. </property>
  561. <property>
  562.   <name>hive.exec.rowoffset</name>
  563.   <value>false</value>
  564.   <description>Whether to provide the row offset virtual column</description>
  565. </property>
  566. <property>
  567.   <name>hive.task.progress</name>
  568.   <value>false</value>
  569.   <description>Whether Hive should periodically update task progress counters during execution.  Enabling this allows task progress to be monitored more closely in the job tracker, but may impose a performance penalty.  This flag is automatically set to true for jobs with hive.exec.dynamic.partition set to true.</description>
  570. </property>
  571. <property>
  572.   <name>hive.hwi.war.file</name>
  573.   <value>lib/hive-hwi-0.10.0.war</value>
  574.   <description>This sets the path to the HWI war file, relative to ${HIVE_HOME}. </description>
  575. </property>
  576. <property>
  577.   <name>hive.hwi.listen.host</name>
  578.   <value>0.0.0.0</value>
  579.   <description>This is the host address the Hive Web Interface will listen on</description>
  580. </property>
  581. <property>
  582.   <name>hive.hwi.listen.port</name>
  583.   <value>9999</value>
  584.   <description>This is the port the Hive Web Interface will listen on</description>
  585. </property>
  586. <property>
  587.   <name>hive.exec.pre.hooks</name>
  588.   <value></value>
  589.   <description>Comma-separated list of pre-execution hooks to be invoked for each statement.  A pre-execution hook is specified as the name of a Java class which implements the org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext interface.</description>
  590. </property>
  591. <property>
  592.   <name>hive.exec.post.hooks</name>
  593.   <value></value>
  594.   <description>Comma-separated list of post-execution hooks to be invoked for each statement.  A post-execution hook is specified as the name of a Java class which implements the org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext interface.</description>
  595. </property>
  596. <property>
  597.   <name>hive.exec.failure.hooks</name>
  598.   <value></value>
  599.   <description>Comma-separated list of on-failure hooks to be invoked for each statement.  An on-failure hook is specified as the name of Java class which implements the org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext interface.</description>
  600. </property>
  601. <property>
  602.   <name>hive.client.stats.publishers</name>
  603.   <value></value>
  604.   <description>Comma-separated list of statistics publishers to be invoked on counters on each job.  A client stats publisher is specified as the name of a Java class which implements the org.apache.hadoop.hive.ql.stats.ClientStatsPublisher interface.</description>
  605. </property>
  606. <property>
  607.   <name>hive.client.stats.counters</name>
  608.   <value></value>
  609.   <description>Subset of counters that should be of interest for hive.client.stats.publishers (when one wants to limit their publishing). Non-display names should be used</description>
  610. </property>
  611. <property>
  612.   <name>hive.merge.mapfiles</name>
  613.   <value>true</value>
  614.   <description>Merge small files at the end of a map-only job</description>
  615. </property>
  616. <property>
  617.   <name>hive.merge.mapredfiles</name>
  618.   <value>false</value>
  619.   <description>Merge small files at the end of a map-reduce job</description>
  620. </property>
  621. <property>
  622.   <name>hive.mergejob.maponly</name>
  623.   <value>true</value>
  624.   <description>Try to generate a map-only job for merging files if CombineHiveInputFormat is supported.</description>
  625. </property>
  626. <property>
  627.   <name>hive.heartbeat.interval</name>
  628.   <value>1000</value>
  629.   <description>Send a heartbeat after this interval - used by mapjoin and filter operators</description>
  630. </property>
  631. <property>
  632.   <name>hive.merge.size.per.task</name>
  633.   <value>256000000</value>
  634.   <description>Size of merged files at the end of the job</description>
  635. </property>
  636. <property>
  637.   <name>hive.merge.smallfiles.avgsize</name>
  638.   <value>16000000</value>
  639.   <description>When the average output file size of a job is less than this number, Hive will start an additional map-reduce job to merge the output files into bigger files.  This is only done for map-only jobs if hive.merge.mapfiles is true, and for map-reduce jobs if hive.merge.mapredfiles is true.</description>
  640. </property>
  641. <property>
  642.   <name>hive.mapjoin.smalltable.filesize</name>
  643.   <value>25000000</value>
  644.   <description>The threshold for the input file size of the small tables; if the file size is smaller than this threshold, it will try to convert the common join into map join</description>
  645. </property>
  646. <property>
  647.   <name>hive.mapjoin.localtask.max.memory.usage</name>
  648.   <value>0.90</value>
  649.   <description>This number means how much memory the local task can take to hold the key/value into in-memory hash table; If the local task's memory usage is more than this number, the local task will be abort by themself. It means the data of small table is too large to be hold in the memory.</description>
  650. </property>
  651. <property>
  652.   <name>hive.mapjoin.followby.gby.localtask.max.memory.usage</name>
  653.   <value>0.55</value>
  654.   <description>This number means how much memory the local task can take to hold the key/value into in-memory hash table when this map join followed by a group by; If the local task's memory usage is more than this number, the local task will be abort by themself. It means the data of small table is too large to be hold in the memory.</description>
  655. </property>
  656. <property>
  657.   <name>hive.mapjoin.check.memory.rows</name>
  658.   <value>100000</value>
  659.   <description>The number means after how many rows processed it needs to check the memory usage</description>
  660. </property>
  661. <property>
  662.   <name>hive.auto.convert.join</name>
  663.   <value>false</value>
  664.   <description>Whether Hive enable the optimization about converting common join into mapjoin based on the input file size</description>
  665. </property>
  666. <property>
  667.   <name>hive.script.auto.progress</name>
  668.   <value>false</value>
  669.   <description>Whether Hive Tranform/Map/Reduce Clause should automatically send progress information to TaskTracker to avoid the task getting killed because of inactivity.  Hive sends progress information when the script is outputting to stderr.  This option removes the need of periodically producing stderr messages, but users should be cautious because this may prevent infinite loops in the scripts to be killed by TaskTracker.  </description>
  670. </property>
  671. <property>
  672.   <name>hive.script.serde</name>
  673.   <value>org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe</value>
  674.   <description>The default serde for trasmitting input data to and reading output data from the user scripts. </description>
  675. </property>
  676. <property>
  677.   <name>hive.binary.record.max.length</name>
  678.   <value>1000</value>
  679.   <description>Read from a binary stream and treat each hive.binary.record.max.length bytes as a record.
  680.   The last record before the end of stream can have less than hive.binary.record.max.length bytes</description>
  681. </property>
  682. <property>
  683.   <name>hive.script.recordreader</name>
  684.   <value>org.apache.hadoop.hive.ql.exec.TextRecordReader</value>
  685.   <description>The default record reader for reading data from the user scripts. </description>
  686. </property>
  687. <property>
  688.   <name>hive.script.recordwriter</name>
  689.   <value>org.apache.hadoop.hive.ql.exec.TextRecordWriter</value>
  690.   <description>The default record writer for writing data to the user scripts. </description>
  691. </property>
  692. <property>
  693.   <name>hive.input.format</name>
  694.   <value>org.apache.hadoop.hive.ql.io.CombineHiveInputFormat</value>
  695.   <description>The default input format. Set this to HiveInputFormat if you encounter problems with CombineHiveInputFormat.</description>
  696. </property>
  697. <property>
  698.   <name>hive.udtf.auto.progress</name>
  699.   <value>false</value>
  700.   <description>Whether Hive should automatically send progress information to TaskTracker when using UDTF's to prevent the task getting killed because of inactivity.  Users should be cautious because this may prevent TaskTracker from killing tasks with infinte loops.  </description>
  701. </property>
  702. <property>
  703.   <name>hive.mapred.reduce.tasks.speculative.execution</name>
  704.   <value>true</value>
  705.   <description>Whether speculative execution for reducers should be turned on. </description>
  706. </property>
  707. <property>
  708.   <name>hive.exec.counters.pull.interval</name>
  709.   <value>1000</value>
  710.   <description>The interval with which to poll the JobTracker for the counters the running job. The smaller it is the more load there will be on the jobtracker, the higher it is the less granular the caught will be.</description>
  711. </property>
  712. <property>
  713.   <name>hive.querylog.location</name>
  714.   <value>/tmp/${user.name}</value>
  715.   <description>
  716.     Location of Hive run time structured log file
  717.   </description>
  718. </property>
  719. <property>
  720.   <name>hive.querylog.enable.plan.progress</name>
  721.   <value>true</value>
  722.   <description>
  723.     Whether to log the plan's progress every time a job's progress is checked.
  724.     These logs are written to the location specified by hive.querylog.location
  725.   </description>
  726. </property>
  727. <property>
  728.   <name>hive.querylog.plan.progress.interval</name>
  729.   <value>60000</value>
  730.   <description>
  731.     The interval to wait between logging the plan's progress in milliseconds.
  732.     If there is a whole number percentage change in the progress of the mappers or the reducers,
  733.     the progress is logged regardless of this value.
  734.     The actual interval will be the ceiling of (this value divided by the value of
  735.     hive.exec.counters.pull.interval) multiplied by the value of hive.exec.counters.pull.interval
  736.     I.e. if it is not divide evenly by the value of hive.exec.counters.pull.interval it will be
  737.     logged less frequently than specified.
  738.     This only has an effect if hive.querylog.enable.plan.progress is set to true.
  739.   </description>
  740. </property>
  741. <property>
  742.   <name>hive.enforce.bucketing</name>
  743.   <value>false</value>
  744.   <description>Whether bucketing is enforced. If true, while inserting into the table, bucketing is enforced. </description>
  745. </property>
  746. <property>
  747.   <name>hive.enforce.sorting</name>
  748.   <value>false</value>
  749.   <description>Whether sorting is enforced. If true, while inserting into the table, sorting is enforced. </description>
  750. </property>
  751. <property>
  752.   <name>hive.enforce.sortmergebucketmapjoin</name>
  753.   <value>false</value>
  754.   <description>If the user asked for sort-merge bucketed map-side join, and it cannot be performed,
  755.     should the query fail or not ?
  756.   </description>
  757. </property>
  758. <property>
  759.   <name>hive.metastore.ds.connection.url.hook</name>
  760.   <value></value>
  761.   <description>Name of the hook to use for retriving the JDO connection URL. If empty, the value in javax.jdo.option.ConnectionURL is used </description>
  762. </property>
  763. <property>
  764.   <name>hive.metastore.ds.retry.attempts</name>
  765.   <value>1</value>
  766.   <description>The number of times to retry a metastore call if there were a connection error</description>
  767. </property>
  768. <property>
  769.    <name>hive.metastore.ds.retry.interval</name>
  770.    <value>1000</value>
  771.    <description>The number of miliseconds between metastore retry attempts</description>
  772. </property>
  773. <property>
  774.   <name>hive.metastore.server.min.threads</name>
  775.   <value>200</value>
  776.   <description>Minimum number of worker threads in the Thrift server's pool.</description>
  777. </property>
  778. <property>
  779.   <name>hive.metastore.server.max.threads</name>
  780.   <value>100000</value>
  781.   <description>Maximum number of worker threads in the Thrift server's pool.</description>
  782. </property>
  783. <property>
  784.   <name>hive.metastore.server.tcp.keepalive</name>
  785.   <value>true</value>
  786.   <description>Whether to enable TCP keepalive for the metastore server. Keepalive will prevent accumulation of half-open connections.</description>
  787. </property>
  788. <property>
  789.   <name>hive.metastore.sasl.enabled</name>
  790.   <value>false</value>
  791.   <description>If true, the metastore thrift interface will be secured with SASL. Clients must authenticate with Kerberos.</description>
  792. </property>
  793. <property>
  794.   <name>hive.metastore.thrift.framed.transport.enabled</name>
  795.   <value>false</value>
  796.   <description>If true, the metastore thrift interface will use TFramedTransport. When false (default) a standard TTransport is used.</description>
  797. </property>
  798. <property>
  799.   <name>hive.metastore.kerberos.keytab.file</name>
  800.   <value></value>
  801.   <description>The path to the Kerberos Keytab file containing the metastore thrift server's service principal.</description>
  802. </property>
  803. <property>
  804.   <name>hive.metastore.kerberos.principal</name>
  805.   <value>hive-metastore/_HOST@EXAMPLE.COM</value>
  806.   <description>The service principal for the metastore thrift server. The special string _HOST will be replaced automatically with the correct host name.</description>
  807. </property>
  808. <property>
  809.   <name>hive.cluster.delegation.token.store.class</name>
  810.   <value>org.apache.hadoop.hive.thrift.MemoryTokenStore</value>
  811.   <description>The delegation token store implementation. Set to org.apache.hadoop.hive.thrift.ZooKeeperTokenStore for load-balanced cluster.</description>
  812. </property>
  813. <property>
  814.   <name>hive.cluster.delegation.token.store.zookeeper.connectString</name>
  815.   <value>localhost:2181</value>
  816.   <description>The ZooKeeper token store connect string.</description>
  817. </property>
  818. <property>
  819.   <name>hive.cluster.delegation.token.store.zookeeper.znode</name>
  820.   <value>/hive/cluster/delegation</value>
  821.   <description>The root path for token store data.</description>
  822. </property>
  823. <property>
  824.   <name>hive.cluster.delegation.token.store.zookeeper.acl</name>
  825.   <value>sasl:hive/host1@EXAMPLE.COM:cdrwa,sasl:hive/host2@EXAMPLE.COM:cdrwa</value>
  826.   <description>ACL for token store entries. List comma separated all server principals for the cluster.</description>
  827. </property>
  828. <property>
  829.   <name>hive.metastore.cache.pinobjtypes</name>
  830.   <value>Table,StorageDescriptor,SerDeInfo,Partition,Database,Type,FieldSchema,Order</value>
  831.   <description>List of comma separated metastore object types that should be pinned in the cache</description>
  832. </property>
  833. <property>
  834.   <name>hive.optimize.reducededuplication</name>
  835.   <value>true</value>
  836.   <description>Remove extra map-reduce jobs if the data is already clustered by the same key which needs to be used again. This should always be set to true. Since it is a new feature, it has been made configurable.</description>
  837. </property>
  838. <property>
  839.   <name>hive.exec.dynamic.partition</name>
  840.   <value>true</value>
  841.   <description>Whether or not to allow dynamic partitions in DML/DDL.</description>
  842. </property>
  843. <property>
  844.   <name>hive.exec.dynamic.partition.mode</name>
  845.   <value>strict</value>
  846.   <description>In strict mode, the user must specify at least one static partition in case the user accidentally overwrites all partitions.</description>
  847. </property>
  848. <property>
  849.   <name>hive.exec.max.dynamic.partitions</name>
  850.   <value>1000</value>
  851.   <description>Maximum number of dynamic partitions allowed to be created in total.</description>
  852. </property>
  853. <property>
  854.   <name>hive.exec.max.dynamic.partitions.pernode</name>
  855.   <value>100</value>
  856.   <description>Maximum number of dynamic partitions allowed to be created in each mapper/reducer node.</description>
  857. </property>
  858. <property>
  859.   <name>hive.exec.max.created.files</name>
  860.   <value>100000</value>
  861.   <description>Maximum number of HDFS files created by all mappers/reducers in a MapReduce job.</description>
  862. </property>
  863. <property>
  864.   <name>hive.exec.default.partition.name</name>
  865.   <value>__HIVE_DEFAULT_PARTITION__</value>
  866.   <description>The default partition name in case the dynamic partition column value is null/empty string or anyother values that cannot be escaped. This value must not contain any special character used in HDFS URI (e.g., ':', '%', '/' etc). The user has to be aware that the dynamic partition value should not contain this value to avoid confusions.</description>
  867. </property>
  868. <property>
  869.   <name>hive.stats.dbclass</name>
  870.   <value>jdbc:derby</value>
  871.   <description>The default database that stores temporary hive statistics.</description>
  872. </property>
  873. <property>
  874.   <name>hive.stats.autogather</name>
  875.   <value>true</value>
  876.   <description>A flag to gather statistics automatically during the INSERT OVERWRITE command.</description>
  877. </property>
  878. <property>
  879.   <name>hive.stats.jdbcdriver</name>
  880.   <value>org.apache.derby.jdbc.EmbeddedDriver</value>
  881.   <description>The JDBC driver for the database that stores temporary hive statistics.</description>
  882. </property>
  883. <property>
  884.   <name>hive.stats.dbconnectionstring</name>
  885.   <value>jdbc:derby:;databaseName=TempStatsStore;create=true</value>
  886.   <description>The default connection string for the database that stores temporary hive statistics.</description>
  887. </property>
  888. <property>
  889.   <name>hive.stats.default.publisher</name>
  890.   <value></value>
  891.   <description>The Java class (implementing the StatsPublisher interface) that is used by default if hive.stats.dbclass is not JDBC or HBase.</description>
  892. </property>
  893. <property>
  894.   <name>hive.stats.default.aggregator</name>
  895.   <value></value>
  896.   <description>The Java class (implementing the StatsAggregator interface) that is used by default if hive.stats.dbclass is not JDBC or HBase.</description>
  897. </property>
  898. <property>
  899.   <name>hive.stats.jdbc.timeout</name>
  900.   <value>30</value>
  901.   <description>Timeout value (number of seconds) used by JDBC connection and statements.</description>
  902. </property>
  903. <property>
  904.   <name>hive.stats.retries.max</name>
  905.   <value>0</value>
  906.   <description>Maximum number of retries when stats publisher/aggregator got an exception updating intermediate database. Default is no tries on failures.</description>
  907. </property>
  908. <property>
  909.   <name>hive.stats.retries.wait</name>
  910.   <value>3000</value>
  911.   <description>The base waiting window (in milliseconds) before the next retry. The actual wait time is calculated by baseWindow * failues + baseWindow * (failure + 1) * (random number between [0.0,1.0]).</description>
  912. </property>
  913. <property>
  914.   <name>hive.stats.reliable</name>
  915.   <value>false</value>
  916.   <description>Whether queries will fail because stats cannot be collected completely accurately.
  917.     If this is set to true, reading/writing from/into a partition may fail becuase the stats
  918.     could not be computed accurately.
  919.   </description>
  920. </property>
  921. <property>
  922.   <name>hive.stats.collect.tablekeys</name>
  923.   <value>false</value>
  924.   <description>Whether join and group by keys on tables are derived and maintained in the QueryPlan.
  925.     This is useful to identify how tables are accessed and to determine if they should be bucketed.
  926.   </description>
  927. </property>
  928. <property>
  929.   <name>hive.stats.ndv.error</name>
  930.   <value>20.0</value>
  931.   <description>Standard error expressed in percentage. Provides a tradeoff between accuracy and compute cost.A lower value for error indicates higher accuracy and a higher compute cost.
  932.   </description>
  933. </property>
  934. <property>
  935.   <name>hive.support.concurrency</name>
  936.   <value>false</value>
  937.   <description>Whether hive supports concurrency or not. A zookeeper instance must be up and running for the default hive lock manager to support read-write locks.</description>
  938. </property>
  939. <property>
  940.   <name>hive.lock.numretries</name>
  941.   <value>100</value>
  942.   <description>The number of times you want to try to get all the locks</description>
  943. </property>
  944. <property>
  945.   <name>hive.unlock.numretries</name>
  946.   <value>10</value>
  947.   <description>The number of times you want to retry to do one unlock</description>
  948. </property>
  949. <property>
  950.   <name>hive.lock.sleep.between.retries</name>
  951.   <value>60</value>
  952.   <description>The sleep time (in seconds) between various retries</description>
  953. </property>
  954. <property>
  955.   <name>hive.zookeeper.quorum</name>
  956.   <value></value>
  957.   <description>The list of zookeeper servers to talk to. This is only needed for read/write locks.</description>
  958. </property>
  959. <property>
  960.   <name>hive.zookeeper.client.port</name>
  961.   <value>2181</value>
  962.   <description>The port of zookeeper servers to talk to. This is only needed for read/write locks.</description>
  963. </property>
  964. <property>
  965.   <name>hive.zookeeper.session.timeout</name>
  966.   <value>600000</value>
  967.   <description>Zookeeper client's session timeout. The client is disconnected, and as a result, all locks released, if a heartbeat is not sent in the timeout.</description>
  968. </property>
  969. <property>
  970.   <name>hive.zookeeper.namespace</name>
  971.   <value>hive_zookeeper_namespace</value>
  972.   <description>The parent node under which all zookeeper nodes are created.</description>
  973. </property>
  974. <property>
  975.   <name>hive.zookeeper.clean.extra.nodes</name>
  976.   <value>false</value>
  977.   <description>Clean extra nodes at the end of the session.</description>
  978. </property>
  979. <property>
  980.   <name>fs.har.impl</name>
  981.   <value>org.apache.hadoop.hive.shims.HiveHarFileSystem</value>
  982.   <description>The implementation for accessing Hadoop Archives. Note that this won't be applicable to Hadoop vers less than 0.20</description>
  983. </property>
  984. <property>
  985.   <name>hive.archive.enabled</name>
  986.   <value>false</value>
  987.   <description>Whether archiving operations are permitted</description>
  988. </property>
  989. <property>
  990.   <name>hive.fetch.output.serde</name>
  991.   <value>org.apache.hadoop.hive.serde2.DelimitedJSONSerDe</value>
  992.   <description>The serde used by FetchTask to serialize the fetch output.</description>
  993. </property>
  994. <property>
  995.   <name>hive.exec.mode.local.auto</name>
  996.   <value>false</value>
  997.   <description> Let hive determine whether to run in local mode automatically </description>
  998. </property>
  999. <property>
  1000.   <name>hive.exec.drop.ignorenonexistent</name>
  1001.   <value>true</value>
  1002.   <description>
  1003.     Do not report an error if DROP TABLE/VIEW specifies a non-existent table/view
  1004.   </description>
  1005. </property>
  1006. <property>
  1007.   <name>hive.exec.show.job.failure.debug.info</name>
  1008.   <value>true</value>
  1009.   <description>
  1010.       If a job fails, whether to provide a link in the CLI to the task with the
  1011.       most failures, along with debugging hints if applicable.
  1012.   </description>
  1013. </property>
  1014. <property>
  1015.   <name>hive.auto.progress.timeout</name>
  1016.   <value>0</value>
  1017.   <description>
  1018.     How long to run autoprogressor for the script/UDTF operators (in seconds).
  1019.     Set to 0 for forever.
  1020.   </description>
  1021. </property>
  1022. <!-- HBase Storage Handler Parameters -->
  1023. <property>
  1024.   <name>hive.hbase.wal.enabled</name>
  1025.   <value>true</value>
  1026.   <description>Whether writes to HBase should be forced to the write-ahead log.  Disabling this improves HBase write performance at the risk of lost writes in case of a crash.</description>
  1027. </property>
  1028. <property>
  1029.   <name>hive.table.parameters.default</name>
  1030.   <value></value>
  1031.   <description>Default property values for newly created tables</description>
  1032. </property>
  1033. <property>
  1034.   <name>hive.entity.separator</name>
  1035.   <value>@</value>
  1036.   <description>Separator used to construct names of tables and partitions. For example, dbname@tablename@partitionname</description>
  1037. </property>
  1038. <property>
  1039.   <name>hive.ddl.createtablelike.properties.whitelist</name>
  1040.   <value></value>
  1041.   <description>Table Properties to copy over when executing a Create Table Like.</description>
  1042. </property>
  1043. <property>
  1044.   <name>hive.variable.substitute</name>
  1045.   <value>true</value>
  1046.   <description>This enables substitution using syntax like ${var} ${system:var} and ${env:var}.</description>
  1047. </property>
  1048. <property>
  1049.   <name>hive.variable.substitute.depth</name>
  1050.   <value>40</value>
  1051.   <description>The maximum replacements the substitution engine will do.</description>
  1052. </property>
  1053. <property>
  1054.   <name>hive.conf.validation</name>
  1055.   <value>true</value>
  1056.   <description>Eables type checking for registered hive configurations</description>
  1057. </property>
  1058. <property>
  1059.   <name>hive.security.authorization.enabled</name>
  1060.   <value>false</value>
  1061.   <description>enable or disable the hive client authorization</description>
  1062. </property>
  1063. <property>
  1064.   <name>hive.security.authorization.manager</name>
  1065.   <value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveAuthorizationProvider</value>
  1066.   <description>the hive client authorization manager class name.
  1067.   The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveAuthorizationProvider.
  1068.   </description>
  1069. </property>
  1070. <property>
  1071.   <name>hive.security.metastore.authorization.manager</name>
  1072.   <value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveMetastoreAuthorizationProvider</value>
  1073.   <description>authorization manager class name to be used in the metastore for authorization.
  1074.   The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveMetastoreAuthorizationProvider.
  1075.   </description>
  1076. </property>
  1077. <property>
  1078.   <name>hive.security.metastore.authorization.manager</name>
  1079.   <value>org.apache.hadoop.hive.ql.security.authorization.DefaultHiveMetastoreAuthorizationProvider</value>
  1080.   <description>authorization manager class name to be used in the metastore for authorization.
  1081.   The user defined authorization class should implement interface org.apache.hadoop.hive.ql.security.authorization.HiveMetastoreAuthorizationProvider.
  1082.   </description>
  1083. </property>
  1084. <property>
  1085.   <name>hive.security.authenticator.manager</name>
  1086.   <value>org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator</value>
  1087.   <description>hive client authenticator manager class name.
  1088.   The user defined authenticator should implement interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider.</description>
  1089. </property>
  1090. <property>
  1091.   <name>hive.security.metastore.authenticator.manager</name>
  1092.   <value>org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator</value>
  1093.   <description>authenticator manager class name to be used in the metastore for authentication.
  1094.   The user defined authenticator should implement interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider.</description>
  1095. </property>
  1096. <property>
  1097.   <name>hive.security.metastore.authenticator.manager</name>
  1098.   <value>org.apache.hadoop.hive.ql.security.HadoopDefaultMetastoreAuthenticator</value>
  1099.   <description>authenticator manager class name to be used in the metastore for authentication.
  1100.   The user defined authenticator should implement interface org.apache.hadoop.hive.ql.security.HiveAuthenticationProvider.</description>
  1101. </property>
  1102. <property>
  1103.   <name>hive.security.authorization.createtable.user.grants</name>
  1104.   <value></value>
  1105.   <description>the privileges automatically granted to some users whenever a table gets created.
  1106.    An example like "userX,userY:select;userZ:create" will grant select privilege to userX and userY,
  1107.    and grant create privilege to userZ whenever a new table created.</description>
  1108. </property>
  1109. <property>
  1110.   <name>hive.security.authorization.createtable.group.grants</name>
  1111.   <value></value>
  1112.   <description>the privileges automatically granted to some groups whenever a table gets created.
  1113.    An example like "groupX,groupY:select;groupZ:create" will grant select privilege to groupX and groupY,
  1114.    and grant create privilege to groupZ whenever a new table created.</description>
  1115. </property>
  1116. <property>
  1117.   <name>hive.security.authorization.createtable.role.grants</name>
  1118.   <value></value>
  1119.   <description>the privileges automatically granted to some roles whenever a table gets created.
  1120.    An example like "roleX,roleY:select;roleZ:create" will grant select privilege to roleX and roleY,
  1121.    and grant create privilege to roleZ whenever a new table created.</description>
  1122. </property>
  1123. <property>
  1124.   <name>hive.security.authorization.createtable.owner.grants</name>
  1125.   <value></value>
  1126.   <description>the privileges automatically granted to the owner whenever a table gets created.
  1127.    An example like "select,drop" will grant select and drop privilege to the owner of the table</description>
  1128. </property>
  1129. <property>
  1130.   <name>hive.metastore.authorization.storage.checks</name>
  1131.   <value>false</value>
  1132.   <description>Should the metastore do authorization checks against the underlying storage
  1133.   for operations like drop-partition (disallow the drop-partition if the user in
  1134.   question doesn't have permissions to delete the corresponding directory
  1135.   on the storage).</description>
  1136. </property>
  1137. <property>
  1138.   <name>hive.error.on.empty.partition</name>
  1139.   <value>false</value>
  1140.   <description>Whether to throw an excpetion if dynamic partition insert generates empty results.</description>
  1141. </property>
  1142. <property>
  1143.   <name>hive.index.compact.file.ignore.hdfs</name>
  1144.   <value>false</value>
  1145.   <description>True the hdfs location stored in the index file will be igbored at runtime.
  1146.   If the data got moved or the name of the cluster got changed, the index data should still be usable.</description>
  1147. </property>
  1148. <property>
  1149.   <name>hive.optimize.index.filter.compact.minsize</name>
  1150.   <value>5368709120</value>
  1151.   <description>Minimum size (in bytes) of the inputs on which a compact index is automatically used.</description>
  1152. </property>
  1153. <property>
  1154.   <name>hive.optimize.index.filter.compact.maxsize</name>
  1155.   <value>-1</value>
  1156.   <description>Maximum size (in bytes) of the inputs on which a compact index is automatically used.
  1157.   A negative number is equivalent to infinity.</description>
  1158. </property>
  1159. <property>
  1160.   <name>hive.index.compact.query.max.size</name>
  1161.   <value>10737418240</value>
  1162.   <description>The maximum number of bytes that a query using the compact index can read. Negative value is equivalent to infinity.</description>
  1163. </property>
  1164. <property>
  1165.   <name>hive.index.compact.query.max.entries</name>
  1166.   <value>10000000</value>
  1167.   <description>The maximum number of index entries to read during a query that uses the compact index. Negative value is equivalent to infinity.</description>
  1168. </property>
  1169. <property>
  1170.   <name>hive.index.compact.binary.search</name>
  1171.   <value>true</value>
  1172.   <description>Whether or not to use a binary search to find the entries in an index table that match the filter, where possible</description>
  1173. </property>
  1174. <property>
  1175.   <name>hive.exim.uri.scheme.whitelist</name>
  1176.   <value>hdfs,pfile</value>
  1177.   <description>A comma separated list of acceptable URI schemes for import and export.</description>
  1178. </property>
  1179. <property>
  1180.   <name>hive.lock.mapred.only.operation</name>
  1181.   <value>false</value>
  1182.   <description>This param is to control whether or not only do lock on queries
  1183.   that need to execute at least one mapred job.</description>
  1184. </property>
  1185. <property>
  1186.   <name>hive.limit.row.max.size</name>
  1187.   <value>100000</value>
  1188.   <description>When trying a smaller subset of data for simple LIMIT, how much size we need to guarantee
  1189.    each row to have at least.</description>
  1190. </property>
  1191. <property>
  1192.   <name>hive.limit.optimize.limit.file</name>
  1193.   <value>10</value>
  1194.   <description>When trying a smaller subset of data for simple LIMIT, maximum number of files we can
  1195.    sample.</description>
  1196. </property>
  1197. <property>
  1198.   <name>hive.limit.optimize.enable</name>
  1199.   <value>false</value>
  1200.   <description>Whether to enable to optimization to trying a smaller subset of data for simple LIMIT first.</description>
  1201. </property>
  1202. <property>
  1203.   <name>hive.limit.optimize.fetch.max</name>
  1204.   <value>50000</value>
  1205.   <description>Maximum number of rows allowed for a smaller subset of data for simple LIMIT, if it is a fetch query.
  1206.    Insert queries are not restricted by this limit.</description>
  1207. </property>
  1208. <property>
  1209.   <name>hive.rework.mapredwork</name>
  1210.   <value>false</value>
  1211.   <description>should rework the mapred work or not.
  1212.   This is first introduced by SymlinkTextInputFormat to replace symlink files with real paths at compile time.</description>
  1213. </property>
  1214. <property>
  1215.   <name>hive.exec.concatenate.check.index</name>
  1216.   <value>true</value>
  1217.   <description>If this sets to true, hive will throw error when doing
  1218.    'alter table tbl_name [partSpec] concatenate' on a table/partition
  1219.     that has indexes on it. The reason the user want to set this to true
  1220.     is because it can help user to avoid handling all index drop, recreation,
  1221.     rebuild work. This is very helpful for tables with thousands of partitions.</description>
  1222. </property>
  1223. <property>
  1224.   <name>hive.sample.seednumber</name>
  1225.   <value>0</value>
  1226.   <description>A number used to percentage sampling. By changing this number, user will change the subsets
  1227.    of data sampled.</description>
  1228. </property>
  1229. <property>
  1230.     <name>hive.io.exception.handlers</name>
  1231.     <value></value>
  1232.     <description>A list of io exception handler class names. This is used
  1233.         to construct a list exception handlers to handle exceptions thrown
  1234.         by record readers</description>
  1235. </property>
  1236. <property>
  1237.   <name>hive.autogen.columnalias.prefix.label</name>
  1238.   <value>_c</value>
  1239.   <description>String used as a prefix when auto generating column alias.
  1240.   By default the prefix label will be appended with a column position number to form the column alias. Auto generation would happen if an aggregate function is used in a select clause without an explicit alias.</description>
  1241. </property>
  1242. <property>
  1243.   <name>hive.autogen.columnalias.prefix.includefuncname</name>
  1244.   <value>false</value>
  1245.   <description>Whether to include function name in the column alias auto generated by hive.</description>
  1246. </property>
  1247. <property>
  1248.   <name>hive.exec.perf.logger</name>
  1249.   <value>org.apache.hadoop.hive.ql.log.PerfLogger</value>
  1250.   <description>The class responsible logging client side performance metrics.  Must be a subclass of org.apache.hadoop.hive.ql.log.PerfLogger</description>
  1251. </property>
  1252. <property>
  1253.   <name>hive.start.cleanup.scratchdir</name>
  1254.   <value>false</value>
  1255.   <description>To cleanup the hive scratchdir while starting the hive server</description>
  1256. </property>
  1257. <property>
  1258.   <name>hive.output.file.extension</name>
  1259.   <value></value>
  1260.   <description>String used as a file extension for output files. If not set, defaults to the codec extension for text files (e.g. ".gz"), or no extension otherwise.</description>
  1261. </property>
  1262. <property>
  1263.   <name>hive.insert.into.multilevel.dirs</name>
  1264.   <value>false</value>
  1265.   <description>Where to insert into multilevel directories like
  1266.   "insert directory '/HIVEFT25686/chinna/' from table"</description>
  1267. </property>
  1268. <property>
  1269.   <name>hive.warehouse.subdir.inherit.perms</name>
  1270.   <value>false</value>
  1271.   <description>Set this to true if the the table directories should inherit the
  1272.     permission of the warehouse or database directory instead of being created
  1273.     with the permissions derived from dfs umask</description>
  1274. </property>
  1275. <property>
  1276.   <name>hive.exec.job.debug.capture.stacktraces</name>
  1277.   <value>true</value>
  1278.   <description>Whether or not stack traces parsed from the task logs of a sampled failed task for
  1279.                  each failed job should be stored in the SessionState
  1280.   </description>
  1281. </property>
  1282. <property>
  1283.   <name>hive.exec.driver.run.hooks</name>
  1284.   <value></value>
  1285.   <description>A comma separated list of hooks which implement HiveDriverRunHook and will be run at the
  1286.                  beginning and end of Driver.run, these will be run in the order specified
  1287.   </description>
  1288. </property>
  1289. <property>
  1290.   <name>hive.ddl.output.format</name>
  1291.   <value>text</value>
  1292.   <description>
  1293.     The data format to use for DDL output.  One of "text" (for human
  1294.     readable text) or "json" (for a json object).
  1295.   </description>
  1296. </property>
  1297. <property>
  1298.   <name>hive.transform.escape.input</name>
  1299.   <value>false</value>
  1300.   <description>
  1301.     This adds an option to escape special chars (newlines, carriage returns and
  1302.     tabs) when they are passed to the user script. This is useful if the hive tables
  1303.     can contain data that contains special characters.
  1304.   </description>
  1305. </property>
  1306. <property>
  1307.   <name>hive.exec.rcfile.use.explicit.header</name>
  1308.   <value>true</value>
  1309.   <description>
  1310.     If this is set the header for RC Files will simply be RCF.  If this is not
  1311.     set the header will be that borrowed from sequence files, e.g. SEQ- followed
  1312.     by the input and output RC File formats.
  1313.   </description>
  1314. </property>
  1315. <property>
  1316.   <name>hive.multi.insert.move.tasks.share.dependencies</name>
  1317.   <value>false</value>
  1318.   <description>
  1319.     If this is set all move tasks for tables/partitions (not directories) at the end of a
  1320.     multi-insert query will only begin once the dependencies for all these move tasks have been
  1321.     met.
  1322.     Advantages: If concurrency is enabled, the locks will only be released once the query has
  1323.                 finished, so with this config enabled, the time when the table/partition is
  1324.                 generated will be much closer to when the lock on it is released.
  1325.     Disadvantages: If concurrency is not enabled, with this disabled, the tables/partitions which
  1326.                    are produced by this query and finish earlier will be available for querying
  1327.                    much earlier.  Since the locks are only released once the query finishes, this
  1328.                    does not apply if concurrency is enabled.
  1329.   </description>
  1330. </property>
  1331. <property>
  1332.   <name>hive.fetch.task.conversion</name>
  1333.   <value>minimal</value>
  1334.   <description>
  1335.     Some select queries can be converted to single FETCH task minimizing latency.
  1336.     Currently the query should be single sourced not having any subquery and should not have
  1337.     any aggregations or distincts (which incurrs RS), lateral views and joins.
  1338.     1. minimal : SELECT STAR, FILTER on partition columns, LIMIT only
  1339.     2. more    : SELECT, FILTER, LIMIT only (+TABLESAMPLE, virtual columns)
  1340.   </description>
  1341. </property>
  1342. <property>
  1343.   <name>hive.hmshandler.retry.attempts</name>
  1344.   <value>1</value>
  1345.   <description>The number of times to retry a HMSHandler call if there were a connection error</description>
  1346. </property>
  1347. <property>
  1348.    <name>hive.hmshandler.retry.interval</name>
  1349.    <value>1000</value>
  1350.    <description>The number of miliseconds between HMSHandler retry attempts</description>
  1351. </property>
  1352. <property>
  1353.    <name>hive.server.read.socket.timeout</name>
  1354.    <value>10</value>
  1355.    <description>Timeout for the HiveServer to close the connection if no response from the client in N seconds, defaults to 10 seconds.</description>
  1356. </property>
  1357. <property>
  1358.    <name>hive.server.tcp.keepalive</name>
  1359.    <value>true</value>
  1360.    <description>Whether to enable TCP keepalive for the Hive server. Keepalive will prevent accumulation of half-open connections.</description>
  1361. </property>
  1362. <!--zhangziliang-->
  1363. <property>
  1364.     <name>hive.aux.jars.path</name>  
  1365.     <value>file:///home/hadoop/source/hive/lib/hive-hbase-handler-0.10.0.jar,file:///home/hadoop/source/hive/lib/hbase-0.94.0.jar,file:///home/hadoop/source/hive/lib/zookeeper-3.4.3.jar</value>
  1366. </property>
  1367. </configuration>
复制代码
3.3 新增配置属性-hive.aux.jars.path
  1. <property>
  2.      <name>hive.aux.jars.path</name>  
  3.       <value>file:///home/hadoop/source/hive/lib/hive-hbase-handler-0.10.0.jar,file:///home/hadoop/source/hive/lib/hbase-0.94.0.jar,file:///home/hadoop/source/hive/lib/zookeeper-3.4.3.jar</value>
  4.   </property>
复制代码
3.4 拷贝Jar包到Hive/lib目录  hbase-0.94.0.jar,zookeeper-3.4.3.jar

四、测试脚本-创建HBase能够识别的数据表
  1. CREATE TABLE hbase_table_1(key int, value string)
  2.   STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'  
  3.   WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")  
  4.   TBLPROPERTIES ("hbase.table.name" = "xyz");  
复制代码
五、异常解决  5.1 错误提示
  1. java.lang.NoClassDefFoundError: com/google/protobuf/Message
  2. at org.apache.hadoop.hbase.io.HbaseObjectWritable.(HbaseObjectWritable.java
复制代码
5.2 解决方案    将$HBASE_HOME/lib/protobuf-java-2.4.0a.jar 拷贝到 $HIVE_HOME/lib/.

六、运行效果  
  1. [hadoop@hadoop1 lib]$ hive -hiveconf hbase.zookeeper.quorum=hadoop1
  2. WARNING: org.apache.hadoop.metrics.jvm.EventCounter is deprecated. Please use org.apache.hadoop.log.metrics.EventCounter in all the log4j.properties files.
  3. Logging initialized using configuration in jar:file:/home/hadoop/source/hive/lib/hive-common-0.10.0.jar!/hive-log4j.properties
  4. Hive history file=/tmp/hadoop/hive_job_log_hadoop_201401012315_758621762.txt
  5. hive> CREATE TABLE hbase_table_1(key int, value string)   
  6.     > STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'  
  7.     > WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,cf1:val")  
  8.     > TBLPROPERTIES ("hbase.table.name" = "xyz");
  9. OK
  10. Time taken: 23.246 seconds
  11. hive> show tables;
  12. OK
  13. hbase_table_1
  14. Time taken: 1.346 seconds
复制代码




本帖被以下淘专辑推荐:

已有(9)人评论

跳转到指定楼层
lidahe 发表于 2014-1-14 11:04:29
谢谢共享 太感谢了
回复

使用道具 举报

lidahe 发表于 2014-1-14 11:04:58
谢谢共享 太感谢了
回复

使用道具 举报

break-spark 发表于 2014-10-30 16:02:27
在实际公司应用中Hbase和hive一般整合用吗?个人感觉一般不在一块用
回复

使用道具 举报

mingge12321 发表于 2014-11-13 07:03:00
谢谢共享 太感谢了
回复

使用道具 举报

jxlhljh 发表于 2014-12-10 16:14:31
非常感谢,帮了我大忙了
回复

使用道具 举报

EASONLIU 发表于 2014-12-17 10:11:26
路过,学习学习
回复

使用道具 举报

chuyuan_zhou 发表于 2014-12-23 17:55:29
飘过,学习学习!
回复

使用道具 举报

小飞鱼123 发表于 2015-11-1 21:59:52

飘过,学习学习!
回复

使用道具 举报

孤独的战神 发表于 2015-12-10 16:09:51
楼主,hive和hbase整合之后能用过hive对hbase表进行读写吗
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条