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
读写外部数据源
107
Time taken: 0.637 seconds
spark-sql>
3.
运行
Spark SQL
查询
现在表中有了数据,可以对它运行
Spark SQL
查询。先看看我们的元数据库有哪些表。
spark-sql>
SHOW TABLES;
default people false
Time taken: 0.016 seconds, Fetched 1 row(s)
下一步是找出表中有多少人年龄小于
20
岁。
spark-sql>
SELECT * FROM people WHERE age < 20;
Samantha 19
Time taken: 0.593 seconds, Fetched 1 row(s)
再看看哪些人没有年龄数据。
spark-sql>
SELECT name FROM people WHERE age IS NULL;
Michael
Time taken: 0.272 seconds, Fetched 1 row(s)
5.2.2
 使用
Beeline
如果使用过
Hive
,那么你应该熟悉
Hive
附带的命令行工具
Beeline
,它是在
HiveServer2
上运行
HiveQL
查询的一个常用工具
Beeline
是基于
SQLLine
命令行接口实现的
JDBC
客户端。你也可以用它在
Spark
Thrift
服务器上执行
Spark SQL
查询。注意,当前实现的
Thrift JDBC/ODBC
服务器对应的是
Hive 1.2.1 ...
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