hive 导入hdfs数据

Preceding pen down the article, might want to stretch out appreciation to all the wellbeing teams beginning from cleaning/sterile group to Nurses, Doctors and other who are consistently battling to spare the mankind from continuous Covid-19 pandemic over the globe.

在下一篇文章之前,不妨向从清洁/无菌小组到护士,医生和其他一直在努力使人类免受全球Covid-19大流行的困扰的所有健康团队表示感谢。

The fundamental target of this article is to feature how we can load or import data into Hive tables without explicitly execute the “load” command. Basically, with this approach Data scientists can query or even visualize directly on various data visualization tool for quick investigation in a scenario when raw data is continuously ingested to HDFS based Data lake from the external sources on a consistent schedule. Otherwise, “load” command would be required to execute furthermore for stacking the processed data into Hive’s table. Here we are considering an existing environment with the following components either set up on the Cloud or on-premise.

本文的基本目标是介绍如何在不显式执行“ load”命令的情况下将数据加载或导入到Hive表中。 基本上,使用这种方法,当原始数据以一致的时间表从外部源连续摄取到基于HDFS的Data Lake时,数据科学家可以直接在各种数据可视化工具上进行查询甚至可视化,以进行快速调查。 否则,将需要“ load”命令来进一步执行,以将处理后的数据堆叠到Hive的表中。 在这里,我们正在考虑具有以下组件的现有环境,这些组件在云端或本地设置。

  • Multi-node Cluster where HDFS installed and configured. Hive running on top of HDFS with MySQL database as metastore.已安装和配置HDFS的多节点群集。 Hive在HDFS之上运行,并将MySQL数据库作为metastore。
  • Assuming raw data is getting dumped from multiple sources into HDFS Data lake landing zone by leveraging Kafka, Flume, customized data ingesting tool etc.假设利用Kafka,Flume,定制数据提取工具等将原始数据从多个来源转储到HDFS Data Lake登陆区。
  • From the landing zone, raw data moves to the refining zone in order to clean junk and subsequently into the processing zone where clean data gets processed. Here we are considering that the processed data stored in text files with CSV format.原始数据从着陆区移至精炼区,以清理垃圾,然后移至处理区,在此处理干净数据。 在这里,我们考虑将处理后的数据存储在CSV格式的文本文件中。

Hive input is directory-based which similar to many Hadoop tools. This means, input for an operation is taken as files in a given directory. Using HDFS command, let’s create a directory in the HDFS using “$ hdfs dfs -mkdir <<name of the folder>>. Same can be done using Hadoop administrative UI depending upon user’s HDFS ACL settings. Now move the data files from the processing zone into newly created HDFS folder. As an example, here we are considering simple order data that ingested into the data lake and eventually transformed to consolidated text files with CSV format after cleaning and filtering. Few lines of rows are as follows

Hive输入是基于目录的,类似于许多Hadoop工具。 这意味着,操作的输入将作为给定目录中的文件。 使用HDFS命令,让我们使用“ $ hdfs dfs -mkdir <<文件夹名称>>在HDFS中创建一个目录。 根据用户的HDFS ACL设置,可以使用Hadoop管理UI进行相同的操作。 现在,将数据文件从处理区域移到新创建的HDFS文件夹中。 例如,这里我们考虑的是简单的订单数据,这些数据被导入到数据湖中,并在清洗和过滤后最终转换为CSV格式的合并文本文件。 行的几行如下

Next step is to create an external table in Hive by using the following command where the location is the path of HDFS directory that created on the previous step. here is the command we could use to create the external table using Hive CLI. The LOCATION statement in the command tells Hive where to find the input files.

下一步是使用以下命令在Hive中创建外部表,其中位置是在上一步中创建的HDFS目录的路径。 这是我们可以用来使用Hive CLI创建外部表的命令。 命令中的LOCATION语句告诉Hive在哪里找到输入文件。

If the command worked, an OK will be printed and upon executing Hive query, Hive engine fetches the data internally from these input text files by leveraging processing engine Map Reducer or other like Spark, Tez etc. Ideally, Spark or Tez can be configured as a processing engine in hive-site.xml in order to improve the data processing speed for a huge volume of input files.

如果该命令有效,则将打印OK,并且在执行Hive查询时,Hive引擎可利用处理引擎Map Reducer或其他诸如Spark,Tez等从这些输入文本文件内部获取数据。理想情况下,Spark或Tez可配置为hive-site.xml中的处理引擎,以提高大量输入文件的数据处理速度。

