写点什么

如何弥合 Spark Datasets 和 DataFrames 之间的性能差距?

  • 2019-08-15
  • 本文字数:2167 字

    阅读完需:约 7 分钟

如何弥合 Spark Datasets 和 DataFrames 之间的性能差距?

ArchSummit深圳2019大会上,蔡東邦 (DB Tsai)讲师做了《如何弥合 Spark Datasets 和 DataFrames 之间的性能差距?》主题演讲,主要内容如下。


演讲简介


Bridging the gap between Spark Datasets and DataFrames


Apple leverages Apache Spark for processing large datasets to power key components of Apple’s production services. The majority of users rely on Spark SQL to benefit from state-of-the-art optimizations in Catalyst and Tungsten. As there are multiple APIs to interact with Spark SQL, users have to make a wise decision which one to pick. While DataFrames and SQL are widely used, they lack type safety so that the analysis errors will not be detected during the compile time such as invalid column names or types. Also, the ability to apply the same functional constructions as on RDDs is missing in DataFrames. Datasets expose a type-safe API and support for user-defined closures at the cost of performance.


译文参考:


Apple 利用 Apache Spark 处理大型数据集,为 Apple 生产服务的关键组件提供动力。 大多数用户依靠 Spark SQL 从 Catalyst 和 Tungsten 中最先进的优化中受益。由于有多个 API 与 Spark SQL 交互,因此用户必须明智地决定最终选择哪一个。虽然 DataFrame 和 SQL 被广泛使用,但它们缺乏类型安全性,因此在编译期间无法检测到分析错误,例如无效的列名称或类型。此外,在 RDDs 上应用相同功能结构的功能却不能在 DataFrames 中使用。Datasets 以牺牲性能为代价公开了类型安全的 API,并支持用户定义的闭包。


This talk will explain cases when Spark SQL cannot optimize typed Datasets as much as it can optimize DataFrames. We will also present an effort to use bytecode analysis to convert user-defined closures into native Catalyst expressions. This helps Spark to avoid the expensive conversion between the internal format and JVM objects as well as to leverage more Catalyst optimizations. A consequence, we can bridge the gap in performance between Datasets and DataFrames, so that users do not have to sacrifice the benefits of Datasets for performance reasons.


本演讲将重点介绍 Spark SQL 无法优化类型化 Datasets 的情况,因为它可以优化 DataFrame。我们还将努力使用字节码分析将用户定义的闭包转换为本机 Catalyst 表达式。这有助于 Spark 避免在内部格式和 JVM 对象之间的昂贵转换,以及利用更多的 Catalyst 优化。因此,我们可以弥合 Datasets 和 DataFrames 之间的性能差距,这样用户就不会因性能原因而牺牲 Datasets 的优势。


Outlines of the speech


  1. Apache Spark

  2. Dataframe vs Dataset

  3. Bytecode Analysis

  4. JVM GC


Key points


  • The audiences will learn how Apache Spark works internally; particularly on how catalyst optimizer optimizes the execution plans.

  • Then I will go through the current problems of Spark’s Dataset implementation which expose a type-safe API and support for user-defined closures at the cost of performance.

  • Finally, I’ll talk about how we do bytecode analysis to understand the JVM bytecode, and then convert them into SQL expressions for further optimization. In some of our Spark jobs, we see 40x performance gain resulting less required resource and faster deliver time.

  • 帮助听众了解 Apache Spark 内部的工作流程,尤其是 Catalyst 优化器如何优化执行计划。

  • 了解 Spark Dataset 当前在应用方面的问题,这些问题公开了类型安全的 API,并以性能为代价支持用户定义的闭包。

  • 最后,我将分享我们是如何实现字节码分析的案例,帮助理解 JVM 字节码,然后将它们转换为 SQL 表达式以进一步优化。在我们所做的一些 Spark 工作中,我们看到了 40 倍的性能提升,从而减少了所需的资源,交付时间也更快。


讲师介绍


蔡東邦 (DB Tsai)


Apple Staff Software Engineer & Apache Spark PMC


