HIVE&&SQOOP

create table score_table (
subject string,
student string,
score int
)partitioned by (date string);


create table score_table_2(
subject string,student string,score int)
partitioned by (y string ,m string, d string);


sqoop import
--connect jdbc:oracle:thin:@10.25.18.36:1524:ldqd0
--username LIFEMAN --password LIFETEST
--table SCORE_TABLE --split-by STUDENT -m 2
--verbose --hive-table SCORE_TABLE_2
--where update >&1
--hive-partition-key y,m,d
--hive-partition-value 2013,03,02
--hive-import


分享一个小东西,在编辑hadoop版本1源码(hive相似)的过程中,发现ant eclipse-files时(其实就是把源码目录下面的eclipse-files文件里面的东西拷贝到src目录下),生成的项目中有些代码并没有导入到eclipse src目录下面,只是当做了项目的一个文件夹,从而eclipse无法进行语法检测,研究了一下,可以通过编辑hadoop源码下面的.classpath文件把相应的src目录加入进去即可,另外还可以加入lib库等,比如:
<classpathentry kind="src" path="src/contrib/capacity-scheduler/src/java"/>
<classpathentry kind="src" path="src/contrib/capacity-scheduler/src/test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
<classpathentry kind="lib" path="lib/commons-cli-1.2.jar"/>

网上有一个博客,专门讲了这个东西,可以参考一下
http://www.ibm.com/developerworks/opensource/tutorials/os-eclipse-classpath/section2.html#listing1


//*** 查看语句
select subject,student,score from (
select subject,student,score,row_number()
over (
distribute by subject,student,score
sort by subject desc
) rownum
from score_table ) aa where aa.rownum = 1;
**//

//执行语句
select subject,student,score from ( select subject,student,score,row_number() over (distribute by subject,student,score sort by subject desc) rownum from score_table ) aa where aa.rownum = 1;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值