My first attempt was:
CREATE TABLE t1 (
a string )
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE ;
But the result of that is:
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' ;
which seems to result in a binary file and not a text file.
I insert data into 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)
The hdfs file that results is:
14 2017-10-18 17:20 t1/000000_0.deflate
And the contents are binary. What I actually need is a text file.
So, is it possible to get an hdfs output format which is text?
BTW, I am using a hortonworks big data distribution. 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