{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

Presto技术内幕

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

Presto技术内幕

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

《Presto技术内幕》由浅入深地详细介绍了Presto 的安装过程、内部运行原理机制、功能特性、性能优化方法,以及在应用过程中常见的问题及解决方案等,同时详细介绍了JD-Presto 版本的许多新功能及其适用的业务场景,这些功能的成功研发,使得JD-Presto 版本不仅仅可用于离线大数据分析计算来提升性能,还可用于多种数据源混合进行实时大数据分析计算,使一些使用其他大数据技术不能解决的业务场景有了一个全新有效的解决方案。

Content Description

Presto是专门为大数据实时查询计算而设计和开发的产品。由于Presto是基于Java语言开发的,因此,对使用者和开发者而言,Presto极易学习、使用并针对特定的业务场景进行改造开发和性能优化。无论是对多数据源支持,还是高性能、易用性、可扩展性等方面, Presto都是大数据实时查询计算产品中的佼佼者。

《Presto技术内幕》按照由浅入深的顺序对Presto进行了全方位的细致讲解,具体内容包括Presto概述、 Presto安装与部署、 Presto RESTful框架解析、提交查询、生成查询执行计划、查询调度、查询执行、队列、System Connector、 Hive Connector、 Kafka Connector、 Connector开发、 Functions开发、 JD-Presto功能改造、 Presto性能调优、 Presto应用场景。


Author Description

翁志:现任京东首席技术顾问,信息安全部负责人,硅谷研发中心负责人,主要负责京东的技术创新,信息安全以及对外技术交流合作等,兼任全国信息安全标准化技术委员会委员。拥有近20年IT技术开发经验,拥有十余项国内外专利。2013年加入京东,领导京东大数据开源计算框架Presto荣获“2015COPU开源优秀项目奖”,本人获“中国开源杰出人物”称号。

机构负责人-戴东东:时任京东数据库管理部负责人,负责数据库、大数据等新技术研究工作,拥有近15年IT技术研发及团队管理经验,侧重于海量数据库、大数据、机器学习等技术领域的研究。2012年加入京东,组建并带领JD-Presto研发团队荣获多个国内外奖项。

高级架构师-吕信:Presto中国社区创建者与管理者,主要从事Hadoop、JD-Presto大数据开源产品及京东数据云的研发与架构设计,具有丰富的大数据解决方案及大数据公有云解决方案的设计及开发经验。

架构师-郭李明:2012年入职京东,一直从事与大数据分布式架构相关的技术研究,参与并主导了Presto京东开源版本的核心功能开发,致力于大数据计算的解决方案研究。

高级工程师-袁安峰:擅长Presto性能调优与Bug修复,对Presto的SQL优化器有深入研究, 同时一直致力于对Presto底层实现原理的研究和探索。负责CSDN极客社区Presto板块维护,热衷于分享研究Presto技术原理的文章以及对Presto使用的心得和体会。

高级工程师-孔云龙:对HDFS、MapReduce、Hive等Hadoop生态系统中的技术有比较深入研究,在分布式查询引擎Presto和分布式消息系统Kafka的功能改造和优化方面积累了丰富的经验。目前正在京东公有云部门从事数据计算服务相关研发工作。

Catalogue

第一部分 基础篇

第 1 章 Presto概述2

1.1 Presto 背景及发展2

1.2 Presto 特点2

1.3 基本概念3

1.3.1 Presto 服务进程3

1.3.2 Presto 模型4

1.3.3 Presto 查询执行模型 5

1.4 Presto 整体架构9

1.4.1 硬件架构9

1.4.2 软件架构9

1.5 小结11

第 2 章 Presto 安装与部署12

2.1 环境说明 12

2.2 准备工作13

2.2.1 建立 SSH 信任关系13

2.2.2 安装 Java 17

2.2.3 安装 Maven 17

2.2.4 安装 Hive 18

2.3 源码编译21

2.3.1 下载源码 21

2.3.2 源码结构说明 22

2.3.3 编译 26

2.4 部署 30

2.4.1 服务部署 30

2.4.2 客户端部署 38

2.4.3 JDBC 使用 40

2.5 小结 42

第二部分 核心设计篇

第 3 章 Presto RESTful 框架解析 44

3.1 Statement 服务接口 44

3.2 Query 服务接口 47

3.3 Stage 服务接口48

3.4 Task 服务接口49

3.5 小结 52

第 4 章 提交查询 53

4.1 提交查询的步骤 53

4.2 源码解析 53

4.3 提交查询的流程 60

4.4 小结 61

第 5 章 生成查询执行计划 62

5.1 基本概念 63

5.1.1 Node 63

5.1.2 Metadata API 67

5.2 词法与语法分析 68

5.2.1 语法规则 69

5.2.2 词法分析 69

5.2.3 语法分析 71

5.3 获取 QueryExecution 72

5.3.1 获取 QueryExecutionFactory 72

5.3.2 创建 QueryExecution 73

5.3.3 启动 QueryExecution 74

5.4 语义分析 77

5.4.1 Statement 分析 77

5.4.2 Relation 分析84

5.4.3 表达式分析 91

5.5 执行计划生成91

5.5.1 执行计划节点 91

5.5.2 SQL 执行计划93

5.5.3 Relation 执行计划95

5.5.4 Query 执行计划 99

5.6 执行计划优化102

5.6.1 ImplementSampleAsFilter 102

5.6.2 CanonicalizeExpressions 102

5.6.3 SimplifyExpressions 102

5.6.4 UnaliasSymbolReferences 103

5.6.5 PruneRedundantProjections 103

5.6.6 SetFlatteningOptimizer 103

5.6.7 LimitPushDown 104

5.6.8 PredicatePushDown 104

5.6.9 MergeProjections 104

5.6.10 ProjectionPushDown 104

5.6.11 IndexJoinOptimizer105

5.6.12 CountConstantOptimizer 105

5.6.13 WindowFilterPushDown 105

5.6.14 HashGenerationOptimizer 105

5.6.15 PruneUnreferencedOutputs 106

5.6.16 MetadataQueryOptimizer 106

5.6.17 SingleDistinctOptimizer 106

5.6.18 BeginTableWrite 106

5.6.19 AddExchanges 107

5.6.20 PickLayout 107

5.7 执行计划分段107

5.7.1 Source 107

5.7.2 Fixed 107

5.7.3 Single 107

5.7.4 Coordinator_only 107

5.8 示例108

5.8.1 Count 执行计划108

5.8.2 Join 执行计划108

5.9 小结110

第 6 章 查询调度 111

6.1 生成调度执行器 111

6.2 查询调度过程 113

6.2.1 NodeManager 114

6.2.2 NodeSelector 115

6.3 小结 118

第 7 章 查询执行 119

7.1 查询执行逻辑 120

7.2 Task 调度120

7.2.1 Source Task 调度120

7.2.2 Fixed Task 调度126

7.2.3 Single Task 调度 128

7.2.4 Coordinator_Only Task 调度 128

7.3 Task 执行129

7.3.1 创建 Task 129

7.3.2 更新 Task 135

7.3.3 运行 Task 140

7.4 小结 147

第 8 章 队列 148

8.1 配置说明 148

8.1.1 queues 队列定义149

8.1.2 rules 规则定义 149

8.2 队列加载 150

8.3 队列匹配 151

8.4 小结 154

第 9 章 System Connector 155

9.1 System Connector 使用155

9.1.1 Information_schema 155

9.1.2 Metadata 157

9.1.3 Runtime 157

9.2 System Connector 实现159

9.2.1 Information_schema 实现160

9.2.2 System Connector 实现163

9.3 小结 168

第 10 章 Hive Connector 169

10.1 与 Hive 的结合 170

10.2 Split 分片管理 175

10.3 数据读取179

10.4 Create Table As Select 的实现 182

10.5 小结186

第 11 章 Kafka Connector 187

11.1 认识 Kafka Connector 187

11.1.1 配置187

11.1.2 配置属性187

11.1.3 内置字段189

11.1.4 表定义文件190

11.1.5 Kafka 中的 key 和 message 191

11.1.6 行解码192

11.1.7 日期和时间解码器194

11.1.8 文本解码器194

11.1.9 数值解码器194

11.2 Kafka 连接器使用教程194

11.2.1 安装 Apache Kafka195

11.2.2 下载数据195

11.2.3 在 Presto 中配置 Kafka topics 197

11.2.4 基本数据查询197

11.2.5 添加表定义文件199

11.2.6 将 message 中所有值映射到不同列200

11.2.7 使用实时数据202

11.3 Kafka Connector 获取数据 207

11.3.1 Split 分片管理207

11.3.2 数据读取209

11.4 小结210

第 12 章 Connector 开发211

12.1 创建 Maven 工程 211

12.2 注册 Plugin 213

12.3 Connector 213

12.4 Metadata 215

12.5 SplitManager 217

12.6 RecordSetProvider 218

12.7 小结 219

第 13 章 Functions 开发220

13.1 Function 注册 220

13.2 窗口函数 225

13.3 聚合函数 229

13.4 小结 232

第三部分 高级篇

第 14 章 JD-Presto 功能改造234

14.1 PDBO 功能开发234

14.1.1 JDBC Split 剖析235

14.1.2 JdbcRecordCursor 剖析 238

14.1.3 分批次读取实现原理 240

14.1.4 动态步长实现原理 243

14.1.5 条件下发 245

14.1.6 PDBO 配置定义 247

14.2 DDL 及 DML 支持 250

14.2.1 Hive 连接器 Insert 功能 250

14.2.2 Hive 连接器 CTAS 动态分区表功能 252

14.3 动态增加、修改、删除 Catalog 254

14.3.1 目的 254

14.3.2 现状 254

14.3.3 实现 255

14.3.4 效果 258

14.4 小结 258

第 15 章 Presto 性能调优259

15.1 合理设计分区 259

15.2 Group By 字句优化 259

15.3 使用模糊聚合函数 259

15.4 合并多条 Like 子句为一条 regexp_like 子句260

15.5 大表放在 Join 子句左边260

15.6 关闭 distributed hash join 261

15.7 使用 ORC 存储 261

15.8 小结 262

第 16 章 Presto 应用场景 263

16.1 ETL 263

16.2 实时数据计算264

16.3 Ad-Hoc 查询266

16.4 实时数据流分析266

16.5 小结268

附录 A 常见问题及解决办法269

A.1 同时访问两个 Hadoop 集群269

A.2 Kafka 集群重启后无法获取数据272

A.3 Task exceeded max memory size 277

A.4 SQL 中 In 子句太长导致栈溢出错误278

A.5 高并发导致大量查询出错279

附录 B Presto 配置参数说明 282

附录 C Presto 执行信息说明289

Book Abstract

1.3.3 Presto 查询执行模型

Presto 在执行 SQL 语句时,将这些 SQL 语句解析为相应的查询,并在分布式集群中执行这些查询。

1. Statement

Statement 语句。其实就是指我们输入的 SQL 语句。 Presto 支持符合 ANSI 标准的 SQL语句。这种语句由子句( Clause)、表达式( Expression)和断言( Predicate)组成。Presto 为什么将语句( Statement)和查询( Query)的概念分开呢?因为在 Presto 中,语句和查询本身就是不同的概念。语句指的是终端用户输入的用文字表示的 SQL 语句;当 Presto 执行输入的 SQL 语句时,会根据 SQL 语句生成查询执行计划,进而生成可以执行的查询( Query),而查询代表的是分布到所有的 Worker 之间执行的实际查询操作。

2. Query

Query 即查询执行。当 Presto 接收一个 SQL 语句并执行时,会解析该 SQL 语句,将其转变成一个查询执行和相关的查询执行计划。一个查询执行代表可以在 Presto 集群中运行的查询,是由运行在各个 Worker 上且各自之间相互关联的阶段( Stage)组成的。

那么 SQL 语句与查询执行之间有什么不同呢?

其实很简单,你可以认为 SQL 语句就是提交给 Presto 的用文字表示的 SQL 执行语句。而查询执行则是为了完成 SQL 语句所表述的查询而实例化的配置信息、组件、查询执行计划和优化信息等。一个查询执行由 Stage、 Task、 Driver、 Split、 Operator 和 DataSource 组成。这些组件之间通过内部联系共同组成了一个查询执行,从而得到 SQL 语句表述的查询,并得到相应的结果集。

3. Stage

Stage 即查询执行阶段。当 Presto 运行 Query 时, Presto 会将一个 Query 拆分成具有层级关系的多个 Stage,一个 Stage 就代表查询执行计划的一部分。例如,当我们执行一个查询,从 Hive 的一张具有 1 亿条记录的表中查询数据并进行聚合操作时, Presto 会创建一个Root Stage(在后面的章节你会知道,该 Stage 就是 Single Stage),该 Stage 聚合其上游 Stage的输出数据,然后将结果输出给 Coordinator,并由 Coordinator 将结果输出给终端用户。Presto 技术内幕。

通常情况下, Stage 之间是树状的层级结构。每个 Query 都有一个 Root Stage。该 Stage用于聚集所有其他 Stage 的输出数据,并将最终的数据反馈给终端用户。需要注意的是,Stage并不会在集群中实际执行,它只是 Coordinator 用于对查询执行计划进行管理和建模的逻辑概念。每个 Stage(除了 Single Stage 和 Source Stage)都会有输入和输出,都会从上游 Stage读取数据,然后将产生结果输出给下游 Stage。需要注意的是: Source Stage 没有上游 Stage,它从 Connector 获取数据。 Single Stage 没有下游 Stage,它的结果直接输出给 Coordinator,并由 Coordinator 输出给终端用户。

Presto 中的 Stage 共分为 4 种,具体介绍如下。

Coordinator_Only:这种类型的 Stage 用于执行 DDL 或者 DML 语句中最终的表结构创建或者更改。

Single:这种类型的 Stage 用于聚合子 Stage 的输出数据,并将最终数据输出给终端用户。

Fixed: 这种类型的 Stage 用于接受其子 Stage 产生的数据并在集群中对这些数据进行分布式的聚合或者分组计算。

Source:这种类型的 Stage 用于直接连接数据源,从数据源读取数据,在读取数据的时候,该阶段也会根据 Presto 对查询执行计划的优化完成相关的断言下发( Predicate PushDown)和条件过滤等。

说明

由于一个 SQL 查询可以被分解为多个前后关联的 Stage,在这里我们约定:按照数据的流向,越靠近数据源的 Stage 越处于上游,越远离数据源的 Stage 越处于下游。

4. Exchange

Exchange 的字面意思就是 “交换”。 Presto 的 Stage 是通过 Exchange 来连接另一个 Stage的。Exchange 用于完成有上下游关系的 Stage 之间的数据交换。在 Presto 中有两种 Exchange:Output Buffer 和 Exchange Client。生产数据的 Stage 通过名为 Output Buffer 的 Exchange 将数据传送给其下游的 Stage(根据数据的流向,分为上下游,你可以将 Presto 中查询执行过程中的数据比喻成一条河流,那么产生数据的 Stage 相对于消费数据的 Stage 来说,就是上游)。消费数据的 Stage 通过名为 Exchange Client 的 Exchange 从上游 Stage 读取数据。如果当前的 Stage 是 Source 类型的 Stage,那么该 Stage 则是直接通过相应的 Connector从数据源读取数据的。而该 Stage 则是通过名为 Source Operator 的 Operator 与 Connector 进行交互的。例如,如果一个 Source Stage 直接从 HDFS 获取数据,那么这种操作不是通过Exchange Client 来完成的,而是通过运行于 Driver 中的 Source Operator 来完成的。

5. Task

从前面的章节我们可以知道, Stage 并不会在 Presto 集群中实际运行,它仅代表针对于一个 SQL 语句查询执行计划中的一部分查询的执行过程,只是用来对查询执行计划进行管理和的各个 Worker 节点上的。

在 Presto 集群中,一个查询执行被分解成具有层级关系的一系列的 Stage,一个 Stage又被拆分为一系列的 Task。每个 Task 处理一个或者多个 Split。每个 Task 都有对应的输入和输出。一个 Stage 被分解为多个 Task,从而可以并行地执行一个 Stage。 Task 也采用了相同的机制:一个 Task 也可以被分解为一个或者多个 Driver,从而并行地执行一个 Task。同的机制:一个 Task 也可以被分解为一个或者多个 Driver,从而并行地执行一个 Task。

说明

由于一个 SQL 查询可以被分解为多个前后关联的 Stage,而每个 Stage 中均含有一个或者多个Task,在这里我们约定:按照数据的流向,越靠近数据源的 Task 越处于上游,越远离数据源的 Ta越处于下游。
6. Driver

一个 Task 包含一个或者多个 Driver。一个 Driver 其实就是作用于一个 Split 的一系列Operator 的集合。因此一个 Driver 用于处理一个 Split,并且生成相应的输出,这些输出由Task 收集并且传送给其下游 Stage 中的一个 Task。一个 Driver 拥有一个输入和一个输出。

7. Operator

一个 Operator 代表对一个 Split 的一种操作,例如过滤、加权、转换等。一个 Operator依次读取一个 Split 中的数据,将 Operator 所代表的计算和操作作用于 Split 的数据上,并产生输出。每个 Operator 均会以 Page 为最小处理单位分别读取输入数据和产生输出数据。Operator 每次只会读取一个 Page 对象,相应地,每次也只会产生一个 Page 对象。

8. Split

Split 即分片。一个分片其实就是一个大的数据集中的一个小的子集。而 Driver 则是作用于一个分片上的一系列操作的集合,而每个节点上运行的 Task,又包含多个 Driver,从而一个 Task 可以处理多个 Split。其中每一种操作均由一个 Operator 表示。分布式查询执行计划的源 Stage( Source Stage)通过 Connector 从数据源获得多个分片。Source Stage 对 Split处理完毕之后,会将输出传递给其下游 Stage (通常其下游 Stage 的类型为 Fixed 或者 Single)。

当 Presto 执行一个查询的时候,首先会从 Coordinator 得到一个表对应的所有 Split。然后 Presto 就会根据查询执行计划,选择合适的节点运行相应的 Task 处理 Split。

Introduction

序言 1


12 年来,京东一直以开源技术作为构建自身核心技术体系的基础,在开源领域深耕多年,积极推动行业分享与交流。 JD-Presto 是京东首个贡献于开源社区的软件产品,开创了京东回馈开源社区的先河。


一年前, JD-Presto 研发团队是京东众多研发团队中的普通一员,时至今日,他们已成长为京东负有盛名的研发团队之一。一年来,他们忍受着孤独与寂寞,面对着无数困难与挫折,但他们从未放弃,凭着对技术的热爱、对信念的坚守、对优秀产品的执着追求,勇敢面对困难与挑战,历尽艰辛,终于迎来胜利的曙光。目前 JD-Presto 在京东内部已成功应用于精准营销、安全识别、商家后台、财务报表等十多个生产系统。京东为拥有 JD-Presto研发团队而骄傲!


与书店里的 Hadoop 书籍不同的是,本书是市面上第一本详细介绍 Presto 的书籍。它由浅入深地详细介绍了 Presto 的安装过程、内部运行原理机制、功能特性、性能优化方法,以及在应用过程中常见的问题及解决方案等,同时详细介绍了 JD-Presto 版本的许多新功能及其适用的业务场景。这些功能的成功研发,使得 JD-Presto 版本不仅可用于离线大数据分析计算来提升性能,还可用于多种数据源混合进行实时大数据分析计算,使一些使用其他大数据技术不能解决的业务场景有了一个全新有效的解决方案。同时,他们维护着 Presto在中国社区的建设,鼓舞着和培养了一群 Presto 的爱好者。


今天,国内已有越来越多的技术人员与公司在使用 JD-Presto 版本,相信本书能对读者学习和使用 JD-Presto 版本提供很大的帮助。本书不仅仅满足了初学者对技术书籍的渴求,也适合对 JD-Presto版本有一定使用经验的人员学习参考使用。希望它能成为你在 Presto 技术旅程中的一个朋友,点亮你前进的道路。



张晨


京东集团 CTO



序言 2


记得我刚加入京东的时候, Hadoop 的集群建设方兴未艾,大数据计算纷纷被转到Hadoop 中进行处理。然而,以前做数据挖掘的同学并不十分精通 Java 语言。他们更擅长于业务和 SQL 语言。为了让他们的工作更有效率、更得心应手,有必要找寻一个像 GoogleDremel 一样,以 SQL 为驱动的交互式 Ad-hoc 查询工具。于是我花了一些时间进行评估,包括 Hive、 Spark、 Impala 等, 后来 Facebook 刚开源不久的 Presto 便映入眼帘。 Presto 设计简单精巧,可以处理海量数据,最大化地利用硬件性能,计算全部在内存中完成,很好地利用高速网络来进行数据调度,其编码风格一致,易于掌握和改进。虽然在当时 Presto的数据源和 SQL 的支持度还有待丰富,但已经初步展示了发展的潜力,很适合京东的应用。Presto 就这样在京东找到了家。 JD-Presto 研发团队成员具有多年 JAVA 编程和分布式并行处理经验,他们工作兢兢业业,在原先开源的基础上,丰富了多种数据源的处理接口,并且通过对任务调度的追踪和分析, 改进并提升了并行处理任务的吞吐量。我们积极和 Facebook的 Presto 团队合作,成为 Presto 在国内的首批贡献者,建立并运行 Presto 的中国社区。我们也和 CSDN 的同仁建立了 Presto 的开发者论坛,在国内积极推广,普及 Presto 知识,让更多的开发人员受益。


京东是开源社区的受益者,也是开源开放文化的拥护者。我们将自己取得的点点滴滴毫无保留地回馈于开源社区,与大家共享,和大家一起进步。为了更好地服务于对 Presto有兴趣的研发人员,京东的同事们将平时工作中的积累和认识编辑成书,奉献给大家,希望他们的努力有助于读者学习和掌握 Presto。在此,我特别感谢为此书出版而辛勤工作的同事,他们是吕信、郭李明、袁安峰、孔云龙、戴东东等人。


翁志


京东集团首席技术顾问



序言 3


Presto is an open source, highly scalable, distributed SQL engine we developed at Facebook. Since releasing it two years ago, we have witnessed a tremendous amount of community interest and adoption. In the last twelve months, the Presto community has grown from technology firms in Silicon Valley to a broad variety of organizations worldwide. Today, NASDAQ, the second largest stock exchange in the United States, runs Presto to power their analytical use cases.


( Presto 是我们在 Facebook 开发的开源、高度可扩展的分布式 SQL 引擎。 Presto 在两年前发布后,大量的社区开始关注和后续应用 Presto。在最近的 12 个月里, Presto 社区已经一家硅谷科技公司成长为全球性的生态圈,涵盖一批多样化的组织。如今,全美第二大证券交易所纳斯达克也在使用 Presto 来驱动他们的案例分析业务。)


As organizations adopt Presto, many are contributing back to it. Teradata, a leader in data warehousing technology, maintains a group of engineers who contribute to Presto. We have also collaborated with engineers at JD.com since 2014 to make Presto better. Presto earned an "Open Source Outstanding Project" award at the 2015 China Open Source World Summit.


(组织机构们不仅在应用 Presto,他们中的一部分也在回馈 Presto。 Teradata,数据仓库技术领域内的引领者之一,拥有一支专门为 Presto 贡献力量的工程师团队。从 2014 年起,我们与中国电商领域引领者京东公司的开发人员展开合作,精益求精地打造 Presto 产品。随后 Presto 在 2015 年“第十届开源中国开源世界高峰论坛”上获取“ 2015 COPU 开源优秀项目大奖”。)


We hope you will learn more about Presto through this book developed by engineersat JD.com, and we encourage you to work with the community to improve Presto.


(我们真诚地希望你通过这本由京东工程师们撰写的书更深入地了解 Presto 引擎,也鼓励并期待你携手社区,改善 Presto 引擎。)


Jay Tang


Manager of Presto product, Big Data




前言


为什么要写这本书


相信很多软件开发人员在遇到应用系统涉及需要多种数据源、多种字符集下的混合计算时,都被数据的准确性和查询性能所困扰,一直以来都没有一个有效的技术方案能解决这个问题。 2014 年 7 月,京东 CTO 体系首席技术顾问翁志先生把 Presto 引入京东,数据准确性验证表明, Presto 在多种数据源、多种字符集下的混合计算均表现优异,数据准确性符合财务标准。我们认识到, Presto 是一个非常优秀的产品,尽管它有许多不足,我们决心把它打造为一个介于 T+1 计算和生产实时报表之间混合计算的大数据产品,支持秒级、分钟级获取查询结果、支持多并发的交互式 Ad-Hoc 查询与分析。 Presto 是一个较为完美的大数据实时计算解决方案,而市面上这类产品太少了,我们将经过生产环境验证的 JD-Presto 版本源给业内使用,主导 Presto 中国社区的推广工作。应广大 Presto 技术爱好者的要求,我们编写了这本书,以帮助更多的初学者、大数据领域的从业者学习及使用 JD-Presto。和其他许多调研过 Presto 的部门或公司一样,我们最初搭建的 Presto 测试集群在京东这种大数据量的环境下复杂计算任务几乎运行不起来, JOIN 查询也比较弱, 集群时常宕机。同时,在测试过程中我们也发现,与 Spark、 Impala 相比, Presto 使用更为简单、易用、高效,这让我们深感振奋,一致认为这个产品值得团队花大力气去研究和优化。因此,我们专门申请了上百台高性能服务器来搭建性能测试集群环境, 随后在几百 TB 级数据量下进行大规模的测试与验证, 完全证实了 Presto 的平均性能是 Hive 等离线数据分析产品性能的 10倍,并且支持 ANSI 标准 SQL、数据源完全解耦等一系列优势。在之后一年多的时间中,我们研发了众多实用功能,着力修复了许多 Bug,大幅提升了 Presto 的查询性能和并发执行性能,如重写了数据库驱动,使得 Presto 连接数据库进行海量数据查询的性能提升了几百倍;优化了内存使用效率,使查询性能对内存大小的依赖大幅降低;支持分布式数据库的分库分表设计;优化数据存储算法。通过上述一系列新功能的成功研发和对性能的大幅改进,使得 JD-Presto 的性能稳定是是 Hive 的 10 倍以上,是 Spark 的 3 倍以上,集群成本节省一半,在一个大规模的大数据集群中, 这种技术优势可带来显著的经济效益。


本书读者对象


Java 研发工程师;


在大数据技术领域从业的研发工程师、运维工程师、架构师;


对大数据研究方向感兴趣的大学老师和学生、以及大数据技术的入门学者;


从事海量数据分析应用的开发者、研究者。


如何阅读本书


本书按照由浅入深的顺序对大数据实时计算产品 Presto 进行了全方位的细致讲解,从基本的安装部署与使用到源码解析,以及根据实际业务需求进行新功能改造开发和性能优
化。


若你从来没有使用过 Presto,那么完全可以按照由浅入深的顺序从头开始阅读此书。


若你已经成功地使用了 Presto 一段时间,想要深入地了解 Presto 的设计思想并希望从源码级别了解 Presto 的实现思路,那么可以直接从核心设计篇进行阅读。


若你本来就是 Presto 的贡献者,苦于 Presto 不能满足你的实际业务问题,想要对 Presto进行功能改造但是还没有明确的思路;又或者你在使用 Presto 的过程中发现其性能没有达到你的预期,而又找不到优化的方案,那么高级篇会给你提供一些建议。


在本书最后的附录部分不仅对 Presto 使用过程中出现的各种问题给出了明确的解决方案,还对 Presto中的各个配置参数的含义和作用进行了详细的说明并给出了推荐配置值。


相信此书会为广大大数据爱好者提供一个新的视角,思考并解决大数据相关问题。


勘误和支持


由于作者水平和能力有限,编写时间仓促,本书存在不妥之处在所难免,我们真诚希望同行和广大读者朋友们不吝赐教。另外,如果你有关于 JD-Presto 的任何问题,可以加入我们的 QQ 群: 141254058,与我们在线交流,或者访问网站: https://prestodb-china.com/,期待你的反馈意见,我们将不胜感激。


致谢


感谢现任京东 CTO 体系首席技术顾问、信息安全部、京东硅谷研发中心负责人翁志先生,在产品研发和推广使用的过程中给予了我们极大的支持和鼓励。同时在本书出版的过程中,从选题、审稿到出版无不得到他的热心帮助,在此致以深深的谢意!


感谢京东云平台——数据研发运营部的负责人樊建刚先生给予我们充分的授权和支持,他鼓励我们将产品开源、组建技术交流群和中文社区,使得 JD-Presto 成为京东第一个开源的软件产品,开创京东回馈开源社区的先河。


感谢研发团队的兄弟们,他们酷爱技术、注重团队协作、深入理解客户需求,能从一个较为全面的角度考虑产品的架构设计与功能研发,这是产品成功的基石,也是最关键的因素。


回首这一路的艰辛,无以表达此时的心情,只能说,兄弟们所做的一切都让我心怀崇敬!


戴东东


2016



Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book