excel數據導入到hive中

關注微信公共號:小程在線

關注CSDN博客:程志偉的博客

需要的工具是:

shell 下載地址:https://download.zol.com.cn/tuiguang/detail/36/359035.shtml

xftp 下載地址:https://download.zol.com.cn/detail/37/362543.shtml

根據自己hive設置對應的地址與端口;

登陸自己的賬號與密碼;

 

創建表結構的示例如下:

create table if not exists test.cheng(
    system       string,
    check         string    
)
row format delimited 
fields terminated by '\t' 
stored as textfile;
然後將test.txt傳入到自己對應的目錄,inpath對應自己的目錄,是用xftp上傳txt至該目錄;

不知道目錄的可以使用pwd命令來查看當前路徑。

load data local inpath '/home/chengzw/test.txt' overwrite into table test.cheng;

導入成功後,執行

select * from test.cheng;

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章