-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmodel.xml
More file actions
161 lines (161 loc) · 8.74 KB
/
model.xml
File metadata and controls
161 lines (161 loc) · 8.74 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<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="layout">{"contquery_01":{"Customers":{"x":355,"y":-295},"FullOuterJoin":{"x":460,"y":-60},"InnerJoin":{"x":80,"y":165},"LeftOuterJoin":{"x":300,"y":165},"Loyalty":{"x":570,"y":-295},"Orders":{"x":90,"y":-115},"RightOuterJoin":{"x":520,"y":165}}}</meta>
<meta id="studioTags">Example</meta>
</metadata>
<contqueries>
<contquery name="contquery_01">
<windows>
<window-source index="pi_EMPTY" pubsub="true" name="Orders">
<description><![CDATA[This Source window provides the information on which products were ordered by the customer.]]></description>
<schema>
<fields>
<field name="OrderID" type="string" key="true"/>
<field name="CustomerID" type="int32"/>
<field name="Product" type="string"/>
<field name="Amount" type="int32"/>
</fields>
</schema>
<connectors>
<connector class="fs" name="orders_Connector">
<properties>
<property name="type"><![CDATA[pub]]></property>
<property name="header"><![CDATA[1]]></property>
<property name="fsname"><![CDATA[@ESP_PROJECT_HOME@/test_files/orders.csv]]></property>
<property name="fstype"><![CDATA[csv]]></property>
</properties>
</connector>
</connectors>
</window-source>
<window-source index="pi_RBTREE" pubsub="true" name="Customers">
<description><![CDATA[The Source window in this model receives input data from a CSV file containing a list of customers. This gives us reference data for the orders which will be coming in from the Orders source window.]]></description>
<schema>
<fields>
<field name="CustomerID" type="int32" key="true"/>
<field name="CustomerName" type="string"/>
<field name="City" type="string"/>
</fields>
</schema>
<connectors>
<connector class="fs" name="customers_Connector">
<properties>
<property name="type"><![CDATA[pub]]></property>
<property name="header"><![CDATA[1]]></property>
<property name="fsname"><![CDATA[@ESP_PROJECT_HOME@/test_files/customers.csv]]></property>
<property name="fstype"><![CDATA[csv]]></property>
</properties>
</connector>
</connectors>
</window-source>
<window-join index="pi_RBTREE" pubsub="true" name="InnerJoin">
<description><![CDATA[Shows only records where CustomerID exists in both tables. Records are matched based on the CustomerID key.]]></description>
<join type="inner" left-index="pi_EMPTY">
<conditions>
<fields left="CustomerID" right="CustomerID"/>
</conditions>
</join>
<output>
<field-expr name="CustomerID" type="int32"><![CDATA[l_CustomerID]]></field-expr>
<field-expr name="Product" type="string"><![CDATA[l_Product]]></field-expr>
<field-expr name="Amount" type="int32"><![CDATA[l_Amount]]></field-expr>
<field-expr name="CustomerName" type="string"><![CDATA[r_CustomerName]]></field-expr>
<field-expr name="City" type="string"><![CDATA[r_City]]></field-expr>
<field-expr name="Loyalty" type="string"><![CDATA[r_Loyalty]]></field-expr>
</output>
</window-join>
<window-join name="LeftOuterJoin">
<description><![CDATA[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.]]></description>
<join type="leftouter" left-index="pi_EMPTY">
<conditions>
<fields left="CustomerID" right="CustomerID"/>
</conditions>
</join>
<output>
<field-expr name="CustomerID" type="int32"><![CDATA[l_CustomerID]]></field-expr>
<field-expr name="Product" type="string"><![CDATA[l_Product]]></field-expr>
<field-expr name="Amount" type="int32"><![CDATA[l_Amount]]></field-expr>
<field-expr name="CustomerName" type="string"><![CDATA[r_CustomerName]]></field-expr>
<field-expr name="City" type="string"><![CDATA[r_City]]></field-expr>
<field-expr name="Loyalty" type="string"><![CDATA[r_Loyalty]]></field-expr>
</output>
</window-join>
<window-join name="RightOuterJoin">
<join type="rightouter">
<conditions>
<fields left="CustomerID" right="CustomerID"/>
</conditions>
</join>
<output>
<field-expr name="CustomerName" type="string"><![CDATA[l_CustomerName]]></field-expr>
<field-expr name="City" type="string"><![CDATA[l_City]]></field-expr>
<field-expr name="Loyalty" type="string"><![CDATA[l_Loyalty]]></field-expr>
<field-expr name="CustomerID" type="int32"><![CDATA[r_CustomerID]]></field-expr>
<field-expr name="Product" type="string"><![CDATA[r_Product]]></field-expr>
<field-expr name="Amount" type="int32"><![CDATA[r_Amount]]></field-expr>
</output>
</window-join>
<window-join name="FullOuterJoin">
<description><![CDATA[FullOuterJoin combines Customers and Loyalty, so that downstream you have a unified view of customer + loyalty info.]]></description>
<join type="fullouter">
<conditions>
<fields left="CustomerID" right="CustomerID"/>
</conditions>
</join>
<output>
<field-expr name="CustomerName" type="string"><![CDATA[l_CustomerName]]></field-expr>
<field-expr name="City" type="string"><![CDATA[l_City]]></field-expr>
<field-expr name="Loyalty" type="string"><![CDATA[r_Loyalty]]></field-expr>
</output>
</window-join>
<window-source name="Loyalty">
<description><![CDATA[The Source window in this model receives input data from a CSV file containing a list of customers loyalty information. For example, gold, silver or bronze. A complete customer picture is obtained by joining loyalty with Customers.]]></description>
<schema>
<fields>
<field name="CustomerID" type="int32" key="true"/>
<field name="Loyalty" type="string"/>
</fields>
</schema>
<connectors>
<connector class="fs" name="Loyalty_Connector">
<properties>
<property name="type"><![CDATA[pub]]></property>
<property name="header"><![CDATA[1]]></property>
<property name="fsname"><![CDATA[@ESP_PROJECT_HOME@/test_files/loyalty.csv]]></property>
<property name="fstype"><![CDATA[csv]]></property>
</properties>
</connector>
</connectors>
</window-source>
</windows>
<edges>
<description/>
<edge source="Orders" target="InnerJoin" role="left"/>
<edge source="Orders" target="LeftOuterJoin" role="left"/>
<edge source="Customers" target="FullOuterJoin" role="left"/>
<edge source="Loyalty" target="FullOuterJoin" role="right"/>
<edge source="FullOuterJoin" target="InnerJoin" role="right"/>
<edge source="FullOuterJoin" target="LeftOuterJoin" role="right"/>
<edge source="FullOuterJoin" target="RightOuterJoin" role="left"/>
<edge source="Orders" target="RightOuterJoin" role="right"/>
</edges>
</contquery>
</contqueries>
<project-connectors>
<connector-groups>
<connector-group name="Customers">
<connector-entry connector="contquery_01/Customers/customers_Connector" state="finished"/>
</connector-group>
<connector-group name="Loyalty">
<connector-entry connector="contquery_01/Loyalty/Loyalty_Connector" state="finished"/>
</connector-group>
<connector-group name="Orders">
<connector-entry connector="contquery_01/Orders/orders_Connector" state="running"/>
</connector-group>
</connector-groups>
<edges>
<edge source="Customers" target="Loyalty"/>
<edge source="Loyalty" target="Orders"/>
</edges>
</project-connectors>
</project>