Skip to Content
Mastering Apache Cassandra 3.x - Third Edition
book

Mastering Apache Cassandra 3.x - Third Edition

by Aaron Ploetz, Tejaswi Malepati
October 2018
Beginner to intermediate content levelBeginner to intermediate
348 pages
10h
English
Packt Publishing
Content preview from Mastering Apache Cassandra 3.x - Third Edition

Accessing Cassandra data

Once configuration is all set, first we import a table locally into a DataFrame. A DataFrame is a datatype used in Spark that has an enhanced version of RDD, with additional structure (metadata) to it. For example, assume the preloaded schema and data for everything is in a Docker image. Let's say our marketing team wants to send personalized email notifications to all users who have purchased items that have offers currently. We need to join the itemid column from orders and the offers table in the demo schema. Refer to the PySpark API docs for further information at Spark: Python API Docs: https://spark.apache.org/docs/latest/api/python/index.html.

The commands are as follows:

_keyspace = 'demo'offers = sqlContext.read.format('org.apache.spark.sql.cassandra').load(table='offers', ...
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

Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

Nishant Neeraj

Publisher Resources

ISBN: 9781789131499Supplemental Content