AnsweredAssumed Answered

Problem with hive external tables

Question asked by gautier on May 21, 2013
Latest reply on May 22, 2013 by Ted Dunning
Hey,

I'm a newbie with Hadoop and especially Hive.
I'm trying to work with external table in hive and I encounter a problem.

So I have a file wich contains 700 000 rows of this type:

> NYSE,AEA,2010-02-08,4.42,4.42,4.21,4.24,205500,4.24 NYSE,AEA,2010-02-05,4.42,4.54,4.22,4.41,194300,4.41

I runned the following script

> CREATE EXTERNAL TABLE IF NOT EXISTS stocks ( 
exchange STRING,  
symbol STRING, 
ymd STRING, 
price\_open FLOAT, 
price\_high FLOAT, 
price\_low FLOAT, 
price\_close FLOAT, 
volume INT, 
price\_adj\_close FLOAT) 
ROW FORMAT DELIMITED 
FIELDS TERMINATED BY ',' 
LOCATION '/home/mapr/Documents/data_hive/stocks-p56';

The table is actually created (describe stocks; works)
But when I run:

    select * from stocks;

I have no row in response. Thre same with : select symbol from stocks; 
Any idea? thank's for your help

gautier

Outcomes