1.结构化查询语言(SQL):
SQL 是一种用于编程的领域特定语言,旨在管理关系数据库管理系统(也称为 RDBMS)中保存的数据。它也可用于处理结构化数据,即包含实体和变量之间关系的数据。 SQL 是一种用于在数据库中存储、操作和检索数据的标准语言。
2. Hive查询语言(HiveQL):
HiveQL 是Hive 的一种查询语言,用于分析和处理 Meta-store 中的结构化数据。它与 SQL 非常相似,并且具有高度的可扩展性。它重用了关系数据库世界中熟悉的概念,例如表、行、列和模式,以简化学习。 Hive支持四种文件格式,即 TEXT FILE、SEQUENCE FILE、ORC 和 RC FILE(Record Columnar File)。
SQL 和 HiveQL 的区别:
On the basis of | SQL | HiveQL |
---|---|---|
Update-commands in table structure | UPDATE, DELETEINSERT, | UPDATE, DELETEINSERT, |
Manages | Relational data | Data Structures |
Transaction | Supported | Limited Support Supported |
Indexes | Supported | Supported |
Data Types | It contain a total of five data types i.e., Integral, floating-point, fixed-point, text and binary strings, temporal | It contains a total of 9 data types i.e., Boolean, integral, floating-point, fixed-point, text and binary strings, temporal, array, map, struct. |
Functions | Hundreds of built-in functions | Hundreds of built-in functions |
Mapreduce | Not Supported | Supported |
Multitable inserts in table | Not supported | Supported |
Create tabl…as Select | Not supported | Supported |
Select command | Supported | Supported with SORT BY clause for partial ordering and LIMIT to restrict number of rows returned |
Joins | Supported | Inner joins, outer joins, semi join, map joins, cross joins |
Subqueries | Supported | Only Used in FROM, WHERE, or HAVING clauses |
Views | Can be Updated | Read-only i.e. cannot be updated |