0
我在hive中創建表並且也從hdfs加載csv文件,但是當嘗試在創建的表上執行select查詢時,我以加密格式獲得結果,請您爲此提供解決方案。如何在配置表格中加載csv文件?
create table if not exists studentsinforamtion(
studentnumber string ,
universityname string,
collegename string,
studentname string,
branch string,
percentage string,
areaters string,
rankatuniversity INT,
eligibleforcompnay string,
selectedcompanylist int)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
stored as textfile;
load data inpath '/user/root/jobportal/studentinfo.ods' overwrite into table studentsinforamtion;
select * from studentsinforamtion limit 5;
錯誤:
OK
PK5:�C�l9�.mimetypeapplication/vnd.oasis.opendocument.spreadsheetPK5:�C�{C44meta.xml<?xml version="1.0" encoding="UTF-8"?> NULL NULL NULL NULL NULL NULL NULL NULL NULL
<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:grddl="http://www.w3.org/2
這可能很有用:http://chase-seibert.github.io/blog/2013/05/17/hive-insert-and-dump-csv-with-map-datatype.html – Ranveer
a csv-serde在處理csv文件時很好,因爲通常一個字段可能包含使定義的serde不可用的分隔符char – selle