So I am just starting out with HIVE,
Here is what I do,
-> Load the file into HDFS:
hadoop fs -put purchases.txt
-> Create a table:
> CREATE EXTERNAL TABLE p1(transaction STRING) STORED AS TEXTFILE
> LOCATION '/purchases.txt';
or
CREATE TABLE p1(transaction STRING) STORED AS TEXTFILE LOCATION '/purchases.txt';
-> Show the table:
show tables;
At this point it shows me the table p1 has been created.
-> Viewing Contents
select * from p1
It just outputs
OK
Time taken: 0.175 seconds
EDIT:
The data is stored in this format:
date '\t' time '\t' store '\t' item '\t' cost
I would like to take the whole line as a single string and hence i've specified only one string column.