大数据学习——hive数仓DML和DDL操作
1 创建一个分区表
create table t_partition001(ip string,duration int)
partitioned by(country string)
row format delimited
fields terminated by ',';
2 添加数据
load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="China");


3 增加一个分区
alter table t_partition001 add partition(country="Japan");
4添加数据
load data local inpath '/root/hivedata/t_partitioned' into table t_partition001 partition(country="Japan");

5 show partitions t_partition001;

6删除分区
alter table t_partition001 drop partition(country="Japan");
7修改表名
alter table t_partition001 rename to t_partition002;
8表增加一列
alter table t_partition002 add columns(city string);

9 替换表中所有字段
alter table t_partition002 replace columns(name string);

10 更新某一列

大数据学习——hive数仓DML和DDL操作的更多相关文章
- 在HUE中将文本格式的数据导入hive数仓中
今天有一个需求需要将一份文档形式的hft与fdd的城市关系关系的数据导入到hive数仓中,之前没有在hue中进行这项操作(上家都是通过xshell登录堡垒机直接连服务器进行操作的),特此记录一下. - ...
- 大数据学习——hive基本操作
1 建表 create table student(id int,name string ,age int) row format delimitedfields terminated by ','; ...
- 大数据学习——hive数据类型
1. hive的数据类型Hive的内置数据类型可以分为两大类:(1).基础数据类型:(2).复杂数据类型2. hive基本数据类型基础数据类型包括:TINYINT,SMALLINT,INT,BIGIN ...
- 大数据学习——hive显示命令
show databases; desc t_partition001; desc extended t_partition002; desc formatted t_partition002; !c ...
- 大数据学习——hive的sql练习题
ABC三个hive表 每个表中都只有一列int类型且列名相同,求三个表中互不重复的数 create table a(age int) row format delimited fields termi ...
- 大数据学习——hive函数
1 内置函数 测试各种内置函数的快捷方法: 1.创建一个dual表 create table dual(id string); 2.load一个文件(一行,一个空格)到dual表 3.select s ...
- 大数据学习——hive的sql练习
1新建一个数据库 create database db3; 2创建一个外部表 --外部表建表语句示例: create external table student_ext(Sno int,Sname ...
- 大数据学习——hive安装部署
1上传压缩包 2 解压 tar -zxvf apache-hive-1.2.1-bin.tar.gz -C apps 3 重命名 mv apache-hive-1.2.1-bin hive 4 设置环 ...
- 大数据学习——hive使用
Hive交互shell bin/hive Hive JDBC服务 hive也可以启动为一个服务器,来对外提供 启动方式,(假如是在itcast01上): 启动为前台:bin/hiveserver2 启 ...
随机推荐
- 数论/暴力 Codeforces Round #305 (Div. 2) C. Mike and Frog
题目传送门 /* 数论/暴力:找出第一次到a1,a2的次数,再找到完整周期p1,p2,然后以2*m为范围 t1,t2为各自起点开始“赛跑”,谁落后谁加一个周期,等到t1 == t2结束 详细解释:ht ...
- HttpURLConnection 发送PUT请求 json请求体 与服务端接收
发送请求: public void testHttp() { String result = ""; try { URL postURL = new URL("http: ...
- Suricata的Reputation
见官网 https://suricata.readthedocs.io/en/latest/reputation/index.html Docs » 9. Reputation Edit on Git ...
- 【C#】为什么有可能会被多个线程修改的对象要加线程锁
例1.不用线程锁的情况下,两个线程对同一个变量进行加减操作 static void Main(string[] args) { Counter counter = new Counter(); var ...
- 关于IE 对 $.get 缓存的记录
最近在IE9中碰到一个问题是, 当我对某个角色进行修改的时候,再点击查询还是修改之前的内容,但是实际数据库已经修改成功,纠结了好一会儿之后,才发现是 $.get请求的问题. 因为 IE对get请求, ...
- 【转】Android官方架构项目之MVP + Clean
首先,不了解 Clean 架构的可以看看这个,不过也没关系,阅读本文后你也许会对Clean架构思想有一个认识. 对比MVP项目的结构图,我们发现不同之处是新增的这个Domain Layer这层,来隔离 ...
- H+后台主题UI框架---整理(三)
这里面介绍下H+后台主题UI框架里面插件的应用,不过都是最最简单最初级的功能.主要有日历插件,input单选多选(icheck)插件,input下拉搜索(chosen)插件. 一.日历插件 有如下几种 ...
- 从 fn_dbLog 解析操作日志(补充update)
过去经常听到SQL server 日志,可是在提供的界面上看到的Log不是我们想要的,我们想窥探具体的数据操作日志.专业恢复追踪数据库操作日志的软件:ApexSQLLog,偶然发现SQL Server ...
- iOS infoq资料架构设计漫谈
http://www.infoq.com/cn/ios/?utm_source=infoq&utm_medium=header_graybar&utm_campaign=topic_c ...
- check_http.c:312: error: ‘ssl_version’
安装nagios-plugins-1.4.16,安装的过程中出现了错误,提示如下.check_http.c:312: error: ‘ssl_version’ undeclared (first us ...