大数据 java操作hive
版权声明:
本文为博主学习整理原创文章,如有不正之处请多多指教。
未经博主允许不得转载。
https://blog.csdn.net/qq_42595261/article/details/83022249
-
虚拟机上操作,保证hive数据库能正常连接进入。
如因退出没有用到命令(quit;),第二次进入则会报错。解决方法,切换到
[root@xcl ~]# cd apache-hive-2.1.1-bin/conf/
[root@xcl conf]# vi hive-site.xml
最后进行初始化命令为:schematool -initSchema -dbType mysql
在任意目录下输入hive,则ok。
-
创建数据库、在数据库中创建数据表,在本地“造数据”
Create databases text;
例:
CREATE TABLE t4(name String ,age int,likes ARRAY<String>,relation MAP<String,String