Mein erster Versuch war:Ist es möglich, eine Hive-Tabelle mit Textausgabeformat zu erstellen?
CREATE TABLE t1 (
a string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE ;
Aber das Ergebnis davon ist:
CREATE TABLE t1 (
a string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' ;
, die in einer Binärdatei und nicht um eine Textdatei zu führen scheint.
I Einfügen von Daten in t1:
insert into t1 values ("hello");
INFO : Loading data to t1
INFO : Table t1 stats: [numFiles=1, numRows=1, totalSize=14, rawDataSize=5]
No rows affected (86.403 seconds)
Die hdfs-Datei, die Ergebnisse ist:
14 2017-10-18 17:20 t1/000000_0.deflate
und der Inhalt sind binär. Was ich eigentlich brauche, ist eine Textdatei.
Also, ist es möglich, ein hdfs-Ausgabeformat, das ist Text?
Übrigens verwende ich eine große Datenverteilung Hortonworks. HDP 2.5.0.
$ hdp-select | grep hive
hive-metastore - 2.5.0.0-1245
hive-server2 - 2.5.0.0-1245
hive-server2-hive2 - 2.5.0.0-1245
hive-webhcat - 2.5.0.0-1245