Skip to Content
Sparkによるデータアルゴリズム
book

Sparkによるデータアルゴリズム

by Mahmoud Parsian
March 2025
Intermediate to advanced
438 pages
6h 47m
Japanese
O'Reilly Media, Inc.
Content preview from Sparkによるデータアルゴリズム

第1章. SparkとPySparkの紹介

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

Sparkは、大規模データ処理のための強力な分析エンジンで、ビッグデータ・アプリケーションのスピード、使いやすさ、拡張性を目指している。ビッグデータを日々扱う多くの企業で使用されている、実績のある広く採用されているテクノロジーだ。Sparkの「ネイティブ」言語はScalaだが(SparkのほとんどはScalaで開発されている)、Java、Python、Rの高レベルAPIも提供している。

本書では、SparkプログラミングモデルをPythonに公開するAPIであるPySparkを介してPythonを使用する。 Pythonは最もアクセスしやすいプログラミング言語であり、SparkのAPIは強力で式が多いため、PySparkはシンプルであり、私たちにとって最良の選択となる。PySparkはPythonプログラミング言語におけるSparkのインタフェースであり、以下の2つの重要な機能を提供する:

  • PythonのAPIを使ってSparkアプリケーションを書くことができる。

  • 分散環境でインタラクティブにデータを分析するためのPySparkシェルを提供する。

本章の目的は、PySparkをSparkエコシステムの主要コンポーネントとして紹介し、ETL演算、何十億ものドキュメントのインデックス作成、何百万ものゲノムの取り込み、機械学習、グラフデータ解析、DNAデータ解析などのビッグデータ・タスクに効果的に使用できることを示すことである。まずSparkとPySparkのアーキテクチャを概観し、PySparkの表現力を示す例を提供する。SparkとPySparkをすぐに使い始められるように、Sparkのコア関数(変換とアクション)と概念の概要を紹介する。Sparkの主なデータ抽象化には、レジリエンス分散データセット(RDD)、DataFrames、Datasetsがある。これから説明するように、データ(Hadoopファイル、Amazon S3オブジェクト、Linuxファイル、コレクションデータ構造、リレーショナルデータベースのテーブルなど)をRDDとDataFramesの組み合わせで表現することができる。

いったんデータがSparkのデータ抽象化として表現されると、求めている最終的な形になるまで、そのデータに変換を適用したり、新しいデータ抽象化を作成したりすることができる。Sparkの変換(map()reduceByKey() など)を使って、データをある形から別の形に変換し、目的の結果を得ることができる。 これらのデータ抽象化については追って説明するが、まずはなぜSparkがデータ分析に最適なのかをもう少し掘り下げてみよう。

なぜデータ分析にSparkなのか?

Sparkは、大規模なデータ処理に使用できる強力な分析エンジンである。Sparkを使用する最も重要な理由は以下の通りである:

  • Sparkはシンプルでパワフル、そして速い。

  • Sparkはフリーでオープンソースだ。

  • Sparkはあらゆる場所(Hadoop、Mesos、Kubernetes、スタンドアロン、クラウド)で動作する。

  • Sparkは、あらゆるデータソース(Amazon S3、Hadoop HDFS、リレーショナルデータベースなど)から/へのデータの読み取り/書き込みが可能だ。 ...

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

メダリオンアーキテクチャの構築

メダリオンアーキテクチャの構築

Piethein Strengholt

Publisher Resources

ISBN: 9798341635302