Kylin知识点介绍
Kylin
is an open source Distributed Analytics Engine from eBay Inc。that provides SQL interface and multi-dimensional analysis (OLAP) on Hadoop supporting extremely large datasets
亮点
1.Compression and Encoding Support
2.Incremental Refresh of Cubes
3.Approximate Query Capability for distinct Count (HyperLogLog)
4.Leverage HBase Coprocessor for query latency
5.Job Management and Monitoring
6.Easy Web interface to manage, build, monitor and query cubes
7.Security capability to set ACL at Cube/Project Level
8.Support LDAP Integration
HyperLogLog:
从事统计数据。统计一组不同元素且数量很大的数据集时,是一个挑战。
Hyper LogLog计数器就是估算Nmax为基数的数据集仅需使用loglog(Nmax)+O(1) bits就可以。
如线性计数器的Hyper LogLog计数器允许设计人员指定所需的精度值,在Hyper LogLog的情况下,这是通过定义所需的相对标准差和预期要计数的最大基数。
大部分计数器通过一个输入数据流M,并应用一个哈希函数设置h(M)来工作。这将产生一个S = h(M) of {0,1}^∞字符串的可观测结果。通过分割哈希输入流成m个子字符串,并对每个子输入流保持m的值可观测 ,这就是相当一个新Hyper LogLog(一个子m就是一个新的Hyper LogLog)。
利用额外的观测值的平均值,产生一个计数器,其精度随着m的增长而提高,这只需要对输入集合中的每个元素执行几步操作就可以完成。
其结果是,这个计数器可以仅使用1.5 kb的空间计算精度为2%的十亿个不同的数据元素。与执行 HashSet所需的120 兆字节进行比较,这种算法的效率很明显。
ACL
访问控制列表(Access Control List,ACL) 是路由器和交换机接口的指令列表,用来控制端口进出的数据包。ACL适用于所有的被路由协议,如IP、IPX、AppleTalk等。
– Hive
– Stinger without Tez
• SQL processed by a MPP Engine
– Impala
– Drill
– Presto
– Spark + Shark
• SQL process by a existing SQL Engine + HDFS
– EMC Greenplum (postgres)
– Taobao Garude (mysql)
• OLAP on Hadoop in other Companies
– Adobe: HBase Cube
– LinkedIn: Avatara
– Salesforce.com: Phoenix
why do we Build Kylin
• Why existing SQL-on-Hadoop solutions fall short?
The existing SQL-on-Hadoop needs to scan partial or whole data set to answer a user query. Moreover, table join may trigger the huge data transfer across host. Due to large scan range and network traffic latency, many queries are very slow (minute+latency).
• What is MOLAP/ROLAP?
– MOLAP (Multi-dimensional OLAP) is to pre-compute data along different dimensions of interest and store resultant values in the cube. MOLAP is much faster but is inflexible. Kylin is more like MOLAP.
– ROLAP (Relational-OLAP) is to use star or snow-flake schema to do runtime aggregation. ROLAP is flexible but much slower. All existing SQL-on-Hadoop is kind of ROLAP.
• How does Kylin support ROLAP/MOLAP?
Kylin builds data cube (MOLAP) from hive table (ROLAP) according to the metadata definition.
– If the query can be fulfilled by data cube, Kylin will route the query to data cube that is MOLAP.
– If the query can’t be fulfilled by data cube, Kylin will route the query to hive table that is ROLAP.
– Basically, you can think Kylin as HOLAP(Hybrid OLAP) on top of MOLAP and ROLAP.
体系结构:

• Hive
– Pre-join star schema during cube building
• MapReduce
– Pre-aggregation metrics during cube building
• HDFS
– Store intermediated files during cube building.
• HBase
– Store data cube.
– Serve query on data cube.
– Coprocessor is used for query processing.
Kylin查询:
Kylin support ANSI-SQL: projection, filter, join, aggregation, groups and sub-query

分析查询分类

