hive建表


/* 查看数据库*/
show databases;
/* 使用数据库*/
use $db_names;
/* 查看数据库中有哪些表*/
show tables;
/* 查看数据库里的表信息*/
desc $table_name;
/* 查看某个key下的值*/
select key from $table_name limit 10;
/* 查询某个key下全部的字段值*/
select key from $table_name where key="xxx";

 // 创建表
create table if not exists dev.syw5 (name string, sex string, age int) ROW format delimited FIELDS TERMINATED BY ',' STORED AS textfile

// 往表里写数据
load data local inpath 'man.txt' into table dev.syw5;

 

posted @ 2021-01-10 09:44  威威后花园  阅读(109)  评论(0编辑  收藏  举报