写点什么

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

评论

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

云小课 | 华为云KYON之L2CG

华为云开发者联盟

虚拟私有云 华为云 大二层网络 KYON企业级云网络 L2CG

书单 | 职场办公类私藏好书,轻松Get职场必备技能

博文视点Broadview

当当购书优惠码又可以限时抢啦(热卖新书等你来)

博文视点Broadview

阿里的互联网三高架构是真的牛!腾讯百度根本模仿不来

Java架构师迁哥

最详细的 Python 结合 RFM 模型实现用户分层实操案例!

JackTian

Python 编程 程序员 数据分析 RFM模型

KubeSphere+QKE 轻松实现容器多集群管理

青云技术社区

容器 k8s 开发工具

网页端IM通信技术快速入门:短轮询、长轮询、SSE、WebSocket

JackJiang

websocket 消息推送 即时通讯 IM

麦肯锡最新报告 | 开发者速率成为企业增长助推剂

LigaAI

SaaS

面试37次,16个offer上岸,总结了一些面试心得

北游学Java

面试 offer

Leveldb解析之五:理解leveldb的持久化和MVCC实现机制

Jowin

leveldb

软硬件融合新时代——让软件够灵活,硬件够高效,鱼和熊掌可兼得

博文视点Broadview

低代码核心优势是:降本增效+多系统集成,这真的对吗?

优秀

低代码

五种网络IO模型详解

Linux服务器开发

后端 epoll Linux服务器开发 网络io 网络模型

dubbo的前世今生

捉虫大师

dubbo

架构是什么?空中楼阁?不切实际?

Java架构师迁哥

iOS 面试策略之系统框架-设计模式

iOSer

ios 并发编程 tableView

打破固有思维(十八)

Changing Lin

5月日更

Hive对分区分桶表的操作

五分钟学大数据

大数据 hive 5月日更

智能量化网格策略交易机器人,马丁倍投机器人

千万级学生管理系统考试试卷存储方案

chenmin

强化学习落地:竞态场景下基于锁机制的闲置端口查用

行者AI

强化学习

Mybatis-Plus的应用场景及注入SQL原理分析

vivo互联网技术

源码分析 mybatis

如何快速构建嵌入式全栈知识体系?

博文视点Broadview

一颗CPU与病魔赛跑

E科讯

IDC数据中心介绍

大数据技术指南

数据中心 5月日更

聊聊业务数据分析那些事儿

小飞象@木木自由

数据分析 业务场景分析 业务数据分析 业务分析

毕业设计So Easy:基于Java语言西餐厅点餐系统

不脱发的程序猿

Java 开源 Java语言西餐厅点餐系统 毕业设计

李开复、张亚勤、吴恩达…国际大咖给你讲解AI知识

博文视点Broadview

ASP.NET Core整合Zipkin链路跟踪

yi念之间

Java程序员想要拿到50W以上年薪,哪个技术是必备的?

Java架构师迁哥

联邦学习在视觉领域的应用,揭秘AI人工智能创新应用奖获奖案例

博文视点Broadview

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