Hive
来源:互联网 发布:淘宝男潮鞋店铺推荐 编辑:程序博客网 时间:2024/04/28 12:13
1. ps -ef | grep hive
2. hive --service hiveserver
3.CREATE external TABLE IF NOT EXISTS person1
(
id INT,
name STRING
)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","name":"name"}')
TBLPROPERTIES('mongo.uri'='mongodb://10.42.185.55:27017/testHive.persons');
insert into table persons select * from test; (test table is already exist in hive)
hive export to mongo
a. firstly you should copy mongo-hadoop-hive_x.jar to hive/lib
The fking important point is that you need to change conf/hive-env.sh
specify
export HIVE_CONF_DIR=$HIVE_HOME/conf
export HIVE_AUX_JARS_PATH=$HIVE_HOME/lib
and additional steps I don't know if they are necessary are copying jackson-*.jar under hive/lib to hadoop/lib
------------------------------------------------------------------------------------
hive
hive --service hiveserver
problems
1. Failed with exception Unable to rename: hdfs://vm-9ac7-806d.apac.nsroot.net:8020/tmp/hive-007/hive_2014-03-27_17-18-57_060_5683127430773874167-1/-ext-10000 to: DataSet/m
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
or if you insert results to a table, you see no error, but nothing imported to table, then below change will do the trick
solution:
in hive-default.xml, change false to true
<property>
<name>hive.insert.into.multilevel.dirs</name>
<value>true</value>
</property>
2. hive --service hiveserver
3.CREATE external TABLE IF NOT EXISTS person1
(
id INT,
name STRING
)
STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler'
WITH SERDEPROPERTIES('mongo.columns.mapping'='{"id":"_id","name":"name"}')
TBLPROPERTIES('mongo.uri'='mongodb://10.42.185.55:27017/testHive.persons');
insert into table persons select * from test; (test table is already exist in hive)
hive export to mongo
a. firstly you should copy mongo-hadoop-hive_x.jar to hive/lib
The fking important point is that you need to change conf/hive-env.sh
specify
export HIVE_CONF_DIR=$HIVE_HOME/conf
export HIVE_AUX_JARS_PATH=$HIVE_HOME/lib
and additional steps I don't know if they are necessary are copying jackson-*.jar under hive/lib to hadoop/lib
------------------------------------------------------------------------------------
hive
hive --service hiveserver
problems
1. Failed with exception Unable to rename: hdfs://vm-9ac7-806d.apac.nsroot.net:8020/tmp/hive-007/hive_2014-03-27_17-18-57_060_5683127430773874167-1/-ext-10000 to: DataSet/m
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
or if you insert results to a table, you see no error, but nothing imported to table, then below change will do the trick
solution:
in hive-default.xml, change false to true
<property>
<name>hive.insert.into.multilevel.dirs</name>
<value>true</value>
</property>
0 0
- Hive
- HIVE
- Hive
- hive
- hive
- hive
- hive
- hive
- Hive
- hive
- Hive
- hive
- Hive
- Hive
- hive
- Hive
- hive
- hive
- 程序员学习资料分享---爱分享的程序员(新浪微博)
- linux cronolog分割日志
- 初创科技公司请注意:筹资要在市场火热时做
- 电子商务作业3:开网店
- ios 图片压缩
- Hive
- 有关无需密码使用密钥登录ssh服务器的知识
- 去除导航栏的左右按钮的空格间隙
- SQL SERVER 找出长时间运行的事务
- 基于Java的全文检索引擎简介
- 通过注册表来清理不运行DLL文件方法
- C++使用共享内存实现进程间通信
- iOS绘图教程
- 几个算法