Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This document describes the basic concepts of the Continuous Query Language (CQL) of Odysseus and shows how to use the language. The Continuous Query Language (CQL) is a SQL based declarative query language. This document shows how to formulate queries with CQL.

Create Streams

The create stream statement is used to tell Odysseus where the data comes from, this normally opens a connection to a source, e.g. a sensor or server.

The stream consists of a name "category", a schema and some connection properties (...)

Code Block
themeEclipse
languagesql
linenumberstrue
CREATE STREAM category (id INTEGER, name STRING, description STRING, parentid INTEGER) ....

Drop Streams

You can drop a stream with:

Code Block
themeEclipse
languagesql
linenumberstrue
DROP STREAM category

Since this statement would return an error if the stream "category" does not exist, you can add "IF EXISTS" to avoid this error (it checks, if the stream is existing before running the drop)

Code Block
themeEclipse
languagesql
linenumberstrue
DROP STREAM category IF EXISTS

Continuous Query

In summary, a CQL statement is like a SQL one, so the continuous query consists of a select, a from, a where, a goup and a having part. 

Select

 

From

 

Where

 

Group By