Skip to content

Instantly share code, notes, and snippets.

@bwmcadams
Created June 17, 2012 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bwmcadams/2943236 to your computer and use it in GitHub Desktop.
Save bwmcadams/2943236 to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE scores ( student int, name string, score int )
ROW FORMAT SERDE "com.mongodb.hadoop.hive.BSONSerde"
STORED AS INPUTFORMAT "com.mongodb.hadoop.hive.input.BSONFileInputFormat"
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION "/Users/brendan/code/mongodb/mongo-hadoop/hive/test";
LOAD DATA LOCAL INPATH "scores.bson" INTO TABLE scores;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment