1.结构化查询语言(SQL):
SQL是一种用于编程的领域特定语言,旨在管理关系数据库管理系统(也称为RDBMS)中保存的数据。它在处理结构化数据(即合并了实体和变量之间的关系的数据)中也很有用。 SQL是用于在数据库中存储,处理和检索数据的标准语言。
2. Hive查询语言(HiveQL):
HiveQL是Hive的查询语言,用于分析和处理元存储中的结构化数据。它与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 |