码迷,mamicode.com
首页 > 数据库 > 详细

HIVE HSQL 基本操作命令

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

标签:des   show   分区   建表   hive   test   创建   try   tables   

创建表:

  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 基本操作命令

标签:des   show   分区   建表   hive   test   创建   try   tables   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!