Once the table creation is successful, we can cross-check it on “ metastore” schema in the MySQL database. To perform that, log in to MySQL CLI which might be running on a different node in the cluster and then connect to the “metastore” database as well as pulls records from “TBLS” table. This displays the created Hive table information.

一旦表创建成功,我们就可以在MySQL数据库的“ metastore”模式中对其进行交叉检查。 要执行此操作,请登录到可能正在集群中其他节点上运行MySQL CLI,然后连接到“元存储”数据库并从“ TBLS”表中提取记录。 这将显示创建的Hive表信息。

The import can be verified through the Hive’s CLI by listing the first few rows in the table.

可以通过Hive的CLI列出表中的前几行来验证导入。

hive> Select * from OrderData;

蜂巢>从OrderData中选择*;

Additionally, “ analyze compute statistics “ command could be executed in Hive CLI to view the detail information of jobs that runs on that table.

另外,可以在Hive CLI中执行“ 分析计算统计信息 ”命令,以查看在该表上运行的作业的详细信息。

The primary advantage with this approach is, data can be query, analyze etc within a minimum span of time without additionally perform explicit data loading operation. Also helps the Data scientists to check the quality of data before running their machine learning jobs on the data lake or cluster. You could read here how to install and configure Apache Hive on multi-node Hadoop cluster with MySQL as Metastore.

这种方法的主要优点是,可以在最短的时间范围内查询,分析数据,而无需另外执行显式的数据加载操作。 还可以帮助数据科学家在数据湖或集群上运行其机器学习作业之前检查数据质量。 您可以在此处阅读如何在以MySQL作为Metastore的多节点Hadoop集群上安装和配置Apache Hive。

Written byGautam Goswami

Gautam Goswami 撰写

Enthusiastic about learning and sharing knowledge on Big Data and related headways. Play at the intersection of innovation, music and workmanship.

热衷于学习和共享有关大数据和相关进展的知识。 在创新,音乐和Craft.io的交汇处演奏。

Originally published at https://dataview.in on August 4, 2020.

最初于 2020年8月4日 https://dataview.in 发布

翻译自: https://medium.com/@gautambangalore/an-alternative-way-of-loading-or-importing-data-into-hive-tables-running-on-top-of-hdfs-based-data-d3eee419eb46

hive 导入hdfs数据


http://www.taodudu.cc/news/show-994839.html

相关文章:

  • 大数据业务学习笔记_学习业务成为一名出色的数据科学家
  • python 开发api_使用FastAPI和Python快速开发高性能API
  • Power BI:M与DAX以及度量与计算列
  • 梯度下降法优化目标函数_如何通过3个简单的步骤区分梯度下降目标函数
  • seaborn 子图_Seaborn FacetGrid:进一步完善子图
  • 异常检测时间序列_时间序列的无监督异常检测
  • 存款惊人_如何使您的图快速美丽惊人
  • 网络传播动力学_通过简单的规则传播动力
  • 开源软件 安全风险_3开源安全风险及其解决方法
  • 自助分析_为什么自助服务分析真的不是一回事
  • 错误录入 算法_如何使用验证错误率确定算法输出之间的关系
  • pytorch回归_PyTorch:用岭回归检查泰坦尼克号下沉
  • iris数据集 测试集_IRIS数据集的探索性数据分析
  • flink 检查点_Flink检查点和恢复
  • python初学者_初学者使用Python的完整介绍
  • snowflake 数据库_Snowflake数据分析教程
  • 高级Python:定义类时要应用的9种最佳做法
  • 医疗大数据处理流程_我们需要数据来大规模改善医疗流程
  • python对象引用计数器_在Python中借助计数器对象对项目进行计数
  • 数字图像处理 python_5使用Python处理数字的高级操作
  • 软件测试框架课程考试_那考试准备课程值得吗?
  • 为什么在Python代码中需要装饰器
  • 数据清理最终实现了自动化
  • Python气流介绍
  • 正确的词典访问方式
  • 废水处理计算书 excel_废水监测数据是匿名的吗?
  • 数据科学还是计算机科学_您应该拥有数据科学博客的3个原因
  • 熊猫分发_流利的熊猫
  • python记录日志_5分钟内解释日志记录—使用Python演练
  • p值 t值 统计_非统计师的P值

