Big data: operation syntax of hive database, data table, internal table, external external table, data import and export load, insert

Big Data:

2022找工作是学历、能力和运气的超强结合体,遇到寒冬,大厂不招人,可能很多算法学生都得去找开发,测开
测开的话,你就得学数据库,sql,oracle,尤其sql要学,当然,像很多金融企业、安全机构啥的,他们必须要用oracle数据库
这oracle比sql安全,强大多了,所以你需要学习,最重要的,你要是考网络警察公务员,这玩意你不会就别去报名了,耽误时间!
与此同时,既然要考网警之数据分析应用岗,那必然要考数据挖掘基础知识,今天开始咱们就对数据挖掘方面的东西好生讲讲 最最最重要的就是大数据,什么行测和面试都是小问题,最难最最重要的就是大数据技术相关的知识笔试


Big data: hive data operation

insert image description here
insert image description here
insert image description here
insert image description here

create database if not exists myhive;

use myhive;sql类似的

show database;

desc database myhive;

insert image description here
insert image description here

create database myhive2 location '/myhive2';
自定义文件夹,放自己的地方

Delete is also drop

drop database myhive;
cascade;强制删除相关的表
create table test(id int);
建表之后就不能随便删除了

insert image description here

Hive data table operation

insert image description here
insert image description here
Similar to sql
insert image description here
insert image description here
insert image description here
insert image description here

create table test(id int, name string, gender string);sql一样

insert image description here
insert image description here

drop table 表名;

easy

internal table operations

insert image description here
insert image description here
insert image description here
insert image description here
Metadata and its own data, the internal table, directly kill
the external table value to delete the metadata, and delete the data itself before sending

insert image description here
insert image description here
If there is no external, it is an internal table, and
the keyword modification is external

insert image description here
insert image description here
insert image description here
terminated by,,, split
delimited fields delimited column fields
insert image description here

external table

insert image description here
insert image description here
insert image description here
Tables and data are separate
links

insert image description here
The \t delimiter is best designed to be
flattering

insert image description here
There is an external table, but the data is useless,
we can upload the data into it

insert image description here
Existing table with data

Tables and data are independent and not related.

insert image description here
First create the data
and then build the table, it links to
insert image description here
insert image description here
hive and will actively link and associate tables and data

Anyway, that is to say, the external table and data are independent

Deleting a table does not affect the data itself, it just removes the association.

insert image description here
insert image description here
insert image description here

alter table 表名字 set tblproperties('EXTERNAL'='TRUE/FALSE');

true就是外部
false就是内部

No lowercase,
only uppercase

insert image description here

hive data loading and exporting

insert image description here
insert image description here
insert image description here
insert image description here
local is Linux local
insert image description here
insert image description hereinsert image description here
insert image description here
insert image description here
insert image description here
insert image description here
coverage data
insert image description here
Check data from Table 2 and insert into Table 1

insert image description here
Ordinary insert
can be overwritten
, so to speak,
insert image description here
from file to table,
from table to table,
two ways of data loading

insert image description here
insert image description here
It’s just that the direction of importing data is opposite
insert image description here
insert image description here
to that of exporting to different places, and the words are different.

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here


Summarize

提示:重要经验:

1)
2) Learn oracle well, even if the economy is cold, the whole test offer is definitely not a problem! At the same time, it is also the only way for you to test the public Internet police.
3) When seeking AC in the written test, space complexity may not be considered, but the interview must consider both the optimal time complexity and the optimal space complexity.

Guess you like

Origin blog.csdn.net/weixin_46838716/article/details/131012628
Recommended