Monday, June 15, 2015

Hive Exercise

CREATE EXTERNAL TABLE movie (id INT, name STRING, year INT)  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'  LOCATION '/user/training/movie';


CREATE EXTERNAL TABLE movierating (userid INT, movieid INT, rating INT)  ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'  LOCATION '/user/training/movierating';


INSERT OVERWRITE LOCAL DIRECTORY '/home/training/movie' SELECT * FROM movie

INSERT OVERWRITE LOCAL DIRECTORY '/home/training/movierating' SELECT * FROM movierating

No comments:

Post a Comment