hive数组使用 hive 数组长度

数据
afan@ubuntu:/usr/local/hadoop/hive$ cat test.txt
12,23,23,34what,are,this
34,45,34,23,12who,am,i,are

afan@ubuntu:/usr/local/hadoop/hive$ hive
Hive historyfile=/tmp/afan/hive_job_log_afan_201105240353_929616223.txt
hive> drop table t_afan_test;
OK
Time taken: 3.288 seconds
hive> create table t_afan_test
> (
> info1array<int>,
> info2array<string>
> )
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY 't'
> COLLECTION ITEMS TERMINATED BY ','
> ;
hive数组使用 hive 数组长度
OK
Time taken: 0.58 seconds
hive> LOAD DATA LOCAL INPATH 'test.txt' OVERWRITEINTO TABLE t_afan_test;
Copying data from file:/usr/local/hadoop/hive/test.txt
Copying file: file:/usr/local/hadoop/hive/test.txt
Loading data to table default.t_afan_test
Deleted hdfs://localhost:9000/user/hive/warehouse/t_afan_test
OK
Time taken: 0.742 seconds
hive> select * from t_afan_test;
OK
[12,23,23,34]["what","are","this"]
[34,45,34,23,12]["who","am","i","are"]
Time taken: 0.429 seconds
hive> select size(info1), size(info2) fromt_afan_test;
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduceoperator
Starting Job = job_201105240347_0001, Tracking URL =http://localhost:50030/jobdetails.jsp?jobid=job_201105240347_0001
Kill Command = /usr/local/hadoop/bin/../bin/hadoopjob -Dmapred.job.tracker=localhost:9001 -killjob_201105240347_0001
2011-05-24 03:55:49,564 Stage-1 map = 0%, reduce= 0%
2011-05-24 03:55:52,597 Stage-1 map = 50%, reduce= 0%
2011-05-24 03:55:55,653 Stage-1 map = 100%,reduce = 0%
Ended Job = job_201105240347_0001
OK
4 3
5 4
Time taken: 20.171 seconds
hive> select info1[2], info2[0] fromt_afan_test;
Total MapReduce jobs = 1
Launching Job 1 out of 1
Number of reduce tasks is set to 0 since there's no reduceoperator
Starting Job = job_201105240347_0002, Tracking URL =http://localhost:50030/jobdetails.jsp?jobid=job_201105240347_0002
Kill Command = /usr/local/hadoop/bin/../bin/hadoopjob -Dmapred.job.tracker=localhost:9001 -killjob_201105240347_0002
2011-05-24 03:56:37,513 Stage-1 map = 0%, reduce= 0%
2011-05-24 03:56:40,543 Stage-1 map = 100%,reduce = 0%
2011-05-24 03:56:43,611 Stage-1 map = 100%,reduce = 100%
Ended Job = job_201105240347_0002
OK
23 what
34 who
Time taken: 10.88 seconds

  

爱华网本文地址 » http://www.413yy.cn/a/25101011/74704.html

更多阅读

巾帼不让须眉的妈妈赛马冠军 巾帼不让须眉的诗句

今天是三八妇女节,首先向节日中的妇女朋友们祝贺节日快乐!在妇女节为女同胞们发一组在草原拍摄的女赛马冠军的照片,也请大家分享一次这位妈妈赛马冠军的快乐! 草原上的赛马参赛人员不分男女老少,自己准备马匹报名就可以参加,妇女儿童参赛

C#变长数组二 c 数组长度 变量

首先声明,这不是我写的,只是我看对你有用才贴上来的1、什么是ArrayList ArrayList就是传说中的动态数组,用MSDN中的说法,就是Array的复杂版本,它提供了如下一些好处:动态的增加和减少元素实现了IColle

C#的动态数组 c 动态数组的用法

在使用数组的过程中,有时候希望数组的长度和元素个数能随程序的运行不断改变,但改变一次就要重新开辟一个新的数组对象,这样将占用内存空间。为了解决这个问题,Microsoft.NET Framework 体统了一个ArrayList类,专门用于处理可按动态增减

声明:《hive数组使用 hive 数组长度》为网友晨敛清荷分享!如侵犯到您的合法权益请联系我们删除