hive 导入hdfs数据_将数据加载或导入运行在基于HDFS的数据湖之上的Hive表中的另一种方法。相关推荐

  1. python读取grib2数据_用Python加载grib2文件

    我正在尝试加载grib2文件,我不确定文件是问题还是我试图加载它们的方式.在 这些文件是从here中提取的(我不是从这里下载的,而是从同事的文件夹中复制的,所以它们应该是相同的文件-,但是我也尝试插入 ...

  2. aws rds恢复数据库_使用AWS Glue将数据从AWS S3加载到AWS RDS SQL Server数据库

    aws rds恢复数据库 This article explains how to develop ETL (Extract Transform Load) jobs using AWS Glue t ...

  3. Pandas将dataframe保存为pickle文件并加载保存后的pickle文件查看dataframe数据实战

    Pandas将dataframe保存为pickle文件并加载保存后的pickle文件查看dataframe数据实战 目录 Pandas将dataframe保存为pickle文件并加载保存后的pickl ...

  4. .ajax显示加载动画,jQuery Ajax 加载数据时异步显示加载动画

    ajax加载后台数据就不说的那么细了. 看下面代码首先前台上放置代码 在js脚本文件中首先把这个图片动画隐藏 代码如下 $(document).ready(function () { $(" ...

  5. 一个简单的页面加载管理类(包含加载中,加载失败,数据为空,加载成功)

    在最近公布的比赛框架中,发现了页面加载管理类,觉得挺有用的,所以做个简单的笔记. 什么是页面加载管理类呢?(大佬可直接跳过翻看实现过程) 如果能有这个问题,那么很好,哈哈哈,你和我一样,刚开始都挺疑惑 ...

  6. QGIS离线GeoJSON数据,使用Cesium加载并根据楼层高度拉伸(weixin公众号【图说GIS】)

    前言 往往好多事情是需求推动的,正好一个网友在群里问到"怎么让Cesium加载GeoJSON的白膜并贴在地形上?",联系到他,要了他的数据,完成了代码并测试通过.正好出差,而且一个 ...

  7. Android Listview滑动时不加载数据,停下来时加载数据,让App更优

    转载:http://blog.csdn.net/yy1300326388/article/details/45153813 数据源配置(Adapter) package com.zhengsongla ...

  8. vue 关闭 窗口后清除所有数据_Vue首屏加载速度优化,我用这几个技巧提升80%以上...

    前端潮咖 点击上面蓝字,关注我们! 关注 关注前端潮咖,每日精选好文 作者:谁动了我的橘子 来源:https://juejin.im/post/5edf5b22e51d4578975a7024 在Vu ...

  9. 星图地球数据云,便捷加载各类在线地图服务的又一神器

    星图地球目前发布了一系列的产品,对我来说比较感兴趣的是星图地球数据云(GEOVIS Earth Datacloud)这款地球大数据产品.今天,我就带大家以来深入在线体验一下这款产品. 01 在线体验 ...

最新文章

  1. Markdown矩阵、表格和数学公式
  2. spring BeanPostProcessor,BeanFactoryPostProcessor作用
  3. 计算机网络(10)-----TCP的拥塞控制
  4. html5 接东西游戏,html5手机触屏接红包小游戏代码
  5. 三分钟学会.NET Core Jwt 策略授权认证
  6. 深度学习之 hard negative mining (难例挖掘)
  7. 澳大利亚短租市场火爆 “祖母房”成为热搜
  8. 商品二因素、劳动二重性
  9. 火车站(codevs 2287)
  10. ie8 html5上传,兼容IE8的file单文件上传(jquery.form+formdata)
  11. 小米线刷工具 MiFlash 提示长度不能小于 0 参数名 length,无法读取设备解决方法
  12. 2022-05 - 英语语法 - 16种时态终极详解
  13. 常用求导公式 高阶导公式 莱布尼兹公式
  14. 验收测试的名词解释_验收测试工作流程及准则
  15. 基于Spring Boot的农家乐点餐系统
  16. 大华技术股份有限公司测开笔试题分享
  17. 开源协议、开源贡献协议与OpenHarmony
  18. Overload resolution ambiguity. All these functions match. kotlin 开发问题日常记录
  19. 用dd实现linux硬盘备份
  20. 第1篇:Python 环境搭建

热门文章

  1. [Linux]CRC校验
  2. php一行多个商品,【后端开发】php一行展示多个商品怎么实现
  3. 【kali】kali换了root权限后无法打开firefox浏览器
  4. C++四种强制类型转换
  5. Unity(一)必然事件
  6. C++经典问题:如果对象A中有对象成员B,对象B没有默认构造函数,那么对象A必须在初始化列表中初始化对象B?
  7. java基础教程第三版耿祥义,后台开发JAVA岗
  8. 2-2 用Python爬取银河演员网上的演员参演电影的信息进行抓取
  9. STM8L芯片启动时钟分频问题及发现(转)
  10. 谈谈用SQLite和FMDB而不用Core Data