Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DROP TABLE usersExternal;
- CREATE EXTERNAL TABLE usersExternal
- (
- id INT,
- personal STRUCT<
- name:STRUCT<f:STRING, l:STRING>,
- class:STRUCT<year:INT>
- >,
- relatives ARRAY<STRUCT<f:STRING, l:STRING>>,
- age INT
- )
- ROW FORMAT SERDE "com.mongodb.hadoop.hive.BSONSerDe"
- WITH SERDEPROPERTIES("mongo.columns.mapping"="{'id':'_id',
- 'relatives.f':'_Relatives._F', 'personal.name.f':'_Personal._Name._F',
- 'personal.class':'_Personal._Class'}")
- STORED AS INPUTFORMAT "com.mongodb.hadoop.mapred.BSONFileInputFormat"
- OUTPUTFORMAT "com.mongodb.hadoop.hive.output.HiveBSONFileOutputFormat"
- TBLPROPERTIES("mongo.uri"="mongodb://localhost:27017/test.users")
- STORED AS TEXTFILE LOCATION "/hdfs/app/DataLakes/ronshah/mongoDB/";
- FAILED: ParseException line 20:0 missing EOF at 'STORED' near ')'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement