hive經常使用命令

2021-09-07 10:54:04 字數 868 閱讀 6651

show tables;

列出hive裡面全部資料表名

desc userprofile;

顯示資料表userprofile的基本表字段及字段type

desc extended trackinfo;

顯示資料表trackinfo的具體資訊,包含字段說明,資料表等

/usr/local/cloud/hive/bin/hive

進入hive資料庫

select attribute_name from pms_attribute where attribute_id=21000 and attribute_value_id=105991;

hive的select操作

select user_id, category_id, catgory_pref, attribute_id, attribute_pref, attribute_value_id, attribute_value_pref from userprofile limit 10;

hive的select操作,僅僅顯示10行

/usr/local/cloud/hive/bin/hive -e "select category_id, attribute_id, count(user_id) from userprofile group by category_id, attribute_id" >> /home/deploy/recsys/workspace/ouyangyewei/statistics_data/number_attention_of_attribute_for_mobilephone.csv;

將sql查詢的資料匯出到csv檔案裡

hivefile sql檔名稱

執行sql檔案(該命令在bash命令列上執行)

Linux經常使用命令

命令 選項 引數 定位 cd 回到父級資料夾 cd 回到上一次所在資料夾 cd 回到家資料夾 顯示當前檔案所處完整路徑 pwd 清屏 ctrl l 展示 ls 展示檔案列表 展示具體資訊 ll h 檔案以kb顯示 a 顯示所有檔案 d 顯示當前目錄非目錄下內容 eg ll h data www 資料...

Redis經常使用命令

1 建立 是否儲存 檢視 刪除 set name maojun exists name get name del name 2 序列化記錄 set name maojun exists name dump name 退出client在進入,exists name,name依舊存在。3 給key設定生...

linux經常使用命令

死記硬背命令沒有任何意義,無論linux sql還是git等,這些萬年不變的命令沒必要花時間花精力刻意去記,用的多了自然就記住了,根本無需去刻意記,小時候背課文 英文單詞 工作了背命令?腦子不是用來幹這些體力活的。程式設計的真諦是思想,程式設計思想 解決問題思維,而不是刻板冰冷的命令,就有那麼一些以...