栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Hive 的交互方式

Hive 的交互方式

1)第一种交互方式 bin/hive

cd /export/servers/apache-hive-2.1.1-bin/
bin/hive

创建一个数据库

create database if not exists mytest;

2)第二种交互方式:使用sql语句或者sql脚本进行交互

不进入hive的客户端直接执行hive的hql语句

cd /export/servers/apache-hive-2.1.1-bin
bin/hive -e "create database if not exists mytest;"

或者我们可以将我们的hql语句写成一个sql脚本然后执行

cd /export/servers
vim  hive.sql
create database if not exists mytest;
use mytest;
create table stu(id int,name string);

通过hive -f 来执行我们的sql脚本

bin/hive -f /export/servers/hive.sql
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/672546.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号