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.
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.
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.
A Virtual Data Window that references the Interstage eXtreme Transaction Processing Server (hereafter referred to as XTP) cache can be created by specifying isxtp:vdw() in the CREATE WINDOW statement.
There are two writing methods: setting type information for the development asset ID defined in the event type definition, and setting by direct description of type information.
Syntax: Setting type information using the event type definition
create window windowName.isxtp:vdw() 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. (java.util.HashMap<String,Object> caches the value.)
Syntax: Setting by direct description of type information
create window windowName.isxtp:vdw() as (propertyName1 type1, propertyName2 type2, ...);
This definition method specifies type information directly.
The XTP cache is constructed using key and value. The cache referenced by this product must have the following configuration:
Type specified for key | Type used for value |
---|---|
java.lang.String | java.util.HashMap<java.lang.String, java.lang.Object> |
The properties specified using the CREATE WINDOW syntax correspond to the elements of the above HashMap.
The table below shows the types that can be used in HashMap element values.
Types used for HashMap elements |
---|
java.lang.String |
java.lang.Boolean |
java.lang.Byte |
java.lang.Integer |
java.lang.Long |
java.lang.Float |
java.lang.Double |
The table below shows the correspondence between types specified in properties and HashMap element types (ValueJava classes).
Property type | HashMap element type |
---|---|
string | java.lang.String |
char/character | (no corresponding type) |
bool/boolean | java.lang.Boolean |
byte | java.lang.Byte |
short | (no corresponding type) |
int/integer | java.lang.Integer |
long | java.lang.Long |
float | java.lang.Float |
double | java.lang.Double |
Example
Virtual Data Window creation example
@VDW(cacheName='CustomerCache',keyProperty='ID')
create window CustomerWindow.isxtp:vdw() as (id string, name string, address string);
This Virtual Data Window creation example shows direct description of type information.
This example references the XTP 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
Combination with the @VDW annotation is mandatory when using CREATE WINDOW to generate a Virtual Data Window. Refer to "1.1.8 Annotation" for information on the @VDW annotation.