Hive:数据仓库利器

1. 简介

Hive是一个基于Hadoop的开源数据仓库工具,可以用来存储、查询和分析大规模数据。Hive使用SQL-like的HiveQL语言来查询数据,并将其结果存储在Hadoop的文件系统中。

2. 基本概念

介绍 Hive 的核心概念,例如表、分区、桶、HQL 等。

2.1 架构

Design - Apache Hive - Apache Software Foundation
组成详情
UIThe user interface for users to submit queries and other operations to the system. As of 2011 the system had a command line interface and a web based GUI was being developed.
DriverThe component which receives the queries. This component implements the notion of session handles and provides execute and fetch APIs modeled on JDBC/ODBC interfaces.
CompilerThe component that parses the query, does semantic analysis on the different query blocks and query expressions and eventually generates an execution plan with the help of the table and partition metadata looked up from the metastore.
MetastoreThe component that stores all the structure information of the various tables and partitions in the warehouse including column and column type information, the serializers and deserializers necessary to read and write data and the corresponding HDFS files where the data is stored.
Execution EngineThe component which executes the execution plan created by the compiler. The plan is a DAG of stages. The execution engine manages the dependencies between these different stages of the plan and executes these stages on the appropriate system components.

2.2 Data Model

类型详情
TablesThese are analogous to Tables in Relational Databases. Tables can be filtered, projected, joined and unioned. Additionally all the data of a table is stored in a directory in HDFS. Hive also supports the notion of external tables wherein a table can be created on prexisting files or directories in HDFS by providing the appropriate location to the table creation DDL. The rows in a table are organized into typed columns similar to Relational Databases.
PartitionsEach Table can have one or more partition keys which determine how the data is stored, for example a table T with a date partition column ds had files with data for a particular date stored in the <table location>/ds=<date> directory in HDFS. Partitions allow the system to prune data to be inspected based on query predicates, for example a query that is interested in rows from T that satisfy the predicate T.ds = '2008-09-01' would only have to look at files in <table location>/ds=2008-09-01/ directory in HDFS.
BucketsData in each partition may in turn be divided into Buckets based on the hash of a column in the table. Each bucket is stored as a file in the partition directory. Bucketing allows the system to efficiently evaluate queries that depend on a sample of data (these are queries that use the SAMPLE clause on the table).

3. 实践应用

3.1 数仓建设

4. 性能优化

介绍如何优化 Hive 的性能

5. 常见问题解答

5.1 常用SQL

场景SQL
连续n天登录
SELECT * FROM test;

6. 总结

总结 Hive 的关键知识点,并提供学习资源和进一步研究方向。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/754590.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Tomcat Session ID---会话保持

简单拓补图 一、负载均衡、反向代理 7-1nginx代理服务器配置 [rootdlnginx ~]#yum install epel-release.noarch -y ###安装额外源[rootdlnginx ~]#yum install nginx -y[rootdlnginx ~]#systemctl start nginx.service[rootdlnginx ~]#systemctl status nginx.service [ro…

Javaweb学习记录(四)分层处理架构-分层解耦

三层架构 程序设计分为下面三层架构&#xff0c;分别为Controller控制层&#xff0c;Service逻辑处理层&#xff0c;Dao数据访问层。这三层各自执行自己所对应的功能&#xff0c;使程序的扩展性和可维护性提高 例如下面我想设计一个分层的程序&#xff0c;实现Controller层&am…

MidJourney 使用指北

官网&#xff1a;docs.midjourney.com 文档&#xff1a;docs.midjourney.com/docs/quick-… PS&#xff1a;魔法需要订阅使用了 准备工作 一、进入 discord官网 二、下载 Discord App 三、注册Discord账号 创建服务器 登录 discord App&#xff0c;点击添加按钮&#xff…

AJAX——综合案例

1 Bootstrap弹框 功能&#xff1a;不离开当前页面&#xff0c;显示单独内容&#xff0c;供用户操作 步骤&#xff1a; 引入bootstrap.css和bootstrap.js准备弹框标签&#xff0c;确认结构通过自定义属性&#xff0c;控制弹框的显示和隐藏 <!DOCTYPE html> <html la…

详解Java常用排序算法(10种,含演示动画)

Java常用的排序算法有以下几种&#xff1a; 冒泡排序&#xff08;Bubble Sort&#xff09;选择排序&#xff08;Selection Sort&#xff09;插入排序&#xff08;Insertion Sort&#xff09;希尔排序&#xff08;Shell Sort&#xff09;归并排序&#xff08;Merge Sort&#x…

Android Studio:你的主机中的软件终止了一个已建立的连接

我不喜欢等人也不喜欢被别人等——赤砂之蝎 一、提出问题 二、分析问题 搜索网上的教程尝试解决 1、任务管理器结束adb进程无用 2、电脑没有开启热点排除热点问题 3、校园网切换到热点 4、项目重新解压打开 5、更换国内镜像源 上述方法全部无法解决问题 分析问题原因在于之前A…

Github 2024-03-18 开源项目周报Top15