组件设计

Cube设计

Cube元数据
• Dimension
– Normal
– Mandatory
– Hierarchy
– Derived
•Measure
– Sum
– Count
– Max
– Min
– Average
– Distinct Count (based on HyperLogLog)
如何build cube
1.key-value

2.job流

3.存储Cube:HBase模式

4.Cube查询:查询引擎
• Query engine: is based on Apache Calcite (http://incubator.apache.org/projects/calcite.html)
• Apache Calcite: is an extensible open source SQL engine that is also used in Stinger/Drill/Cascading.
• Metadata SPI
– Provide table schema from kylin metadata
• Optimize Rule
– Translate the logic operator into kylin operator
• Relational Operator
– Find right cube
– Translate SQL into storage engine api call
– Generate physical execute plan by linq4j java implementation
• Result Enumerator
– Translate storage engine result into java implementation result.
• SQL Function
– Add HyperLogLog for distinct count
– Implement date time related functions (i.e. Quarter)

解释计划:

存储引擎:
• Provide cube query for query engine
– Common iterator interface for storage engine
– Isolate query engine from underline storage
• Translate cube query into HBase table scan
– Groups à Cuboid ID
– Filters -> Scan Range (Row Key)
– Aggregations -> Measure Columns (Row Values)
• Scan HBase table and translate HBase result into cube result
– HBase Result (key + value) -> Cube Result (dimensions + measures)
优化Cube:
• “Curse of dimensionality”: N dimension cube has 2N cuboid
– Full Cube vs. Partial Cube
Full Cube
– Pre-aggregate all dimension combinations
– “Curse of dimensionality”: N dimension cube has 2N cuboid.
Partial Cube
– To avoid dimension explosion, we divide the dimensions into different aggregation groups
• 2N+M+L à 2N + 2M + 2L
– For cube with 30 dimensions, if we divide these dimensions into 3 group, the cuboid number will reduce from 1 Billion to 3 Thousands
• 230 à 210 + 210 + 210
– Tradeoff between online aggregation and offline pre-aggregation

• Hugh data volume
– Dictionary Encoding
• Data cube has lost of duplicated dimension values
• Dictionary maps dimension values into IDs that will reduce the memory and storage footprint.
• Dictionary is based on Trie

– Incremental Building

• Slow Table Scan – TopN Query on High Cardinality Dimension
– Bitmap inverted index
– Time range partition
– Separate high cardinality dimension from low cardinality dimension
– In-memory +parallel scan: block cache + endpoint coprocessor

Kylin里程碑:

相关资源:
• Web Site
– http://kylin.io
• Google Groups
– https://groups.google.com/forum/#!forum/kylin-olap
• Twitter
– @KylinOLAP
• Source Code
– https://github.com/KylinOLAP/Kylin
Kylin知识点介绍的更多相关文章
- Kylin web界面 知识点介绍
Big Data Era: 1.More and more data becoming available on Hadoop2.Limitations in existing Business ...
- c语言学习之基础知识点介绍(十):数组
本节主要介绍数组. 一.数组 /* 数组:一个变量可以存n个变量. 语法:类型 数组名[长度(正整数)]; 例如:int score[5];//定义了一个int类型的数组,长度为5,可以保存5个数据. ...
- c语言学习之基础知识点介绍(七):循环结构
本节主要介绍循环结构 一.while循环 /* 语法: while(表达式){ //循环体; } 注意:循环变量.循环条件和循环控制语句三者缺一不可. 例如: */ ; //循环变量 ){ //循环条 ...
- c语言学习之基础知识点介绍(三):scanf函数
本节继续介绍c语言的基础知识点. scanf函数:用来接收用户输入的数据. 语法:scanf("格式化控制符",地址列表); 取地址要用到取地址符:&(shift+7) 例 ...
- c语言学习之基础知识点介绍(二):格式化控制符和变量的补充
上节简单介绍了c语言中的一些基础知识点,本节将对之前介绍的不够详细的知识点进行补充. 格式化控制符的消息介绍: %d的其他控制符: 1.%md:m代表这个整数位占用多少位,m是一个整数.实际数字不足的 ...
- oc语言学习之基础知识点介绍(五):OC进阶
一.点语法介绍 /* 以前封装后,要给属性赋值,必须调用方法 这样做,有两个缺点: 1.代码量多,调用方法要写的东西多. 2.看起来并不像是给属性赋值,也不像取值. 我们用点语法就可以更好的解决! 点 ...
- oc语言学习之基础知识点介绍(四):方法的重写、多态以及self、super的介绍
一.方法重写 /* 重写:当子类继承了父类的方法时,如果觉得父类的方法不适合,那么可以对这个方法进行重新实现,那么这个就重写. 注意:也就是说,一定只能发生在父类和子类关系中. 然后是子类重新实现父类 ...
- oc语言学习之基础知识点介绍(二):类和对象的进一步介绍
一.类.对象在内存中的存储 /* 内存分区: 栈:局部变量 堆:程序员自己写代码申请开辟的 程序员自己维护,编译器现在帮我们自动优化了,它在合适的给我们加上了释放空间的语句,所以我们现在写的对象不会造 ...
- c语言学习之基础知识点介绍(二十):预处理指令
一.预处理指令的介绍 预处理命令:在编译之前触发的一系列操作(命令)就叫预处理命令. 特点:以#开头,不要加分号. #include: 文件包含指令 把指定文件的内容复制到相应的位置 #define: ...
随机推荐
- hi3516a arm-hisiv300-linux-gcc jrtplib交叉编译
1.进入JThread-1.2.1文件夹 2../configure --prefix=/home/suxuandong/Documents/qth264/hi3516/jrtpjthreadhisi ...
- Linux基础命令---文本过滤coi
col 过滤掉影响阅读的控制字符,使用重定向符把说明手册的内容输出到文本文件时,控制字符就成乱码.col指令可以过滤掉控制字符,使文本可读.col从标砖输入读取内容,输出到标准输出.col在读取字符时 ...
- Python进阶【第九篇】装饰器
什么是装饰器 装饰器本身就是函数,并且为其他函数添加附加功能 装饰器的原则:1.不修改被装饰对象的源代码 2.不修改被装饰对象的调用方式装饰器=高阶函数+函数嵌套+闭包 # res=timmer(t ...
- 【题解】Luogu P3740 [HAOI2014]贴海报
woc,今天已经是day -1了 再写一颗珂朵莉树来++rp吧 否则就要AFO了qaq 这有可能是我最后一篇题解/博客qaq 原题传送门:P3740 [HAOI2014]贴海报 考前刷水题到底是对还是 ...
- python框架相关问题
面试其他篇 目录: 1.1
- mvc 前端校验
首先解决 Ajax.BeginFor异步提交表单,给表单添加样式的问题.不能直接用class属性,网上找了很多都是用ClassName,经过测试不管用,看源代码发现生成的是ClassName而非cla ...
- php 操作 mysql 数据库常用方法集合
参考: https://www.runoob.com/php/php-pdo.html https://www.cnblogs.com/feng18/p/6523646.html https://bl ...
- 《学习OpenCV3》第14章课后习题
1.在一条含有 N 个点的封闭轮廓中,我们可以通过比较每个点与其它点的距离,找出最外层的点.(这个翻译有问题,而且这个问题是实际问题) a.这样一个算法的复杂度是多少? b.怎样用更快的速度完成这个任 ...
- centos7.2 python2.7升级python3.6退格键不能用
yum install readline-devel ./configure --prefix=/usr/py/py3.6 (目录是自定义的这个根据实际情况来) make && ...
- Python 用pygame模块播放MP3
安装pygame(这个是python3,32位的) pip安装这个whl文件 装完就直接跑代码啦,很短的 import time import pygame file=r'C:\Users\chan\ ...