SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Build and Deploy Streaming Lite Project

Learn how to create, compile and deploy a streaming analytics project.

Overview

You will learn

  • How to build a Streaming Lite project on HANA Studio
  • How to deploy our project on Raspberry Pi 2
Robert Waywell R Robert Waywell August 21, 2026
Created on April 17, 2018
Contributors

More from Robert Waywell

See all 21 tutorials by Robert Waywell →

Prerequisites

Prerequisites

Steps

Next Steps

Time to Complete

15 Min


Intro

Streaming Lite runs .ccx files, which come from standard HANA Studio Streaming Analytics projects. We will be creating a streaming project called "freezer_monitoring_lite" in HANA Studio. After creating and compiling the Streaming Analytics project, we will obtain a .ccx file. This file is then uploaded to the Raspberry Pi and run by Streaming Lite.

Step 1 Build Streaming Analytics Project

  1. Create project "freezer_monitoring_lite"

    In HANA Studio, create a new HANA Streaming Analytics project called "freezer_monitoring_lite", in the “default” workspace. For detailed instructions on creating a project, you can refer back to the Streaming Analytics: Run and Test a Streaming Project tutorial.

  2. Copy CCL code

Copy the following CCL code into our "freezer_monitoring_lite" project. Remember to delete the NEWSTREAM element that is created by default in each new project.

SQL

CREATE SCHEMA FreezerTemperatureReading (
	SensorId string ,
	Temperature float,
	ReadingDate msdate,
	Id long) ;

CREATE INPUT STREAM isFreezerTemperatureReading
SCHEMA FreezerTemperatureReading AUTOGENERATE ( Id ) ;

/**@SIMPLEQUERY=AGGREGATE*/
CREATE OUTPUT WINDOW aAverageTemperatureBySensor
PRIMARY KEY DEDUCED
AS
	SELECT
		isFreezerTemperatureReading.SensorId MACHINEID ,
		last (isFreezerTemperatureReading.ReadingDate) EVENT_TIME ,
		'TEMP'EVENT_NAME ,
		'' EVENT_DESCRIPTION ,
		string ( avg ( isFreezerTemperatureReading.Temperature ) )
EVENT_VALUE ,
		count (isFreezerTemperatureReading.Temperature) rowct  
FROM isFreezerTemperatureReading KEEP EVERY 15 ROWS PER (SensorId)
GROUP BY isFreezerTemperatureReading.SensorId ;

/**@SIMPLEQUERY=FILTER*/
CREATE OUTPUT STREAM FilterEveryFifteenthRow
AS SELECT
	aAverageTemperatureBySensor.MACHINEID,
	aAverageTemperatureBySensor.EVENT_TIME,
	aAverageTemperatureBySensor.EVENT_NAME,
	aAverageTemperatureBySensor.EVENT_DESCRIPTION,
	aAverageTemperatureBySensor.EVENT_VALUE
FROM aAverageTemperatureBySensor
WHERE	aAverageTemperatureBySensor.rowct = 15 ;

Streaming Lite CCL Project
Streaming Lite CCL Project

The elements used in this project are:

  • isFreezerTemperatureReading

    Input stream for temperature sensor readings. In this tutorial, we will be using the streamingupload command line utility to write rows of data to this stream.

  • aAverageTemperatureBySensor

    • Incoming temperature values are grouped by SensorId

    • The average temperature is calculated for each SensorId based on the temperature values currently in the window for the given SensorId.

    • KEEP EVERY 15 ROWS PER (SensorId) policy specifies after receiving and processing the 15th value for a given SensorId, all values for that SensorId are cleared from the window and the count is reset to 0. This behavior is referred to as a “jumping” window. If the KEEP clause did not use the EVERY keyword, then it would be a sliding window in which the arrival of the nth value would push out the n-15th value. (The arrival of the 16th value would push out the 1st value, the 17th value would push out the 2nd value)

    • There is a counter to count the number of rows currently in the window

    • Maps the input schema into the schema that our SDS project freezer_monitoring uses

  • FilterEveryFifteenthRow

    • This filter allows a row through when the aAverageTemperatureBySensor counter equals 15 for a given SensorId

    • Result is that for every 15 rows that enter the project for a given SensorId, one row is output from the filter for that SensorId

  1. Compile

After creating our streaming project, compile it to generate the .ccx file. It will be located in the bin/ directory of our project folder.

Compile Streaming Project
Compile Streaming Project

For the question below, select the correct answer, and click Validate.

Step 2 Deploy Streaming Lite
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 2
1. Build Streaming Analytics Project 2. Deploy Streaming Lite
Next