Top
Interstage Big DataComplex Event Processing Server V1.1.0 Developer's Reference
FUJITSU Software

1.3.1 CREATE WINDOW Statement

Generate a named window. There are two generation methods: generation from an existing event type, and generation in which a property name and type are defined.

1.3.1.1 Generation from Existing Event Type

Syntax:

create window windowName.view
[as] [select property [, ...] from] eventTypeOrWindowName
[insert [where filterExpression]]

To generate a named window, specify the name of the named window being created (windowName), and specify one or more data window views (view). An existing event type (event stream) name cannot be used for the windowName.

Use the SELECT clause to specify to quote property from an existing eventTypeOrWindowName.

If quoting properties from an existing named window, the INSERT clause can be used to fetch data from an existing named window when the new named window is generated. Filtering conditions can be specified at filterExpression.

1.3.1.2 Generation with Property Name and Type Specification

Syntax:

create window windowName.view [as] ( propertyName propertyType [,propertyName propertyType] [, ...] )

At propertyName and propertyType, specify the property names and data types of the events to be entered in the named window.

1.3.1.3 Virtual Data Window Generation

A Virtual Data Window that references the Interstage Terracotta BigMemory Max (hereafter referred to as "Terracotta") cache can be created by specifying vdw:ehcache() in the CREATE WINDOW statement. There are two methods of specification:

Setting type information in the event type definition

Syntax:

create window windowName.vdw:ehcache("cacheName", "nameOfPropertyCorrespondingToCacheKey") as eventTypeDevelopmentAssetID;

This definition method uses the event type definition. Event type definitions defined in XML format cannot be specified.

Only CSV format event type definitions can be specified. (An event is cached as a java.util.HashMap<String,Object> object.)

As the arguments of vdw:ehcache(), specify the name of the cache accessed by a Virtual Data Window and the name of the property corresponding to the cache key.

Setting by direct description of type information

Syntax:

create window windowName.vdw:ehcache("cacheName", "nameOfPropertyCorrespondingToCacheKey") as (propertyName1 type1, propertyName2 type2, ...);

This definition method specifies type information directly. Refer to "1.3.1.4 Supported Terracotta Cache Formats" for information on types that can be specified for each property.

Example

Virtual Data Window creation example

create window CustomerWindow.vdw:ehcache("CustomerCache", "id") as (id string, name string, address string);

This Virtual Data Window creation example shows direct description of type information.

This example references the Terracotta cache CustomerCache. The key is the id. The name of the window being generated is CustomerWindow, and the properties are as follows:

Property name

Type

id

string

name

string

address

string

Note

Do not specify another view at the same time as a Virtual Data Window

Do not specify another view such as win:length(1) at the same time as the vdw:ehcache() specification in a CREATE WINDOW statement that defines a Virtual Data Window. Specifying another view does not cause a syntax error, but the view specification cannot be used to operate Terracotta cache data (even if you specify win:length(1), the number of events in the cache will not be "1").

1.3.1.4 Supported Terracotta Cache Formats

A Terracotta cache consists of key-value pairs. The cache referenced by BDCEP must have the following configuration:

Type specified for the key

Type used for the value

java.lang.String

java.util.HashMap<java.lang.String, java.lang.Object>

Each property to be specified in a complex event processing rule corresponds to each "HashMap" element above.

The table below shows the type that is compatible for the value of each "HashMap" element and the corresponding type in complex event processing rules.

Type used in each HashMap element

Corresponding type in complex event processing rules

java.lang.String

string

java.lang.Character

char/character

java.lang.Boolean

bool/boolean

java.lang.Byte

byte

java.lang.Short

short

java.lang.Integer

int/integer

java.lang.Long

long

java.lang.Float

float

java.lang.Double

double

The Terracotta cache key and "HashMap" to be specified for the value must have the following relationship:

The following figure illustrates this relationship.