2.1 CQL structure

Stream Data Platform - AF analyzes the stream data input into the stream data processing engine using predefined scenarios and outputs the analysis result that meets your objectives.

A scenario is defined using the CQL query language.

The following table shows the CQL structures used by Stream Data Platform - AF.

Table 2-1 CQL structures used by Stream Data Platform - AF

No.CQL classificationUsageExample of applicable CQL commands
1Definition CQLDefines streams and queries so they can be processed by the stream data processing engine.REGISTER STREAM
REGISTER QUERY, etc.
2Data manipulation CQLDefines the detailed stream data processing to be performed by a query. It is entered after the REGISTER QUERY clause.
In data manipulation CQL, the following three types of operations can be defined in queries:
  • Window operations
  • Relation operations
  • Stream operations
SELECT
FROM
WHERE
GROUP BY
HAVING
UNION, etc.

Details about CQL are explained in 4. CQL Reference.

The following figure shows an example of using CQL to specify a query.

Figure 2-1 Example of specifying a query using CQL

[Figure]

Definition CQL specifies the following information to the stream data processing engine:

Data manipulation CQL defines the operations in a scenario that will analyze the data retrieved from the input stream queue.

The following figure shows the relationship between the window operations, relation operations, and stream operations defined in a query.

Figure 2-2 Relationship between operations

[Figure]

Each of these operations is explained below. The numbers in this explanation correspond to the numbers in the figure.

  1. The data to be operated on is specified using a window operation. The stream data processing engine cannot process time-series input stream data or output stream data as is. You must use a window operation to isolate a tuple (a set of n-term pairs with a particular lifespan) (relation) from the stream data before the engine can process the data. A relation specifying the data to be operated on is called an input relation.
    A window operation uses the ROWS window, RANGE window, PARTITION BY window, or the like to specify the data to be operated on based on the number of tuples or their time stamps.
  2. A relation operation is used to perform the analysis that suits your purpose.
    A relation operation performs operations such as selection, linkage, and aggregation to extract the resulting data as a relation. This relation is called an output relation.
  3. A stream operation converts the data from a relation operation into stream data. Based on the changes specified in the output relation, data can be added, deleted, and grouped before it is output as stream data.