写点什么

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

评论

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

【web 开发基础】PHP中的伪类型参数的函数 (31)

迷彩

函数 web开发基础 11月月更 伪类型参数函数 伪类型

Jan Ozer:高清直播互动场景下的硬编码如何选型?

声网

人工智能 编码 视频

软件测试之 Contract Testing

QE_LAB

契约测试 测试技术

微信小程序开发在全局配置和资源加载优化在获取接口上的节点信息实战

恒山其若陋兮

前端 11月月更

架构实战营模块 6 作业

陌生流云

架构实战营

【web 开发基础】PHP 中的默认(缺省)参数的函数 (33)

迷彩

缺省参数 函数 web开发基础 11月月更 默认参数

2022年第三季度泛出行行业洞察:泛出行行业正在经历数智化升级的关键时期,用户规模保持平稳增长,行业整体良性发展

易观分析

数智化 泛出行

react的useState源码分析

flyzz177

React

【个人成长】《代码的艺术》视频分享合集

非晓为骁

职业规划 开发 软件工程能力 代码的艺术

深入React源码揭开渲染更新流程的面纱

goClient1992

React

算法基础:单链表图解及模板总结

timerring

算法 11月月更 单链表

Kafka SASL 用户认证机制

spacerrobot

kafka 认证授权 SASL SCRAM JAAS

react源码分析:组件的创建和更新

flyzz177

React

react源码分析:深度理解React.Context

flyzz177

React

HarmonyOS 3重磅版本更新,Mate Xs 2等更多设备支持超级中转站!

极客天地

手写一个react,看透react运行机制

goClient1992

React

使用keytool生成Tomcat证书

源字节1号

如何给 Fiori Elements 应用添加自定义按钮

汪子熙

前端开发 web开发 Fiori SAP UI5 11月月更

【活动回顾】Apps Everywhere 上海站圆满结束

亚马逊云科技 (Amazon Web Services)

人工智能 机器学习

自动化测试成熟度模型

老张

DevOps 自动化测试

带你实现react源码的核心功能

goClient1992

React

《算法》世界一

初学者

算法 网络 11月月更

如何用科学的方法“撞大运”? | 学点运气

赵新龙

CTO 创新 与运气竞争

Zebec流支付生态,开启多链布局的“两手准备”

股市老人

对于基于鸿蒙系统的应用支持多语言Arkui框架的线性容器类和PieChart的研究实战

恒山其若陋兮

前端 11月月更

基于OpenHarmony的ArkUI框架进阶对于高性能容器类和持久化和原子化的运用

恒山其若陋兮

前端 11月月更

《算法》世界二

初学者

算法 网络 11月月更

【web 开发基础】PHP中的引用参数的函数 (32)

迷彩

web开发基础 11月月更 引用传递 引用参数函数 值传递

C++---类型萃取---std::remove_cv/std::remove_cv

桑榆

C++ STL 11月月更

K8S环境的Jenkin性能问题处理续篇(任务Pod设置)

程序员欣宸

Kubernetes jenkins 11月月更

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