当前位置: 首页 > news >正文

educoder中Hive -- 索引和动态分区调整

第1关:Hive -- 索引

 ---创建mydb数据库
create database if not exists mydb;
---使用mydb数据库
use mydb;
---------- Begin ----------
---创建staff表
create table staff(  
id int,  
name string,  
sex string)  
row format delimited fields terminated by ','
stored as textfile;
---导入数据:/root/staff.txt
load data local inpath '/root/staff.txt' into table staff;
---创建staff表索引:索引名称为staff_index,索引字段为id,创建索引后的表:sta
create index staff_index
on table staff(id)
as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler'
with deferred rebuild
in table sta;
---生成索引数据并查看sta索引表数据
alter index staff_index on staff rebuild;  
select * from sta;
---查看索引
show index on staff;  
---删除索引后再查看索引
drop index staff_index on staff;
show index on staff;
---------- End ----------
---清空staff表
truncate table staff;
---删除staff表
drop table staff;

第2关:Hive -- 动态分区调整

 ---创建mydb数据库
create datab
http://www.lryc.cn/news/241218.html

相关文章:

  • http与https有什么区别,https攻击要如何防护
  • nginx+keepalived
  • Re51:读论文 Language Models as Knowledge Bases?
  • .NET 使用配置文件
  • vue 通过ref调用router-view子组件的方法
  • 在全球碳市场中崭露头角的中碳CCNG
  • uni-app - 弹出框
  • 深度学习之基于Tensorflow卷积神经网络鸟类目标识别检测系统
  • 关闭EntityFramework日志输出SQL
  • 重新开启GPT Plus充值通道——基于前端开发者工具
  • 技术细分|推荐系统——推荐系统中的数据去偏方法
  • 多功能回馈式交流电子负载的应用
  • AIGC专题报告:生成式人工智能用例汇编
  • php xml数据转数组两种方式
  • wagtail-安装配置
  • 基于Android校园交流uniAPP+vue 微信小程序v7e1
  • geemap学习笔记013:为遥感动态GIF图添加图名
  • 【开源】基于JAVA的高校实验室管理系统
  • 为啥 有了锤子,看啥都是钉子?
  • java实现连接linux(上传文件,执行shell命令等)
  • 苹果企业签名和TF签名都是iOS内测中的常见方法有哪些?
  • CC++输入输出流介绍
  • leedcode 刷题 - 除自身以外数组的乘积 - 和为 K 的子数组
  • uniapp 富文本以及移动端富文本的展示问题
  • JAVA sql 查询
  • 掌握Katalon Studio 导入 swagger 接口文档,接口测试效率提升100%
  • 程序员最奔溃的瞬间
  • java字符串的常见用法
  • 链表OJ--下
  • FreeRTOS源码阅读笔记4--semphr.h