Hive

Hive Utf-8 Encoding number of characters supported?

☆樱花仙子☆ 提交于 2020-12-29 12:07:55
问题 Hi actually the problem is as follows the data i want to insert in hive table has latin words and its in utf-8 encoded format. But still hive does not display it properly. Actual Data:- Data Inserted in hive I changed the encoding of the table to utf-8 as well still same issue below are the hive DDL and commands CREATE TABLE IF NOT EXISTS test6 ( CONTACT_RECORD_ID string, ACCOUNT string, CUST string, NUMBER string, NUMBER1 string, NUMBER2 string, NUMBER3 string, NUMBER4 string, NUMBER5 string

Hive: Sum over a specified group (HiveQL)

五迷三道 提交于 2020-12-28 07:45:40
问题 I have a table: key product_code cost 1 UK 20 1 US 10 1 EU 5 2 UK 3 2 EU 6 I would like to find the sum of all products for each group of "key" and append to each row. For example for key = 1, find the sum of costs of all products (20+10+5=35) and then append result to all rows which correspond to the key = 1. So end result: key product_code cost total_costs 1 UK 20 35 1 US 10 35 1 EU 5 35 2 UK 3 9 2 EU 6 9 I would prefer to do this without using a sub-join as this would be inefficient. My

Kylin 大数据下的OLAP解决方案和行业典型应用

依然范特西╮ 提交于 2020-12-28 00:30:28
最近工作中应用到了 Kylin,因此调研了 Kylin的原理和行业应用。本文参考了官网和众多其他公司中 Kylin的应用案例,文末给出了出处,希望对大家有帮助。 Apache Kylin的原理和技术架构 Apache Kylin 从数据仓库中最常用的Hive中读取源数据,使用 MapReduce作为Cube构建的引擎,并把预计算结果保存在HBase中,对外暴露Rest API/JDBC/ODBC的查询接口。 Apache Kylin系统主要可以分为在线查询和离线构建两部分,具体架构图如下: Apache Kylin在百度地图的实践 对于 Apache Kylin 在实际生产环境中的应用,在国内,百度地图数据智能组是最早的一批实践者之一。目前,百度地图大数据 OLAP 多维分析平台承载百度地图内部多个基于 Apache Kylin 引擎的亿级多维分析查询项目,共计约 80 个 cube,平均半年时间的历史数据,共计约 50 亿行的源数据规模,单表最大数据量为 20 亿 + 条源数据,满足大时间区间、复杂条件过滤、多维汇总聚合的单条 SQL 查询毫秒级响应,较为高效地解决了亿级大数据交互查询的性能需求。 Kylin 有效解决的痛点问题: 痛点一:百亿级海量数据多维指标动态计算耗时问题,Apache Kylin 通过预计算生成 Cube 结果数据集并存储到 HBase 的方式解决。

[亲身实践]pyspark读取hive中的表的两种方式

☆樱花仙子☆ 提交于 2020-12-26 15:06:06
1.window上无法连接到hive,linux上能连接到hive(推荐 法二 ) 法一 (1)把/opt/soft/hive110/conf/hive-site.xml复制到/opt/soft/spark234/conf/hive-site.xml hive-site.xml不用改变任何东西 (2)把mysql的驱动包复制到/opt/soft/spark234/jar下面 (3)开始启动pyspark [root@joy sbin] # ./start-all.sh starting org . apache . spark . deploy . master . Master , logging to / opt / soft / spark234 / logs / spark - root - org . apache . spark . deploy . master . Master - 1 - joy . out localhost: starting org . apache . spark . deploy . worker . Worker , logging to / opt / soft / spark234 / logs / spark - root - org . apache . spark . deploy . worker . Worker - 1

Hive external table optimal partition size

情到浓时终转凉″ 提交于 2020-12-26 03:22:50
问题 What is the optimal size for external table partition? I am planning to partition table by year/month/day and we are getting about 2GB of data daily. 回答1: Optimal table partitioning is such that matching to your table usage scenario. Partitioning should be chosen based on: how the data is being queried (if you need to work mostly with daily data then partition by date). how the data is being loaded (parallel threads should load their own partitions, not overlapped) 2Gb is not too much even

Hive external table optimal partition size

纵饮孤独 提交于 2020-12-26 03:20:34
问题 What is the optimal size for external table partition? I am planning to partition table by year/month/day and we are getting about 2GB of data daily. 回答1: Optimal table partitioning is such that matching to your table usage scenario. Partitioning should be chosen based on: how the data is being queried (if you need to work mostly with daily data then partition by date). how the data is being loaded (parallel threads should load their own partitions, not overlapped) 2Gb is not too much even

Hive之执行计划分析(explain)

我只是一个虾纸丫 提交于 2020-12-25 20:04:32
Hive是通过把sql转换成对应mapreduce程序,然后提交到Hadoop上执行,查看具体的执行计划可以通过执行explain sql知晓 一条sql会被转化成由多个阶段组成的步骤,每个步骤有执行顺序和依赖关系,可以称之为有向无环图(DAG:Directed Acyclic Graph) 这些步骤可能包含:元数据的操作,文件系统的操作,map/reduce计算等 语法格式: EXPLAIN [EXTENDED|DEPENDENCY|AUTHORIZATION|LOCKS|VECTORIZATION] query explain输出内容包括: 抽象语法树 执行计划不同阶段的依赖关系 各个阶段的描述 extended输出更加详细的信息 denpendency输出依赖的数据源 authorization输出执行sql授权信息 locks 输出锁情况 vectorization相关 Adds detail to the EXPLAIN output showing why Map and Reduce work is not vectorized. Syntax: EXPLAIN VECTORIZATION [ONLY] [SUMMARY|OPERATOR|EXPRESSION|DETAIL] ONLY option suppresses most non-vectorization

从HiveQL到MapReduce job过程简析

旧时模样 提交于 2020-12-25 02:42:07
一、简述 HiveQL是一种声明式语言,用户提交查询,而Hive会将其转换成MapReduce job,如下图。一般来说大部分时间可以无视这个执行过程的内部逻辑,但是如果能了解这些底层实现细节,在调优的时候就会更得心应手。 二、过程 将HiveQL转化为MapReduce任务,整个编译过程主要分为六个阶段: Antlr定义SQL的语法规则,完成SQL词法,语法解析,将SQL转化为抽象语法树AST; 遍历AST,抽象出查询的基本组成单元查询块QueryBlock; 遍历QueryBlock,将QueryBlock转化为逻辑查询计划OperatorTree; 逻辑层优化器进行OperatorTree变换,合并不必要的ReduceSinkOperator,减少shuffle数据量; 遍历OperatorTree,翻译为MapReduce任务; 物理层优化器进行MapReduce任务的变换,生成最终的执行计划。 1. 将SQL转为AST (1) ANTLR (Another Tool for Language Recognition) 是一个语法分析器( Parser ),可以用来构造领域语言。它允许我们定义识别字符流的词法规则和用于解释Token流的语法分析规则,然后,ANTLR将根据用户提供的语法文件自动生成相应的词法/语法分析器。用户可以利用他们将输入的文本进行编译,并转换成其他形式

数据中台全景架构及模块解析!一文入门中台架构师!

本秂侑毒 提交于 2020-12-24 01:05:05
回顾一下,第一篇文章 大白话 六问数据中台!你想知道的都在这了! 。把数据中台是什么?为什么?有什么价值?说的明明白白。 数据中台是企业级能力复用平台,目标是让数据持续用起来,通过数据中台提供的工具、方法和运行机制,把数据变为一种服务能力,让数据更方便地被业务所使用 。 今天就来点实际干货,把企业真实数据平台架构分享给您!相信看完这篇文章,你会真正对数据中台有一个全景的认识与理解,从抽象过度到具体。无图无真相,我赶紧po一张数据中台总体架构图: 数据中台是在底层存储计算平台与上层的数据应用之间的一整套体系,屏蔽掉底层存储平台的计算技术复杂性,降低对技术人才的需求,可以让数据的使用成本更低。如果用三句话来概括数据中台的组成架构,那么一定是: 通过数据中台的数据汇聚、数据开发模块建立企业数据资产 。 通过资产管理与治理、数据服务把数据资产变为数据服务能力,服务于企业业务 。 数据安全体系、数据运营体系保障数据中台可以长期健康、持续运转 。 现在您已经知道了,数据中台离不开这几个模块: 数据汇聚、数据开发、资产管理、数据安全、数据服务 。那么赶紧跟上我的脚步潜入内部去一探究竟吧。 数据汇聚 数据汇聚,首先必然要有数据来源,有了数据来源之后,需要确定采集工具,有了采集工具之后你还要确定存储位置。 数据来源 数据是数据中台的核心,所以数据汇聚无疑是数据中台的入口。企业中的数据来源极其多

hadoop之hdfs命令详解

若如初见. 提交于 2020-12-22 07:15:07
本篇主要对hadoop命令和hdfs命令进行阐述,yarn命令会在之后的文章中体现 hadoop fs命令可以用于其他文件系统,不止是hdfs文件系统内,也就是说该命令的使用范围更广可以用于HDFS、Local FS等不同的文件系统。而hdfs dfs命令只用于HDFS文件系统; 一、hadoop命令 使用语法:hadoop [--config confdir] COMMAND #其中config用来覆盖默认的配置 ##command #子命令 fs run a generic filesystem user client version print the version jar <jar> run a jar file checknative [ -a|- h] check native hadoop and compression libraries availability distcp <srcurl> <desturl> copy file or directories recursively archive -archiveName NAME -p <parent path> <src>* <dest> create a hadoop archive classpath prints the class path needed to get the