Hive常用shell命令

2021-09-01 02:17:14 字數 878 閱讀 8938

(1)建立資料庫:create database zy_test;

(2)顯示所有資料庫:show databases;

(3)使用某資料庫:use sgs_test;

(4)顯示所有表:show tables;

(5)建立表:create table zy_test(name string);

(6)描述表:desc sgs_test.zy_test;

(7)本地匯入hive:load data local inpath '/home/sgs_test/test.txt' overwrite into table sgs_test.zy_test;

(8)查詢表:select * from sgs_test.zy_test;

(9)hive匯出到本地:insert overwrite local directory '/home/sgs_test/' select * from sgs_test.zy_test;

(10)刪除表:drop table zy_test;

(11)create table zy_test(name string);

(12)hdfs匯入hive:load data inpath '/tmp/test.txt' overwrite into table sgs_test.zy_test;

(13)hive匯出至hdfs:insert overwrite directory '/tmp/zy/' select * from sgs_test.zy_test;

(14)建立外部表:create external table sgs_test.zy_test_ext(name string) row format delimited fields terminated by ',' stored as orc;

Hive常用操作命令

建立資料庫 create database db name create database if not exists db name 建立乙個不存在的資料庫final 檢視資料庫 show databases 選擇性檢視資料庫 show databases like f.檢視某乙個資料庫的詳細資訊...

Hive常用修改命令

alter table 語句 hive修改表名,列名,列注釋,表注釋,增加列,調整列順序,屬性名等操作 它是在hive中用來修改的表。語法 宣告接受任意屬性,我們希望在乙個表中修改以下語法。alter table name rename to new name alter table name ad...

常用shell命令

1 cat 列印檔案的內容 2 cd 改變目錄 3 chmod 修改檔案訪問許可權 4 cp 複製檔案 5 du 輸出磁碟的使用情況 6 emacs 文字編輯器 7 find 搜尋查詢檔案 8 gcc c c fortran 編譯器 9 grep 在輸入中查詢乙個串 10 less 輸出頁面過濾器 ...