hadoop大數(shù)據(jù)二期11.28課程內(nèi)容-課件0302hive深入使用一_第1頁
hadoop大數(shù)據(jù)二期11.28課程內(nèi)容-課件0302hive深入使用一_第2頁
hadoop大數(shù)據(jù)二期11.28課程內(nèi)容-課件0302hive深入使用一_第3頁
hadoop大數(shù)據(jù)二期11.28課程內(nèi)容-課件0302hive深入使用一_第4頁
hadoop大數(shù)據(jù)二期11.28課程內(nèi)容-課件0302hive深入使用一_第5頁
免費預(yù)覽已結(jié)束,剩余38頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

課程大綱4Hive

表的創(chuàng)建1235Hive

數(shù)據(jù)類型Hive

數(shù)據(jù)遷移Hive

常見查詢HiveUDF編程課程大綱4Hive

表的創(chuàng)建1235Hive

數(shù)據(jù)類型Hive

數(shù)據(jù)遷移Hive

常見查詢HiveUDF編程DataBaseCreate/Drop/Alter

DatabaseCreate/Drop/Alter

DatabaseShow

DatabaseDescribe

DatabaseTableCreate/Drop/Truncate

TableManualDDL-Create/Drop/TruncateTableCreate/Drop/Truncate

TableCreate/Drop/Truncate

TableCreate

Tablecreate

table

emp(empno

int,

ename

string,job

string,mgr

int,hiredate

string,sal

double,comm

double,deptno

int)row

format

delimited

fields

terminated

by

'\t';員工表:create

table

dept(deptno

int,

dname

string,loc

string)row

format

delimited

fields

terminated

by

'\t';部門表:Load

DataLOAD

DATA

[LOCAL]

INPATH

'filepath'[OVERWRITE]

INTO

TABLE

tablename

[PARTITION(partcol1=val1,

partcol2=val2

...)]LOCAL:從本地文件加載數(shù)據(jù)到hive表;否則從HDFS加載數(shù)據(jù)到hive表;OVERWRITE:是否覆蓋表中已有數(shù)據(jù);load

data

local

inpath

'/home/hadoop/data/emp.txt'

overwrite

into

table

emp;load

data

local

inpath

'/home/hadoop/data/dept.txt'

overwrite

into

table

dept;Create

Table

As

Select

()Create

Table

LikeCreate/Drop/Truncate

TableCreate/Drop/Truncate

TableExternal

Tables表也稱之為MANAGED_TABLE;默認

在/user/hive/warehouse下,也可以通過location指定;刪除表時,會刪除表數(shù)據(jù)以及元數(shù)據(jù);外部表稱之為EXTERNAL_TABLE;在創(chuàng)建表時可以自己指定

位置(LOCATION);刪除表時,只會刪除元數(shù)據(jù)不會刪除表數(shù)據(jù);External

TablesPartitioned

Tables分區(qū)表實際上就是對應(yīng)一個HDFS文件系統(tǒng)上的獨立的文件夾,該文件夾下是該分區(qū)所有的數(shù)據(jù)文件。Hive中的分區(qū)就是分,把一個大的數(shù)據(jù)集根據(jù)業(yè)務(wù)需要分割更小成的數(shù)據(jù)集。在查詢時通過WHERE子句中的表達式來選擇查詢所需要的指定的分區(qū),這樣的查詢效率會提高很多。create

table

dept_partition(deptno

int,dname

string,loc

string)PARTITIONED

BY

(event_month

string)ROW

FORMAT

DELIMITED

FIELDS

TERMINATED

BY

'\t';Partitioned

TablesPartitioned

TablesPartitioned

TablesPartitioned

Tables作業(yè)十三、Hive表的創(chuàng)建與使用作業(yè)十三、Hive表的創(chuàng)建與使用課程大綱4Hive

表的創(chuàng)建1235Hive

數(shù)據(jù)類型Hive

數(shù)據(jù)遷移Hive

常見查詢HiveUDF編程Hive

Data

TypesHive

Data

TypesPrimitive

Types課程大綱4Hive

表的創(chuàng)建1235Hive

數(shù)據(jù)類型Hive

數(shù)據(jù)遷移Hive

常見查詢HiveUDF編程Hive

Data

ManipulationLoading

files

into

tablesLOAD

DATA

[LOCAL]

INPATH

'filepath'[OVERWRITE]

INTO

TABLE

tablename[PARTITION

(partcol1=val1,

partcol2=val2

...)]Loading

files

into

tablesLoading

files

into

tablesLoading

files

into

tablesHive

Data

ManipulationHive

Data

Manipulation課程大綱4Hive

表的創(chuàng)建1235Hive

數(shù)據(jù)類型Hive

數(shù)據(jù)遷移Hive

常見查詢HiveUDF編程QueriesQueriesSELECT[ALL

|

DISTINCT]

select_expr,

select_expr,

...FROM

table_reference[WHERE

where_condition]

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論