Skip to Main Content
PySpark Cookbook
book

PySpark Cookbook

by Denny Lee, Tomasz Drabas
June 2018
Intermediate to advanced content levelIntermediate to advanced
330 pages
9h 47m
English
Packt Publishing
Content preview from PySpark Cookbook

How it works...

First, we specify the location of Spark's source code. The _spark_archive contains the name of the archive; we use awk to extract the last element (here, it is specified by the $NF flag) from the _spark_source. The _spark_dir contains the name of the directory our archive will unpack into; in our current case, this will be spark-2.3.1. Finally, we specify our destination folder where we will be going to move the binaries to: it will either be /opt/spark (default) or your home directory if you use the -ns (or --nosudo) switch when calling the ./installFromSource.sh script.

Next, we check the OS name we are using:

function checkOS(){ _uname_out="$(uname -s)" case "$_uname_out" in   Linux*) _machine="Linux";; Darwin*) _machine="Mac";; ...
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.
Start your free trial

You might also like

Spark: The Definitive Guide

Spark: The Definitive Guide

Bill Chambers, Matei Zaharia
Learning PySpark

Learning PySpark

Tomasz Drabas, Denny Lee
Python Cookbook, 3rd Edition

Python Cookbook, 3rd Edition

David Beazley, Brian K. Jones
Kafka: The Definitive Guide

Kafka: The Definitive Guide

Neha Narkhede, Gwen Shapira, Todd Palino

Publisher Resources

ISBN: 9781788835367Supplemental Content