码迷,mamicode.com
首页 > 数据库 > 详细

mongodb_hive建表

时间:2018-12-14 19:56:51      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:3.2   prope   ora   base   o2o   handle   建表   sage   storage   

create database hive_to_mongodb;
add jar /hgx/mongo-hadoop-core-1.5.1.jar /hgx/mongo-hadoop-hive-1.5.1.jar /hgx/mongo-java-driver-3.2.1.jar;
add jar /jar_tools/mongodb/mongo-hadoop-core-1.5.1.jar /jar_tools/mongodb/mongo-hadoop-hive-1.5.1.jar /jar_tools/mongodb/mongo-java-driver-3.2.1.jar;

CREATE EXTERNAL TABLE rec_o2o_app
(
id string,
uid string,
message string,
time timestamp,
inTime string,
outTime string
)
STORED BY ‘com.mongodb.hadoop.hive.MongoStorageHandler‘
WITH SERDEPROPERTIES(‘mongo.columns.mapping‘=‘{"id":"_id","uid":"uid","message":"message","time":"time","inTime":"inTime","outTime":"outTime"}‘)
TBLPROPERTIES(‘mongo.uri‘=‘mongodb://10.10.10.33:27017/log.REC_O2O-app‘);

mongodb_hive建表

标签:3.2   prope   ora   base   o2o   handle   建表   sage   storage   

原文地址:https://www.cnblogs.com/heguoxiu/p/10120713.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!