Skip to Content
Spark快速大数据分析(第2版)
book

Spark快速大数据分析(第2版)

by Jules S. Damji, Brooke Wenig, Tathagata Das, Denny Lee
November 2021
Intermediate to advanced
340 pages
10h 46m
Chinese
Posts & Telecom Press
Content preview from Spark快速大数据分析(第2版)
Spark SQL
DataFrame
读写外部数据源
127
+--------------------+-------------+
| celsius|avgFahrenheit|
+--------------------+-------------+
|[35, 36, 32, 30, ...| 96|
|[31, 32, 34, 55, 56]| 105|
+--------------------+-------------+
5.5
 常用的
DataFrame
操作和
Spark SQL
操作
Spark SQL
的部分能力来自其所支持的丰富的
DataFrame
操作(也称作无类型
Dataset
操作)。
操作列表中的种类很丰富,包括:
聚合函数
集合函数
时间函数
数学函数
杂项函数
非聚合函数
排序函数
字符串函数
用户自定义函数
窗口函数
要想获取完整列表,可参见
Spark SQL
文档。
本节将主要介绍下列常用的关系型操作:
联合与连接
窗口
修改
执行这些
DataFrame
操作前,我们先准备一些数据。在以下代码片段中执行以下操作。
1.
导入两个文件
,并创建两个
DataFrame
,其中一个是机场信息(
airports_na
),另一个
是美国航班延误数据(
departureDelays
)。
2.
使用
expr()
delay
列和
distance
列从
STRING
类型转换为
INT
类型。
3.
创建只包含很短时间范围内从西雅图
SEA
)飞往旧金山(
SFO
)的三个航班的小表 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
数据压缩入门

数据压缩入门

Colt McAnlis, Aleks Haecky
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115576019