写点什么

如何弥合 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:005979

评论

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

等保三级密码复杂度是多少?多久更换一次?

行云管家

堡垒机 等级保护 过等保 等保2.0

Vue3 - $attrs 的几种用法(1个或多个根元素、Options API 和 Composition API)

德育处主任

Vue composition-api 组件通信 6月月更 Vue透传

如何制作登录界面

海瞳Seapupil

如何使用物联网低代码平台进行画面管理?

AIRIOT

低代码 物联网 低代码开发 低代码开发平台 低代码,项目开发

【ELT.ZIP】OpenHarmony啃论文俱乐部—数据密集型应用内存压缩

ELT.ZIP

OpenHarmony 压缩数据 压缩算法 ELT.ZIP

Hi,你有一份Code Review攻略待查收!

Jianmu

后端 Code Review 代码规范 SonarQube checkstyle

【干货分享】红黑树硬核讲解

C++后台开发

后端开发 红黑树 linux开发 Linux内核 C++开发

4种方法教你如何查看java对象所占内存大小

华为云开发者联盟

Java 开发 内存 代码

DevOps 如何帮助前端提升研发效率?

飞算JavaAI开发助手

等保2.0密码要求是什么?法律依据有哪些?

行云管家

网络安全 等保 等保2.0

国内首家!EMQ加入亚马逊云科技“初创加速-全球合作伙伴网络计划”

EMQ映云科技

物联网 IoT emq 亚马逊 6月月更

2022年第一季度消费金融APP用户洞察——总数达4479万人

易观分析

消费金融

拥抱云原生:江苏移动订单中心实践

鲸品堂

云原生

可观测,才可靠:云上自动化运维CloudOps系列沙龙 第一弹

阿里云弹性计算

DevOps 可观测性 自动化运维 CloudOps

基于 Nebula Graph 构建百亿关系知识图谱实践

NebulaGraph

知识图谱 Nebula Graph

2022年中国音频市场年度综合分析

易观分析

音频市场

在线文本按行批量反转工具

入门小站

工具

带你认识图数据库性能和场景测试利器LDBC SNB

华为云开发者联盟

人工智能 华为云 图数据库

鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态

最新动态

【ELT.ZIP】OpenHarmony啃论文俱乐部—见证文件压缩系统EROFS

ELT.ZIP

OpenHarmony 压缩数据 压缩算法 ELT.ZIP

跟着官方文档学 Python 之:简介

甜甜的白桃

Python 零基础 6月月更

字节跳动埋点数据流建设与治理实践

字节跳动数据平台

字节跳动 数据治理 数据流 埋点治理 数据研发

开源二三事|ShardingSphere 与 Database Mesh 之间不得不说的那些事

SphereEx

数据库 SphereEx Apache ShardingSphere Database Mesh Pisanix

NFT双币质押流动性挖矿dapp合约定制

开发微hkkf5566

Substrate 源码追新导读: 4月底重大更新: Nomination Pool 即将上线, NFT增加锁定功能

彭亚伦

Substrate 波卡 波卡生态

Bit.Store:熊市漫漫,稳定Staking产品或成主旋律

鳄鱼视界

OpenSSF 安全计划:SBOM 将驱动软件供应链安全

SEAL安全

软件物料清单

什么是 ICMP ?ping和ICMP之间有啥关系?

wljslmz

网络协议 ping ICMP 6月月更

工作流自动化 低代码是关键

力软低代码开发平台

大数据性能提升28%!阿里云新一代本地SSD实例i4开放公测

阿里云弹性计算

大数据 io SSD NoSQL 数据库

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