Produce a simple query that transforms the schema or field values of each incoming record. Each incoming event produces one new output event from the fields defined by the column expressions.
In the Visual editor Palette, in Streams and Windows, select Compute ().
Select a location in the diagram and click to
add the shape.
Attach the compute object to the stream or window that provides input to this query.
Attach compute objects to any stream, window, or Flex operator. Compute objects can have only one input. Any attempt to connect more than one input source is blocked.
Add columns:
Click Copy Columns from Input () in the shape toolbar to copy input fields into the schema for this query.
Add
additional columns by clicking Add Column Expression in
the shape toolbar.
Edit a column
expression by double-clicking to open the inline editor, or by selecting the expression
and pressing Ctrl+F2 to open it in the pop-up
editor.
Tip:
When entering column names and their datatypes, use
Tab to easily move between cells in the table.
Add column expressions , as necessary.
Modify column expressions by selecting and modifying them directly, or by editing the corresponding fields in the Properties view.
Use the toggle option to designate the compute object as INPUT or
OUTPUT. By default, computes are Output.