温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

hadoop中hive的示例分析

发布时间:2021-12-08 11:12:00 来源:亿速云 阅读:110 作者:小新 栏目:云计算

小编给大家分享一下hadoop中hive的示例分析,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

1.1下载hbase http://osdn.jp/projects/sfnet_purehadoop/downloads/hive-0.12.0.tar.gz/

1.2安装[root@hadoop04 Desktop]# tar -zxvf hive-0.12.0.tar.gz -C ../app/

[root@hadoop04 Desktop]# cd ../app
[root@hadoop04 app]# ls
hive-0.12.0
[root@hadoop04 app]# cd hive-0.12.0

[root@hadoop04 hive-0.12.0]# cd bin
[root@hadoop04 bin]# ./hive

hive> show databases;

OK
default
Time taken: 23.804 seconds, Fetched: 1 row(s)

hive> create database yun12
    > ;
OK
Time taken: 24.355 seconds
hive> show databases
    > ;
OK
default
yun12
Time taken: 4.162 seconds, Fetched: 2 row(s)

hive> create table t_mygirls(id int,name string, age int, size string);

OK
Time taken: 28.528 seconds

hive> show tables;
OK
t_mygirls
Time taken: 0.062 seconds, Fetched: 1 row(s)
hive> drop table t_mygirls;
OK
Time taken: 2.772 seconds

hive> create table t_mygirls(id int,name string, age int, size string) row format
    > delimited
    > fields terminated by "\t";

http://192.168.88.166:50070/explorer.html#/user/hive/warehouse

Browse Directory


     

PermissionOwnerGroupSizeReplicationBlock SizeName
drwxr-xr-xrootsupergroup0 B00 Bt_mygirls
drwxr-xr-xrootsupergroup0 B00 Byun12.db

[root@hadoop06 hadoop-2.6.0]# vi mygirls.data

1       baby    18      36C
2       YIFEI   19      38d
3       yangmi  20      31q
4       zhiling 40      39t

[root@hadoop04 ~]# hadoop fs -put mygirls.data /user/hive/warehouse/t_mygirls(t_mygirls文件夹的路径)

hive> select * from t_mygirls;
OK

以上是“hadoop中hive的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI