1. 程式人生 > >【Hive】 cli 的基本用法

【Hive】 cli 的基本用法

Hive can manage the addition of resources to a session where those resources need to be made available at query execution time. Any locally accessible file can be added to the session. Once a file is added to a session, hive query can refer to this file by its name (in map/reduce/transform clauses) and this file is available locally at execution time on the entire hadoop cluster. Hive uses Hadoop's Distributed Cache to distribute the added files to all the machines in the cluster at query execution time.

ADD { FILE[S] | JAR[S] | ARCHIVE[S] } <filepath1> [<filepath2>]* LIST { FILE[S] | JAR[S] | ARCHIVE[S] } [<filepath1> <filepath2> ..] DELETE { FILE[S] | JAR[S] | ARCHIVE[S] } [<filepath1> <filepath2> ..]
  • FILE resources are just added to the distributed cache. Typically, this might be something like a transform script to be executed.
  • JAR resources are also added to the Java classpath. This is required in order to reference objects they contain such as UDF's.
  • ARCHIVE resources are automatically unarchived as part of distributing them.

Example

hive> add FILE /tmp/tt.py;hive> list FILES;/tmp/tt.pyhive> from networks a MAP a.networkid USING 'python tt.py' as nn where a.ds = '2009-01-04' limit 10;

It is not neccessary to add files to the session if the files used in a transform script are already available on all machines in the hadoop cluster using the same path name. For example:

  • ... MAP a.networkid USING 'wc -l' ...: here wc is an executable available on all machines
  • ... MAP a.networkid USING '/home/nfsserv1/hadoopscripts/tt.py' ...: here tt.py may be accessible via a nfs mount point that's configured identically on all the cluster nodes.

相關推薦

Hive cli基本用法

Hive can manage the addition of resources to a session where those resources need to be made available at query execution time. Any locally accessible fil

AngularJSpanel基本用法——最基本的panel

最近在學AngularJS,用部落格做筆記,之後會慢慢進階;現最基本的一個panel如下; 1·原始碼: <!DOCTYPE html> <html> <head>

hihocodersam1-基本概念

upd printf std getch coder get log mem 基本 這題有毒…… 原本只是想復習下sam,於是寫…… 後來發現自己傻了不知道怎麽維護endpos…… 一氣之下直接kmp拉倒,mdzz UPD:現在我好像會維護endpos了…… #i

轉載WEBRTC基本介紹

webrtc 數據流 應用 帶寬 工作 ogl 回聲 real 明顯 “WebRTC,名稱源自網頁實時通信(Web Real-Time Communication)的縮寫,是一個支持網頁瀏覽器進行實時語音對話或視頻對話的技術,是谷歌2010年以6820萬美元收購

event.keyCode用法及列表

strong page ets cells 不支持 和數 jump fire 靜音 event.keyCode用法及列表 HTML 用戶名:<input type="text" id="UserAccount" onKeyPress="JumpByEnter(

javascriptslice()的用法

spl 定位 .html 指定位置 gree 只需要 相等 綜合應用 個數 js splice()的用法 在javascript中splice()方法有如下3種方式: 刪除——可以刪除任意數量的項,只需要指定2個參數:要刪除的第一項的位置和要刪除項的項數。 例如,s

MT97三元基本不等式秒解一道三元不等式

es2017 技術 lin round 基本 com 技術分享 itl tle MT【97】三元基本不等式秒解一道三元不等式

hivehive表很大的時候查詢報錯問題

一段時間 partition 查詢 query order exception concat 使用 小時   線上hive使用環境出現了一個奇怪的問題,跑一段時間就報如下錯誤: FAILED: SemanticException MetaException(message

Hive優化策略

nap set 進行 類型 命令 part ado http 計劃 Hive對於表的操作大部分都是轉換為MR作業的形式,為了提高OLAP[online analysis process 在線分析處理]的效率,Hive自身給出了很多的優化策略 1. explain[解釋執行計

轉載Java DecimalFormat 用法

最快 public oid get div 科學計數 科學 符號 一個 轉載只供個人學習參考,以下查看請前往原出處:http://blog.csdn.net/wangchangshuai0010/article/details/8577982 我們經常要將數字進行格式化,比

轉載ViewState的用法

log 當我 article 產生 源碼 協議 write 自動 記憶 本文導讀:在web窗體控件設置為runat = "server",這個控件會被附加一個隱藏的屬性_ViewState,_ViewState存放了所有控件在ViewState中的狀態值。ViewState

javajava基本編碼規範

分享 -m cimage down auto bfd imageview ava bbb 【java】java基本編碼規範

轉載關於generate用法的總結Verilog

case分支 intro 技術分享 結構 類型 img ora 做了 alt http://www.cnblogs.com/nanoty/archive/2012/11/13/2768933.html Abtract generate語句允許細化時間(Elabora

Pythonself的用法掃盲

現在 使用 內置 匹配 body 參數 IT ini 是把 在Python中,我們有兩個重要的概念:類與實例例如:我們在現實生活中人就是一個類,實例就是具體到某一個男人(張三、李四等)1.類:定義人這個類class People(object): pass2.實例:創建實

JSONNewtonsoft的用法和原理

AS 網上 style model ret 控制 顯示 () .json 老忘記用法,所以這裏記一下,方便以後查找: 1.將DataSet轉成Json public string GetList() { string

#pragma的用法

導出數據 AS val bad 允許 包括 record -name nds 在所有的預處理指令中,#Pragma 指令可能是最復雜的了,它的作用是設定編譯器的狀態或者是指示編譯器完成一些特定的動作。#pragma指令對每個編譯器給出了一個方法,在保持與C和C++語言完

python del 的用法

變量引用 pre 理解 fir 數據對象 net 變量 不同 first 轉自 https://blog.csdn.net/love1code/article/details/47276683 python中的del用法比較特殊,新手學習往往產生誤解,弄清del的用法,可以

Linux菜鳥起飛之路Linux基本常識

copy 聯合 das 安裝第三方 所有組 以及 改進 伯克利 版本 一、Unix操作系統基本常識 1.什麽是Unix? Unix是一個計算機操作系統,是一個用來協調、管理和控制計算機硬件與軟件資源的控制程序。 2.Unix操作系統的特點? 多用戶與多任務。多用戶表示在同一

hive關於使用者留存率的計算

首先使用者留存率一般是面向新增使用者的概念,是指某一天註冊後的幾天還是否活躍,是以每天為單位進行計算的.一般收到的需求都是一個時間段內的新增使用者的幾天留存 (1)找到這個時間段內的新增使用者(也可能含有地區啊的各種附加條件),一般在日活表中有記錄是否是新增狀態.注意,需要以天為單位進行分組找出使用者的id

node基本使用

一、Node.js是什麼 Node.js不是一門語言不是庫不是框架 Node.js是javascript執行時環境。簡單來說就是Node.js可以解析和執行js程式碼,現在js可以脫離瀏覽器執行 瀏覽器中的js Ecmascript(基本語法,if