I could not be able to access external table. Please help.


2 Answer(s)


hi Ankit,

I don't see that you have loaded the data into the nasdaq table, pls use "load data inpath" and load data into hive.

Thanks

-Support

 


Thanks for reply ! ! 

There was wrong data files present at my HDFS. I deleted this file and injusted data file again on HDFS.

It is working fine now.    

Load Data is not requred for external table. It works fine without load data.

Here is the correct table : 

hive> CREATE EXTERNAL TABLE NASDAQD (exchange_a string,stock_symbol string,date_e string,stock_price_open float,stock_price_high float,stock_price_low float,stock_price_close float,stock_volume int,stock_price_adj_close float)
    > ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
    > LOCATION '/user/hduser/NASDAQD'; 
OK
Time taken: 0.547 seconds
hive> SELECT * FROM NASDAQD LIMIT 10 ; 
OK
NASDAQ    ABXA    2009-12-09    2.55    2.77    2.5    2.67    158500    2.67
NASDAQ    ABXA    2009-12-08    2.71    2.74    2.52    2.55    131700    2.55
NASDAQ    ABXA    2009-12-07    2.65    2.76    2.65    2.71    174200    2.71
NASDAQ    ABXA    2009-12-04    2.63    2.66    2.53    2.65    230900    2.65
NASDAQ    ABXA    2009-12-03    2.55    2.62    2.51    2.6    360900    2.6
NASDAQ    ABXA    2009-12-02    2.41    2.59    2.4    2.53    287700    2.53
NASDAQ    ABXA    2009-12-01    2.35    2.44    2.27    2.4    302000    2.4
NASDAQ    ABXA    2009-11-30    2.36    2.36    2.11    2.25    446100    2.25
NASDAQ    ABXA    2009-11-27    2.35    2.42    2.3    2.35    135200    2.35
NASDAQ    ABXA    2009-11-25    2.48    2.49    2.4    2.45    77500    2.45
Time taken: 0.61 seconds, Fetched: 10 row(s) 

Regards,

Ankit