PowerExchange for Cassandra User Guide

PowerExchange for Cassandra User Guide

Example: Analyzing Data Stored in a Cassandra Database

Example: Analyzing Data Stored in a Cassandra Database

To store real-time data on weather, you need to store data on a database that supports multiple and fast write operations.
Your organization uses a Cassandra database to store real-time data from a weather station. You need to fetch the weather data for a specific period of time and represent the data in a graphical format for analysis.
The weather station stores the temperature at a particular time period in a Cassandra column family. The following is the definition of the temperature_by_day column family:
CREATE TABLE temperature_by_day ( weatherstation_id text, date text, event_time timestamp, temperature text, PRIMARY KEY ((weatherstation_id,date),event_time));
Create a mapping to read data from Cassandra and write it to a flat file. You can use Tableau to read the flat file and create a time-series graph for temperature.
The following image shows the mapping:

Mapping Input

The mapping source is a column family in the Cassandra database. The source contains information for your organization, including weatherstation ID, time, and temperature. Source columns include columns such as weatherstation ID, date, event time, and temperature.
The following table describes the contents of the temperature_by_day column family:
Field
Data type
weatherstation_id
String
date
String
event_time
Date/Time
temperature
String

Mapping Output

The mapping output is a flat file data object. The flat file data object contains the same columns as the source. When you run the mapping, the Data Integration Service reads weather information from the Cassandra database and writes the data to a flat file. Analysts can use the flat file in Tableau to create a time-series graph for temperature.

0 COMMENTS

We’d like to hear from you!