hive横转竖
来源:互联网 发布:尼加拉瓜运河 知乎 编辑:程序博客网 时间:2024/06/09 16:29
1.vi yongchun_job.txt
This is my test
2.create table yongchun_job_1(
col_1 string,
col_2 string,
col_3 string,
col_4 string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE;
3.load data local inpath 'yongchun_job.txt' overwrite into table yongchun_job_1
4.vi myjob.py
import sys
for line in sys.stdin:
line = line.strip()
s=line.split('\t')
for t in s:
print t
5.
select
transform(col_1,col_2,col_3,col_4)
using 'python myjob.py'
as col_my
from yongchun_job_1
/usr/share/ant/lib
/group/tbdev/chao.liangc/hive
This is my test
2.create table yongchun_job_1(
col_1 string,
col_2 string,
col_3 string,
col_4 string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
STORED AS TEXTFILE;
3.load data local inpath 'yongchun_job.txt' overwrite into table yongchun_job_1
4.vi myjob.py
import sys
for line in sys.stdin:
line = line.strip()
s=line.split('\t')
for t in s:
print t
5.
select
transform(col_1,col_2,col_3,col_4)
using 'python myjob.py'
as col_my
from yongchun_job_1
/usr/share/ant/lib
/group/tbdev/chao.liangc/hive
- hive横转竖
- Hive
- HIVE
- Hive
- hive
- hive
- hive
- hive
- hive
- Hive
- hive
- Hive
- hive
- Hive
- Hive
- hive
- Hive
- hive
- 在hadoop的namenode上建立文件夹
- Vmware与主机间共享文件的七种方法(附图+详解)
- POJ 1094 Sorting It All Out 拓扑排序
- oracle实现行列转换
- VMware虚拟机和宿主机互相映射磁盘分区
- hive横转竖
- Installing JDeveloper on Mac OS X Lion (10.7)
- CEGUIEditBox : 获得准确的字符长度,看我给CEGUIEditBox动手术
- c++虚函数的前奏--函数指针与回调
- 解决了Could not get lock /var/cache/apt/archives/lock
- 如何在一个java类main方法中调用另一个类中的main方法
- JAVA 数据库连接编码问题
- erlang(2) gen_server
- 深入理解C/C++函数指针