首页 > 数据库技术 > 详细

HIVE HSQL 基本操作命令

时间:2016-11-17 00:15:54      阅读:433      评论:0      收藏:0      [点我收藏+]

创建表:

  hive>create table tablename(id int,name string,password string);

  创建一个名字为tablename的表,表的属性有int   id;  string   name;  string  password;

 

创建一个新表,结构与其他一样
  hive> create table table1 like table2;

  创建一个表table1,表结构跟table2一样;

 

创建分区表

  hive> create table table1(id int,line string) partitioned by (dt string,country string);

 

显示表中有多少分区

  hive> show partitions table1;

 

显示所有表

  hive> show tables;

 

显示所有与u开头的表

  hive> show tables ‘u*‘;

显示表的结构信息

  hive> describe test1;

 

HIVE HSQL 基本操作命令

原文:http://www.cnblogs.com/duking1991/p/6071689.html

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