Simple Queries

Accomplish most common querying tasks using a set of queries available in the Visual editor: filter, aggregate, join, compute, union, and pattern.

The tools for these six queries are available as objects in the Palette, in Streams and Windows.
CCL Equivalents for Simple Queries (Summary)
Simple Query CCL
Filter WHERE clause
Aggregate GROUP BY clause
Join FROM clause, WHERE clause, ON clause
Compute Simple SELECT statement, with column expressions
Union UNION clause
Pattern MATCHING clause

Simple Queries from CCL Statements

If you create queries in CCL and want them to appear as simple query shapes in the Visual editor, you must insert a comment immediately preceding the CREATE STREAM, CREATE WINDOW, or CREATE DELTA STREAM statement, in the form:
/**@SIMPLEQUERY=QUERY_TYPE*/
where QUERY_TYPE is the shape name in the Visual editor.

For example, this comment causes a CREATE WINDOW statement to map to an Aggregate shape in the Visual editor: /**@SIMPLEQUERY=AGGREGATE*/ .

Without this comment immediately preceding the CREATE WINDOW statement, the Visual editor shows the generic Derived Window shape.
Note: You cannot modify CCL code in the CCL editor and in the Visual editor concurrently. If the Visual editor is open, then the CCL editor becomes read-only.

CCL Statements from Simple Queries

When you create a simply query from the Palette, the CCL element it creates is based on these rules:
  • If the input for the filter object is a stream, the filter object creates a stream. If the source is a window, delta stream, or flex stream, the filter object creates a delta stream.
  • All aggregate objects create a window.
  • If the input for a compute object is a stream, the compute object creates a stream. If the source is a window, delta stream, or flex stream, the compute object creates a delta stream.
  • If a join object takes input only from streams, then the join object creates a stream. If the source is from one or more windows, delta streams, or flex streams, then the join object creates a window. In a stream-window join, the join object creates a stream.
  • If the input of a union object is a stream, the union object creates a stream. If the source is a window, delta stream, or flex stream, the union object creates a delta stream.
  • All pattern objects create a stream.
Related concepts
Queries in CCL
Related tasks
Adding Shapes to a Diagram
Connecting Elements
Creating and Modifying Simple Queries: Filter
Creating and Modifying Simple Queries: Aggregate
Creating and Modifying Simple Queries: Compute
Creating and Modifying Simple Queries: Join
Creating and Modifying Simple Queries: Union
Creating and Modifying Simple Queries: Pattern
Related reference
Shape Reference