DB Tsai is an Apache Spark PMC / Committer and an open source and staff software engineer at Apple Siri. He implemented several algorithms including linear models with Elastici-Net (L1/L2) regularization using LBFGS/OWL-QN optimizers in Apache Spark. Prior to joining Apple, DB worked on Personalized Recommendation ML Algorithms at Netflix. DB was a Ph.D. candidate in Applied Physics at Stanford University. He holds a Master’s degree in Electrical Engineering from Stanford.


译文参考:


蔡東邦老师是 Apache Spark PMC / Committer,同时也是 Apple Siri 的主任工程师。他将多个算法应用到了 Apache Spark 当中,包括使用了 LBFGS / OWL-QN 优化器 的 Elastici-Net(L1 / L2)正则化的线性模型。在加入 Apple Siri 之前,蔡老师在 Netflix 从事个性化推荐机器学习算法的研究工作。目前是斯坦福大学应用物理专业的博士候选人,也获得了斯坦福大学电气工程硕士学位。












完整演讲 PPT 下载链接


https://archsummit.infoq.cn/2019/shenzhen/schedule


2019-08-15 00:005934

评论

发布
暂无评论
发现更多内容

neo4j 基本概念与入门实例

escray

学习 neo4j 8月日更

Linux之time命令

入门小站

Linux

CC校园运动小程序云开发解决方案

CC同学

量化机器人软件开发|自动交易机器人

量化系统19942438797

机器人 量化交易

ShardingSphere JDBC 语句执行初探

源码 ShardingSphere

mycat入门:落地分库分表与读写分离

小鲍侃java

8月日更

区块链产业正处于繁荣前夜(上)

CECBC

牛掰!“基础-中级-高级”Java程序员面试集结,看完献出我的膝盖

Java 编程 程序员 架构 面试

ShardingSphere UI 初步体验

源码 ShardingSphere

springboot使用redis(从配置到实战)

Python研究者

8月日更

JAVA应用生产问题排查步骤

Java 编程 架构 程序人生 架构师

在线JSON转HTML工具

入门小站

工具

轻松让你的nginx服务器支持HTTP2协议

程序那些事

Java nginx HTTP 程序那些事 http2

一种单机支持 JavaWeb 容器万级并发的设想

Java 编程 程序员 面试

SSH免登陆

Mike

区块链产业正处于繁荣前夜(下)

CECBC

今天聊一聊Golang的互斥锁吧

Regan Yue

互斥锁 互斥锁Mutex 8月日更

华为云数据库内核专家为您揭秘:GaussDB(for MySQL)并行查询有多快?

华为云数据库小助手

GaussDB 华为云数据库 GaussDB(for MySQL)

如何使用python制作动感炫酷的 动态二维码

4ye

Python 后端 二维码 8月日更

死锁终结者:顺序锁和轮询锁!

王磊

Java 死锁 8月日更

聊聊 PC 端自动化最佳方案 - Pywinauto

星安果

Python 自动化 Pywinauto PC

成为高效工程师的四步法则

俞凡

生产力 认知

阿里的新“宠儿”!终于有人总结出了Spring源码从初级到高级手册

Java架构追梦

Java spring 阿里巴巴 架构 面试

模块六作业:拆分电商系统为微服务

Felix

微校园小程序(云开发)设计方案

CC同学

☕【Java技术指南】「TestNG专题」单元测试框架之TestNG使用教程指南(上)

码界西柚

Java 测试 单元测试 8月日更 testNG

谈 C++17 里的 Factory 模式

hedzr

c++ factory pattern c++17 factory method

不可错过的mysql,redis,nginx视频讲解

hanaper

架构实战训练营模块六作业

NewBranSTONE

#架构实战营

架构实战营 模块六 作业

一雄

作业 架构实战营 模块六

Java全家桶的这些知识,不用学了

Java 架构 后端 计算机

如何弥合 Spark Datasets 和 DataFrames 之间的性能差距?_ArchSummit_蔡東邦 (DB Tsai)_InfoQ精选文章