將excel中的資料匯入hive

2021-07-15 06:37:57 字數 888 閱讀 7643

步驟二,將該txt檔案匯入linux指定目錄中

步驟三,轉換編碼格式,在指定目錄下執行如下命令:piconv -f gb2312 -t utf-8 companycode.txt  >  c.txt

步驟四,根據文件中的列,建立表,建表語句如下:

hive> create table companycode (

> ccn string,

> subsidiary string,

> salearea string,

> region string,

> corporatename string,

> corporatenameit string,

> remarks string)

> row format delimited

> fields terminated by '\t'

> stored as textfile;

步驟五:將c.txt檔案載入到hive表companycode中

hive> load data local inpath '/home/hadoop/c.txt' into table companycode;

loading data to table default.companycode

table default.companycode stats: [numfiles=1, totalsize=3711]

oktime taken: 0.826 seconds

步驟六:驗證

hive> select * from companycode;

注意觀察:

1. 驗證資料是否上傳成功

2. 若沒有資料,檢視所有資料是否都儲存在第一列

3. 有資料,是否正常,是否出現串列現象

利用Sqoop將MySQL資料匯入Hive中

參考 1.list databases sqoop list databases connect jdbc mysql username sqoop password sqoop 2.用sqoop建立hive表 sqoop create hive table connect jdbc mysql x...

將gridview中的資料匯入excel中

將gridview中的資料匯入excel中,解決漢字出現亂碼的問題。1 首先編寫匯出函式export 2 按鈕事件呼叫該方法 3 重寫verifyrenderinginserverform事件,如果是將datagrid中的資料匯入到excel中,就沒必要重寫該方法。public override v...

將Excel中的資料匯入至sqlserver資料表

首先雙擊開啟sqlserver,介面如圖所示 右擊需要匯入資料的資料庫,點選任務,再點選任務中的匯入資料選項 如果出現了 未在本地計算機上註冊 microsoft.ace.oledb.12.0 的錯誤,需要先office驅動程式,安裝資料連線元件 資料來源選擇excel 選擇需要匯入的excel,選...