当前位置:网站首页>RDD和DataFrame和Dataset
RDD和DataFrame和Dataset
2022-08-05 05:12:00 【价值成长】
1. DataFrame
为了支持结构化数据的处理,Spark SQL 提供了新的数据结构 DataFrame。DataFrame 是一个由具名列组成的数据集。它在概念上等同于关系数据库中的表或 R/Python 语言中的 data frame。 由于 Spark SQL 支持多种语言的开发,所以每种语言都定义了 DataFrame 的抽象
2. DataSet
Dataset 也是分布式的数据集合,它集成了 RDD 和 DataFrame 的优点,具备强类型的特点,同时支持 Lambda 函数。Spark 2.0 后,为了方便开发者,Spark 将 DataFrame 和 Dataset 的 API 融合到一起,提供了结构化的 API(Structured API),即用户可以通过一套标准的 API 就能完成对两者的操作。
Spark SQL && DataFrame && Dataset
如果你用的是 Spark SQL 的查询语句,则直到运行时你才会发现有语法错误,而如果你用的是 DataFrame 和 Dataset,则在编译时就可以发现错误 (这节省了开发时间和整体代价)。
DataFrame & DataSet & RDDs
- RDDs 适合非结构化数据的处理,而 DataFrame & DataSet 更适合结构化数据和半结构化的处理;
- DataFrame & DataSet 可以通过统一的 Structured API 进行访问,而 RDDs 则更适合函数式编程的场景;
- 相比于 DataFrame 而言,DataSet 是强类型的 (Typed),有着更为严格的静态类型检查;
- DataSets、DataFrames、SQL 的底层都依赖了 RDDs API,并对外提供结构化的访问接口。
边栏推荐
猜你喜欢

『递归』递归概念与典型实例

8.04 Day35-----MVC three-tier architecture
![[cesium] element highlighting](/img/99/504ca9802db83eb33bc6d91b34fa84.png)
[cesium] element highlighting
![[Surveying] Quick Summary - Excerpt from Gaoshu Gang](/img/35/e5c5349b8d4ccf9203c432a9aaee7b.png)
[Surveying] Quick Summary - Excerpt from Gaoshu Gang

【学习笔记之菜Dog学C】动态内存管理之经典笔试题

Excel Paint

ESP32 485光照度

Flutter learning 2-dart learning
![[Student Graduation Project] Design and Implementation of the Website Based on the Web Student Information Management System (13 pages)](/img/86/9c9a2541f2b7089ae47e9832fffdb3.png)
[Student Graduation Project] Design and Implementation of the Website Based on the Web Student Information Management System (13 pages)

jvm three heap and stack
随机推荐
【cesium】元素高亮显示
算法---一和零(Kotlin)
Flutter真机运行及模拟器运行
2023年信息与通信工程国际会议(JCICE 2023)
Algorithms - ones and zeros (Kotlin)
"Recursion" recursion concept and typical examples
Shell(4)条件控制语句
How to identify false evidence and evidence?
Flutter Learning 4 - Basic UI Components
How to deal with DNS hijacking?
【学生毕业设计】基于web学生信息管理系统网站的设计与实现(13个页面)
How to quickly upgrade your Taobao account to a higher level
Flutter学习4-基本UI组件
电话溥功能
The mall background management system based on Web design and implementation
【无标题】
Day14 jenkins部署
结构光三维重建(二)线结构光三维重建
Talk about 20 common problems in data governance
开发一套高容错分布式系统