Table specs

    Table is not allowed to use alone in eKuiper. It is only recommended to join with streams. When joining with stream, table will be updated continuously when new event coming. However, only events arriving on the stream side trigger downstream updates and produce join output.

    Table supports almost the same syntax as streams. To create a table, run the below SQL:

    Table also supports all . Thus, all the source type are also supported in table. Many sources are not batched which have one event at any given time point, which means the table will always have only one event. An additional property to specify the size of the table snapshot so that the table can hold an arbitrary amount of history data.

    Usage scenarios

    Typically, table will be joined with stream with or without a window. When joining with stream, table data won’t affect the downstream updata, it is treated like a static referenced data although it may be updated internally.

    In this example, a table table1 is created to read json data from file lookup.json. Then in the rule, is joined with the stream demo so that the stream can lookup the name from the id.

    The content of lookup.json file should be an array of objects. Below is an example:

    Filter by history state

    In this example, a table is created to record the trigger state from mqtt topic myTopic. In the rule, the data of demo stream is filtered with the current trigger state.