-
Notifications
You must be signed in to change notification settings - Fork 5
/
model.xml
90 lines (89 loc) · 5.48 KB
/
model.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<project name="join" pubsub="auto" threads="1" heartbeat-interval="1" luaroot="@ESP_PROJECT_OUTPUT@/luaroot">
<description><![CDATA[A Join window receives events from a left input window and a right input window. It produces a single output stream of joined events. Joined events are created according to a user-specified join type and user-defined join conditions. This model joins a set of trades with their corresponding traders.]]></description>
<metadata>
<meta id="studioUploadedBy">user1</meta>
<meta id="studioUploaded">1709646923753</meta>
<meta id="studioModifiedBy">user1</meta>
<meta id="studioModified">1709647031070</meta>
<meta id="layout">{"contquery_01":{"joinWindow":{"x":50,"y":175},"sourceWindow_01":{"x":290,"y":50},"sourceWindow_02":{"x":50,"y":50}}}</meta>
<meta id="studioTags">Example</meta>
</metadata>
<contqueries>
<contquery name="contquery_01">
<windows>
<window-source index="pi_HASH" pubsub="true" name="sourceWindow_01">
<description><![CDATA[The first Source window in this model receives input data from a CSV file containing a group of stock market share purchases. The input data specifies the trade ID, the stock market symbol of the purchased stock, the quantity of stock purchased per trade, the cost of purchasing the stock per trade, and the trader ID.]]></description>
<schema>
<fields>
<field name="ID" type="int32" key="true"/>
<field name="symbol" type="string"/>
<field name="quantity" type="int32"/>
<field name="price" type="double"/>
<field name="traderID" type="int32"/>
</fields>
</schema>
<connectors>
<connector class="fs" name="input_join1">
<properties>
<property name="type"><![CDATA[pub]]></property>
<property name="fsname"><![CDATA[@ESP_PROJECT_HOME@/test_files/input1.csv]]></property>
<property name="fstype"><![CDATA[csv]]></property>
</properties>
</connector>
</connectors>
</window-source>
<window-source index="pi_RBTREE" pubsub="true" name="sourceWindow_02">
<description><![CDATA[The second Source window in this model receives input data from a CSV file containing the names of the traders that purchased the shares that are streamed through the model. The input data specifies the trader ID and the trader name.]]></description>
<schema>
<fields>
<field name="traderID" type="int32" key="true"/>
<field name="name" type="string"/>
</fields>
</schema>
<connectors>
<connector class="fs" name="input_join2">
<properties>
<property name="type"><![CDATA[pub]]></property>
<property name="fsname"><![CDATA[@ESP_PROJECT_HOME@/test_files/input2.csv]]></property>
<property name="fstype"><![CDATA[csv]]></property>
</properties>
</connector>
</connectors>
</window-source>
<window-join index="pi_RBTREE" pubsub="true" name="joinWindow">
<description><![CDATA[The join order is determined at the edge level of the project. The left window is the first window that is defined as a connecting edge to the Join window. The second window that is defined as a connecting edge is the right window. In this model, sourceWindow_01, containing the trades, has been designated as the left window. SourceWindow_02, containing the trader names, has been designated as the right window.
This model uses a left-outer join type. A left-outer join produces joined output events for every event that arrives from the left window. Joined events are created even when there are no matching events from the right window. This model uses expressions to calculate output fields. The join condition specifies what fields from the left and right events are used to generate matches. In this model, the traderID field is used to generate matches. The Join window produces a single output event for each match. The Join window specifies what fields from the left and right events are included in the output event.]]></description>
<join type="leftouter">
<conditions>
<fields left="traderID" right="traderID"/>
</conditions>
</join>
<output>
<field-expr name="symbol" type="string"><![CDATA[l_symbol]]></field-expr>
<field-expr name="quantity" type="int32"><![CDATA[l_quantity]]></field-expr>
<field-expr name="price" type="double"><![CDATA[l_price]]></field-expr>
<field-expr name="traderName" type="string"><![CDATA[r_name]]></field-expr>
</output>
</window-join>
</windows>
<edges>
<description/>
<edge source="sourceWindow_01" target="joinWindow"/>
<edge source="sourceWindow_02" target="joinWindow" role="right"/>
</edges>
</contquery>
</contqueries>
<project-connectors>
<connector-groups>
<connector-group name="Traders">
<connector-entry connector="contquery_01/sourceWindow_02/input_join2" state="finished"/>
</connector-group>
<connector-group name="Trades">
<connector-entry connector="contquery_01/sourceWindow_01/input_join1" state="running"/>
</connector-group>
</connector-groups>
<edges>
<edge source="Traders" target="Trades"/>
</edges>
</project-connectors>
</project>