当前位置: 移动技术网 > IT编程>数据库>其他数据库 > Hive基础测试操作

Hive基础测试操作

2019年04月11日  | 移动技术网IT编程  | 我要评论

一、hive测试

  1.查看数据库

  show databases;

  2.使用某个数据库,如默认数据库

  user default;

  3.创建表

  create table if not exist itstar(id int,name string);

  4.插入数据

  insert into table itstar values(1,"wyh");

  5.查询

  select * from itstar;

  6.删除表

  drop table itstar;

  7.删除数据库

  create database hive_db;

  drop database if exist hive_db;

  8.退出hive

  quit;

二、向hive中的表导入文本数据

  1.在hive中创建表

  create table students(id int,name string) row format delimited fields terminated by "\t";

  2.导入数据  

  load data local inpath '/root/data/student.txt' into table students;

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网