2013-04-11 关于自定义format

1 hivelib下的jar包更换了之后,要想语句使用新的jar包,得在hive
cli中执行quit;退出后重新进入。
2在hive-site.xml中加入对jar包的引用,对整个集群都有效。不用每次都add。
<property>
<name>hive.aux.jars.path</name>
<value>file:///opt/hive-0.9.0/lib/hive_ufida.jar</value>
</property>
3 hive不支持insert into table ×× values()这样的语句。
  最多能insert into table ×× select 。。。
4 尝试了自定义inputformat和outputformat来解决分隔符是字符串的问题。
  一开始的时候用新的format建完外部表,再用select查询的时候报错:
*Failed with exception java.io.IOException:java.io.IOException: Cannot
>> create an instance of InputFormat class
>> 我的inputformat路径名 as specified in mapredWork!*
本来还以为是少了jar包之类的。最后发现是因为format类写的有问题。换成一个没问题的format类就ok了。
 create table testhcl11 (ip STRING,identd STRING,username STRING) stored as INPUTFORMAT 'com.chanjet.hive.format.ClickstreamInputFormat' OUTPUTFORMAT 'com.chanjet.hive.format.SSOOutputFormat' location '/test2/';
create table testhcl8 (ip STRING,identd STRING,username STRING) stored as INPUTFORMAT 'com.chanjet.hive.format.ClickstreamInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' location '/test/'; 


5 outputformat对load数据根本不会起作用,load只是数据的复制或者移动,不牵涉到格式化。
  而它对insert into select这种语句就起作用,会在insert往文件写的时候对数据进行格式化。
6 select的时候起作用的就是inputformat了
 
  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值