簡體   English   中英

如何從csv加載數據?

[英]How can hive load data from csv?

我想實現apache hive ,我想將數據從csv file加載到hive table 所以,這是問題所在:

我的csv fileSQL Server生成,它的結構有“ sign ,它就像"04748/09","2248559","2248559","2009-12-03 00:00:00" 。所以我怎么能只有沒有“ sign

非常感謝,我需要你的建議......

你的評論中提到的問題 - 如何在hive上導入像mysql導入時忽略第一行? 從Hive v0.13.0,您可以使用skip.header.line.count。 您也可以在創建表時指定相同的內容。 例如:

Create external table testtable (name string, message string) row format delimited fields terminated by '\t' lines terminated by '\n' location '/testtable'
tblproperties ("skip.header.line.count"="1");

要么

CREATE TABLE TEMP (f1 STRING, f2 String, f3 String, f4 String) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' TBLPROPERTIES("skip.header.line.count"="1");

load data local inpath 'test.csv'
overwrite into table TEMP;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM