# hive **Repository Path**: wulei633/hive ## Basic Information - **Project Name**: hive - **Description**: The Apache Hive (TM) data warehouse software facilitates reading, writing, and managing large datasets residing in distributed storage using SQL. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 19 - **Created**: 2022-02-16 - **Last Updated**: 2022-02-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # hive #### 介绍 The Apache Hive (TM) data warehouse software facilitates reading, writing, and managing large datasets residing in distributed storage using SQL. Built on top of Apache Hadoop (TM), it provides: - Tools to enable easy access to data via SQL, thus enabling data warehousing tasks such as extract/transform/load (ETL), reporting, and data analysis - A mechanism to impose structure on a variety of data formats - Access to files stored either directly in Apache HDFS (TM) or in other data storage systems such as Apache HBase (TM) - Query execution using Apache Hadoop MapReduce, Apache Tez or Apache Spark frameworks. Hive provides standard SQL functionality, including many of the later 2003 and 2011 features for analytics. These include OLAP functions, subqueries, common table expressions, and more. Hive's SQL can also be extended with user code via user defined functions (UDFs), user defined aggregates (UDAFs), and user defined table functions (UDTFs). Hive users have a choice of 3 runtimes when executing SQL queries. Users can choose between Apache Hadoop MapReduce, Apache Tez or Apache Spark frameworks as their execution backend. MapReduce is a mature framework that is proven at large scales. However, MapReduce is a purely batch framework, and queries using it may experience higher latencies (tens of seconds), even over small datasets. Apache Tez is designed for interactive query, and has substantially reduced overheads versus MapReduce. Apache Spark is a cluster computing framework that's built outside of MapReduce, but on top of HDFS, with a notion of composable and transformable distributed collection of items called Resilient Distributed Dataset (RDD) which allows processing and analysis without traditional intermediate stages that MapReduce introduces. Users are free to switch back and forth between these frameworks at any time. In each case, Hive is best suited for use cases where the amount of data processed is large enough to require a distributed system. Hive is not designed for online transaction processing. It is best used for traditional data warehousing tasks. Hive is designed to maximize scalability (scale out with more machines added dynamically to the Hadoop cluster), performance, extensibility, fault-tolerance, and loose-coupling with its input formats. #### 软件架构 Hive主要包含的组件有Driver,Metadata库,用户接口(CLI接口,JDBC/ODBC接口)和Thrift Server接口等。 - Driver组件:Hive的核心,Hive被称为解析器的根本所在,包含编译器(Complier),优化器(Optimizer)和执行器(Executor),主要负责对Hive SQL语句进行解析,编译优化,生成相应的执行计划,然后交给底层的mapreduce框架完成计算输出结果。 - Metadata:存储Hive的元数据,即描述数据的数据,就是Hive有哪些表,表内有什么字段,在什么DB,对应什么文件等等,默认的元数据库是Derby库,只能允许一个会话连接,即单用户模式,基本不实用,为了支持多用户,基本需要将元数据库改配成MySQL或者Oracle等数据库中。 - 用户接口:包含CLI(Command Line Interface 命令行接口)、JDBC/ODBC接口和Web UI接口。实现客户端与服务端的交互。 - Thrift Server和JDBC/ODBC:可扩展可跨语言服务接口,Thrift Server提供了JDBC和ODBC连接,实现不同语言调用Hive的接口。 #### 安装教程 Requirements - Java1.8 - Hadoop3.x 1. 首先下载对应的版本,解压安装; - tar -xzvf hive-x.y.z.tar.gz 2. 配置环境变量; - cd hive-x.y.z - export HIVE_HOME={{pwd}} 3. 最后,配置PATH; - export PATH=\\$HIVE_HOME/bin:\\$PATH #### 使用说明 1. xxxx 2. xxxx 3. xxxx #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request #### 码云特技 1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md 2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com) 3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目 4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目 5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) 6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)