Hive學習筆記 1

2021-08-20 08:09:01 字數 1859 閱讀 8116

資料型別和檔案格式

筆記內容主要來自hive程式設計指南

hive服務

hive命名空間

hive中」一次使用命令」

hive -e

"select * from mytable limit 3";

hive -s -e

"select * from mytable limit 3";#靜默模式

從檔案中執行hive查詢

hive -f /mypath/test.hql;
hiverc檔案

hive -i ...

#i選項允許使用者指定乙個檔案,當cli啟動時,提提示符出現前會先執行這個檔案。hive會自動在home目錄下尋找名為.hiverc的檔案。(如果有這個檔案的話)

hive cli更多介紹

- 自動補全功能

- 檢視操作命令歷史(存放位置:$home/.hivehistory)

- 執行shell命令!命令前加 感嘆號

- hive內使用hadoop的dfs命令

- hive 指令碼中注釋用- -

- 顯示欄位名稱 hive.cli.print.header=true

預設的記錄和字段分隔符

指定分隔符:

create

table employees(

name string,

salary float,

subordinates array,

deductions mapfloat>,

address structint>

)row format delimited

fileds terminated by

'\001'

collection items terminated by

'\002',

map keys terminated by

'\003',

lines terminated by

'\n'

stored as textfile;

自定義分割 簡單示例(逗號分割字段):

create

table some_data(

first

float,

second

float,

third float

)row format delimited

fields terminated by

',';

hive學習筆記1

hive學習筆記 1.簡單的 wordcount select word,count 1 from select explode split sentence,as word from t2 tgroup by word 對t2表中的sentence列進行空格分隔,統計單詞出現的數量 select ...

Hive學習筆記 Hive 引數

第一部分 hive 引數 hive.exec.max.created.files 說明 所有hive執行的map與reduce任務可以產生的檔案的和 預設值 100000 hive.exec.dynamic.partition 說明 是否為自動分割槽 預設值 false hive.mapred.re...

Hive學習筆記 Hive概述

1.1 資料倉儲 可以利用資料倉儲來儲存我們的資料,但是資料倉儲有別於我們常見的一般資料庫。資料倉儲是乙個面向主題的 整合的 不可更新的 隨時間不變化的資料整合,它用於支援企業或組織的決策分析處理。物件導向的 倉庫中的資料是按照一定的主題進行組織的。主題即使用者使用資料倉儲進行決策時所關心的重點方面...