美文网首页
Hive常用的属性配置

Hive常用的属性配置

作者: 明明德撩码 | 来源:发表于2018-03-19 23:53 被阅读12次

    Hive数据仓库位置配置

    • 默认位置/user/hive/warehouse
      若多数据仓库位置进行修改,则修改配置hive-site.xml 文件,添加一些属性。
      <property>
      <name>hive.metastore.warehouse.dir</name>
      <value>/user/hive/warehouse</value>
      <description>location of default database for the warehouse</description>
      </property>

    • 事项1
      在仓库目录下,没有对默认的default数据库创建文件夹
      如果某张表属于default数据库,直接在数据仓库目录下创建一个文件夹

    • 事项2(db_hive)
      hive下的数据库在hdfs中只是一个文件夹
      文件夹下面放的是数据块,并且每个块大小默认是128M,不管文件有多小都是128M


      block

    hive日志信息配置

    • 修改hive-log4j.properties文件


    在hive的客户端命令行上显示,当前库及表结构

    • 库信息
      <property>
      <name>hive.cli.print.current.db</name>
      <value>true</value>
      <description>Whether to include the current database in the Hive prompt.</description>
      </property>
    • 表结构信息
      <property>
      <name>hive.cli.print.header</name>
      <value>true</value>
      <description>Whether to print the names of the columns in query output.</description>
      </property>


    在启动hive时设置配置属性信息

    $ bin/hive --hiveconf <property=value>
    例如开始日志打印到控制台
    bin/hive --hiveconf hive.root.logger=INFO,cosole


    image.png

    查看当前所有的配置信息

    • 查看所有的配置信息
      hive > set ;
    • 查看某个配置项信息value
      hive (db_hive)> set system:user.name ;
      system:user.name=root
    • 设置某项配置值
      hive (db_hive)> set system:user.name=lizh;
      此种方式,设置属性的值,仅仅在当前会话session生效

    相关文章

      网友评论

          本文标题:Hive常用的属性配置

          本文链接:https://www.haomeiwen.com/subject/jmxxfftx.html