Converting EventFlow to StreamSQL

Note

Conversion to StreamSQL is deprecated as of release 7.6.0.

You can use the EventFlow to StreamSQL Conversion Assistant to convert an EventFlow application to a StreamSQL application. In some cases, the converted file is only a starting point for further development, requiring further changes using the StreamSQL Editor.

Using the Conversion Assistant in StreamBase Studio

To convert an EventFlow application to its near equivalent in StreamSQL, follow these steps :

  • Open the Package Explorer in StreamBase Studio.

  • Select a project folder that contains an EventFlow application, and select an EventFlow application file.

  • Open the selected EventFlow file in Studio to make sure it and any referenced modules are free of typecheck errors.

  • [Optional] Go through the EventFlow application and look for stream field names that are the same as StreamSQL reserved words. Rename those fields, if any, making sure you correct all references to a field whose name changed.

  • In the Package Explorer, select the EventFlow .sbapp file you want to convert, click the right mouse button and select StreamBase > Convert to StreamSQL from the drop-down menu.

This creates a new StreamSQL application with the same name as the original EventFlow, but with the extension changed from .sbapp to .ssql. The resulting file is added to the current project folder. If a StreamSQL application already exists with that name, you are prompted for permission to replace it.

Limitations of the Conversion Assistant

The converter cannot handle certain constructs. When the converter encounters an unsupported construct, it displays a warning and places a WARN comment in the generated StreamSQL application, with the following format:

-- WARN: <message>

You must edit the generated StreamSQL application to resolve these problems. Restrictions include:

  • Aggregate operators with:

    • Multiple dimensions

    • Non-default optional windows settings. Specifically:

      • Tuple-based dimensions are never converted to partial windows, even if the dimension's Create partial windows option is set.

      • Field-based dimensions are always converted to partial windows, even if the dimension's Open windows before first tuple option is set.

    • Unlimited windows (windows that never close)

    • Non-default emission policies

  • Dynamic variables.

  • Gather operators where Output arrival time of last tuple is checked.

  • Explicitly specified input stream fields in Query operators that are connected to JDBC Table data constructs. In the StreamSQL APPLY JDBC statements, all of the input stream's fields are passed through.

    If your EventFlow restricts input fields using the explicitly specified fields option in the Pass Input tab, or a WHERE clause in the Query Settings SQL statement, the generated ssql code will contain a warning. For example:

    APPLY JDBC qa_test_1 "UPDATE Bikes SET WHERE make = 'Tianjin'" FROM UpdateStream INTO UpdateModelOut; -- WARN: StreamSQL must copy all of the input schema, not selected expressions

    For alternative StreamSQL coding, see the discussion of JDBC tables in APPLY Statement.

Query Table behavior differs in StreamSQL applications, as follows:

  • Using a set of arbitrary on-no-match values in a SELECT or UPDATE statement is not allowed, and these can only be nulls. SELECT operations with on-no-match values are replaced by inner joins returning null values, and DELETE operations return no output if no row is deleted.

  • Returning clauses in UPDATE and INSERT statements, and expressions for values in REPLACE statements, can only refer to fields in the newly inserted or updated rows (not streams, or the row being replaced).