行业知识
Hive:数据仓库利器
2026-12-03 09:56:43
来源:互联网转载
1. 简介
Hive���一个基于Hadoop的开源数据仓库工具,可以用来存储、查询和分析大规模数据。Hive使用SQL-like的HiveQL语言来查询数据,并将其结果存储在Hadoop的文件系统中。
2. 基本概念
介绍 Hive 的核心概念,例如表、分区、桶、HQL 等。
2.1 架构
Design - Apache Hive - Apache Software Foundation| 组成 | 详情 |
| UI | The user interface for users to submit queries and other operations to the system. As of 2011 the system had a command line interface and a web based GUI was being developed. |
| Driver | The component which receives the queries. This component implements the notion of session handles and provides execute and fetch APIs modeled on JDBC/ODBC interfaces. |
| Compiler | The component that parses the query, does semantic analysis on the different query blocks and query expressions and eventually generates an execution plan with the help of the table and partition metadata looked up from the metastore. |
| Metastore | The component that stores all the structure information of the various tables and partitions in the warehouse including column and column type information, the serializers and deserializers necessary to read and write data and the corresponding HDFS files where the data is stored. |
| Execution Engine | The component which executes the execution plan created by the compiler. The plan is a DAG of stages. The execution engine manages the dependencies between these different stages of the plan and executes these stages on the appropriate system components. |
2.2 Data Model
| 类型 | 详情 | ||||||||
| Tables | These are analogous to Tables in Relational Databases. Tables can be filtered, projected, joined and unioned. Additionally all the data of a table is stored in a directory in HDFS. Hive also supports the notion of external tables wherein a table can be created on prexisting files or directories in HDFS by providing the appropriate location to the table creation DDL. The rows in a table are organized into typed columns similar to Relational Databases. | ||||||||
| Partitions | Each Table can have one or more partition keys which determine how the data is stored, for example a table T with a date partition column ds had files with data for a particular date stored in the
3. 实践应用3.1 数仓建设4. 性能优化介绍如何优化 Hive 的性能 5. 常见问题解答5.1 常用SQL
6. 总结总结 Hive 的关键知识点,并提供学习资源和进一步研究方向。 |
上一篇:电脑插画手绘教程头发