Home > Database > SQL > body text

What is the difference between Hive-sql and sql?

青灯夜游
Release: 2020-11-13 11:20:23
Original
20594 people have browsed it

Difference: 1. Hive-sql does not support equijoin, but sql does; 2. Hive-sql does not support "Insert into table Values()", UPDATA, and DELETE operations, but sql does; 3. Hive-sql does not support transactions, while sql does.

What is the difference between Hive-sql and sql?

Generally speaking, hiveSQL is basically the same as SQL. The original design purpose is to allow people who know SQL but cannot program MapReduce to use Hadoop for data processing. deal with.

1. Hive does not support equijoin

Does not support equijoin. Generally, left join, right join or inner join are used instead.

For example:

The inner association in SQL can be written like this: select * from a, b where a.key = b.key

In Hive it should be written like this: select * from a join b on a.key = b.key

The method of omitting join cannot be used in hive.

2. Semicolon character

The semicolon is the end symbol of the SQL statement, and it is also the symbol in hive. However, hive is not so intelligent in recognizing semicolons. Sometimes it is necessary to Escape ";" --> "\073"

3, NULL

null in sql represents a null value, but in Hive, String type If the field is an empty string, that is, the length is 0, then the is null judgment result is False

4. Hive does not support inserting data into existing tables or partitions

Hive only supports overwriting and rewriting the entire table.

insert overwrite 表 (重写覆盖)
Copy after login

5. Hive does not support Insert into table Values(), UPDATA, DELETE operations

insert into is to append data to the table or partition.

6. Hive supports embedding mapreduce programs to handle complex logic

There are currently no examples to provide.

7. Hive supports writing converted data directly to different tables, and can also write to partitions, hdfs and local directories

Avoid multiple scans of the input table s expenses.

8. HQL does not support row-level addition, modification, or deletion. All data is determined when loading and cannot be changed.

For more programming-related knowledge, please visit: Introduction to Programming! !

The above is the detailed content of What is the difference between Hive-sql and sql?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
sql
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!