Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. DROP TABLE usersExternal;
  2. CREATE EXTERNAL TABLE usersExternal
  3. (
  4. id INT,
  5. personal STRUCT<
  6. name:STRUCT<f:STRING, l:STRING>,
  7. class:STRUCT<year:INT>
  8. >,
  9. relatives ARRAY<STRUCT<f:STRING, l:STRING>>,
  10. age INT
  11. )
  12. ROW FORMAT SERDE "com.mongodb.hadoop.hive.BSONSerDe"
  13. WITH SERDEPROPERTIES("mongo.columns.mapping"="{'id':'_id',
  14. 'relatives.f':'_Relatives._F', 'personal.name.f':'_Personal._Name._F',
  15. 'personal.class':'_Personal._Class'}")
  16. STORED AS INPUTFORMAT "com.mongodb.hadoop.mapred.BSONFileInputFormat"
  17. OUTPUTFORMAT "com.mongodb.hadoop.hive.output.HiveBSONFileOutputFormat"
  18. TBLPROPERTIES("mongo.uri"="mongodb://localhost:27017/test.users")
  19. STORED AS TEXTFILE LOCATION "/hdfs/app/DataLakes/ronshah/mongoDB/";
  20.  
  21. FAILED: ParseException line 20:0 missing EOF at 'STORED' near ')'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement