首页 > 其他 > 详细

Hive基础测试操作

时间:2019-04-10 12:52:54      阅读:87      评论:0      收藏:0      [点我收藏+]

一、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;

Hive基础测试操作

原文:https://www.cnblogs.com/HelloBigTable/p/10682684.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!