根据Github Trendings的统计,本周(2024-03-18统计)共有15个项目上榜。根据开发语言中项目的数量,汇总情况如下: 开发语言项目数量Python项目6TypeScript项目2Go项目2JavaScript项目2非开发语言项目1HTML项目1CSS项目1Rust项目1Dart项目1C++项目1Jupyter Notebook项目1Electr…

JVM中对象创建过程

在JVM中对象的创建&#xff0c;我们从一个new指令开始&#xff1a; 这个过程大概图示如下&#xff1a; 虚拟机收到new指令触发。 类加载检查&#xff1a;如果类没有被类加载器加载&#xff0c;则执行类加载流程&#xff08;将class信息加载到JVM的运行时数据区的过程&#xff…

Stable Diffusion + Segment Anything试用

安装 从continue-revolution/sd-webui-segment-anything安装插件分割模型下载后放到这个位置&#xff1a;${sd-webui}/extension/sd-webui-segment-anything/models/sam下&#xff0c;可以下载3个不同大小的模型&#xff0c;从大到小如下&#xff1a;vit_h is 2.56GB, vit_l i…

Java后端八股----JVM篇

上图中线程1&#xff0c;2如果资源被抢占了&#xff0c;则程序计数器记录一下执行的行号&#xff0c;等到资源就绪后会从记录的行号继续向后执行。 Java8把静态变量以及常量放到了线程的本地内存原空间中(避免放在堆中不可控)。 &#x1f446;图中第二种情况不太容易出现…

Linux docker2--镜像及容器操作-nginx部署示例

一、上一篇已经完成了docker的基础环境搭建&#xff0c;和docker的安装。不清楚的小伙伴可以自己找上一篇看一下。本例以部署nginx为例展示 二、镜像相关 1、切换docker的镜像源为阿里云 命令&#xff1a; sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <&l…

敏捷开发——elementUI/Vue使用/服务器部署

1. 创建vue项目 2. 安装element-ui组件库 npm i -S element-ui或 npm install element-ui3. 在main.js中导入element-ui组件 import ElementUI from element-ui import element-ui/lib/theme-chalk/index.css Vue.use(ElementUI)4. 运行 npm run serve后可以使用 ctrc终止进…

如何选择合适的数据可视化工具?

如果是入门级的数据可视化工具&#xff0c;使用Excel插件就足够了&#xff01; Excel插件&#xff0c;tusimpleBI 是一款 Excel 图表插件&#xff0c;提供超过120项图表功能&#xff0c;帮助用户制作各种 Excel 所没有的高级图表&#xff0c;轻轻松松一键出图。 它能够制作10…

VUE3 组件通信

props 用途&#xff1a;可以实现父子组件、子父组件、甚至兄弟组件通信 父组件 <template><div><Son :money"money"></Son></div> </template><script setup lang"ts"> import Son from ./son.vue import { re…

量子加速超算简介

量子加速超算简介 有用的量子计算的发展是全球政府、企业和学术界的巨大努力。 量子计算的优势可以帮助解决世界上一些与材料模拟、气候建模、风险管理、供应链优化和生物信息学等应用相关的最具挑战性的问题。 要实现量子计算的优势&#xff0c;需要将量子计算机集成到现有的…

容器部署对比:通用容器部署 vs 使用腾讯云容器镜像服务(TCR)部署 Stable Diffusion

目录 引言1 通用容器部署的主要步骤1.1 准备环境1.2 构建 Docker 镜像1.3 上传镜像1.4 部署容器1.5 配置网络1.6 监控和维护 2 使用腾讯云容器镜像服务&#xff08;TCR&#xff09;部署的主要步骤2.1 下载 Stable Diffusion web UI 代码2.2 制作 Docker 镜像2.3 上传镜像到 TCR…

Scala--02--IDEA编写Hello World

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 1.Scala 插件安装1&#xff09;插件离线安装步骤2&#xff09; 插件在线安装&#xff08;推荐可选&#xff09; 2.HelloWorld 案例1&#xff09;打开 IDEA->点击…

Javaweb学习记录(三)请求响应案例

下面为一个请求响应案例&#xff0c;postman发送请求&#xff0c;服务器响应将一个xml文件中的数据通过读取解析&#xff0c;将其用Result类标准的格式返回前端&#xff0c;在前端用json的方式显示 后端Controller代码 1、通过本类的字节码文件得到类加载器并寻找到需要解析的…

Jenkins-pipeline流水线构建完钉钉通知

添加钉钉机器人 在钉钉群设置里添加机器人拿出Webhook地址&#xff0c;设置关键词 Jenkins安装钉钉插件 Dashboard > 系统管理 > 插件管理&#xff0c;搜索构建通知&#xff0c;直接搜索Ding Talk也行 安装DingTalk插件&#xff0c;重启Jenkins 来到Dashboard > 系…

汽车专业翻译应该如何进行呢?

随着全球汽车行业的不断发展&#xff0c;大量的汽车业相关技术资料、产品说明、会议交流、推广分享等都需要进行语言转换&#xff0c;进而促进了汽车翻译业务的需求旺盛。那么&#xff0c;汽车专业翻译应该如何进行呢&#xff0c;北京哪个翻译公司比较好&#xff1f; 业内人士指…