Subversion Repositories SmartDukaan

Rev

Rev 5896 | Rev 5898 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5896 anupam.sin 1
<?xml version="1.0" encoding="UTF-8"?>
2
<transformation>
3
  <info>
4
    <name>repeatLoader</name>
5
    <description/>
6
    <extended_description/>
7
    <trans_version/>
8
    <trans_type>Normal</trans_type>
9
    <directory>&#47;</directory>
10
    <parameters>
11
    </parameters>
12
    <log>
13
<trans-log-table><connection/>
14
<schema/>
15
<table/>
16
<size_limit_lines/>
17
<interval/>
18
<timeout_days/>
19
<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STATUS</id><enabled>Y</enabled><name>STATUS</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name><subject/></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name><subject/></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name><subject/></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name><subject/></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name><subject/></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name><subject/></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>STARTDATE</id><enabled>Y</enabled><name>STARTDATE</name></field><field><id>ENDDATE</id><enabled>Y</enabled><name>ENDDATE</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>DEPDATE</id><enabled>Y</enabled><name>DEPDATE</name></field><field><id>REPLAYDATE</id><enabled>Y</enabled><name>REPLAYDATE</name></field><field><id>LOG_FIELD</id><enabled>Y</enabled><name>LOG_FIELD</name></field></trans-log-table>
20
<perf-log-table><connection/>
21
<schema/>
22
<table/>
23
<interval/>
24
<timeout_days/>
25
<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>SEQ_NR</id><enabled>Y</enabled><name>SEQ_NR</name></field><field><id>LOGDATE</id><enabled>Y</enabled><name>LOGDATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>INPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>INPUT_BUFFER_ROWS</name></field><field><id>OUTPUT_BUFFER_ROWS</id><enabled>Y</enabled><name>OUTPUT_BUFFER_ROWS</name></field></perf-log-table>
26
<channel-log-table><connection/>
27
<schema/>
28
<table/>
29
<timeout_days/>
30
<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>LOGGING_OBJECT_TYPE</id><enabled>Y</enabled><name>LOGGING_OBJECT_TYPE</name></field><field><id>OBJECT_NAME</id><enabled>Y</enabled><name>OBJECT_NAME</name></field><field><id>OBJECT_COPY</id><enabled>Y</enabled><name>OBJECT_COPY</name></field><field><id>REPOSITORY_DIRECTORY</id><enabled>Y</enabled><name>REPOSITORY_DIRECTORY</name></field><field><id>FILENAME</id><enabled>Y</enabled><name>FILENAME</name></field><field><id>OBJECT_ID</id><enabled>Y</enabled><name>OBJECT_ID</name></field><field><id>OBJECT_REVISION</id><enabled>Y</enabled><name>OBJECT_REVISION</name></field><field><id>PARENT_CHANNEL_ID</id><enabled>Y</enabled><name>PARENT_CHANNEL_ID</name></field><field><id>ROOT_CHANNEL_ID</id><enabled>Y</enabled><name>ROOT_CHANNEL_ID</name></field></channel-log-table>
31
<step-log-table><connection/>
32
<schema/>
33
<table/>
34
<timeout_days/>
35
<field><id>ID_BATCH</id><enabled>Y</enabled><name>ID_BATCH</name></field><field><id>CHANNEL_ID</id><enabled>Y</enabled><name>CHANNEL_ID</name></field><field><id>LOG_DATE</id><enabled>Y</enabled><name>LOG_DATE</name></field><field><id>TRANSNAME</id><enabled>Y</enabled><name>TRANSNAME</name></field><field><id>STEPNAME</id><enabled>Y</enabled><name>STEPNAME</name></field><field><id>STEP_COPY</id><enabled>Y</enabled><name>STEP_COPY</name></field><field><id>LINES_READ</id><enabled>Y</enabled><name>LINES_READ</name></field><field><id>LINES_WRITTEN</id><enabled>Y</enabled><name>LINES_WRITTEN</name></field><field><id>LINES_UPDATED</id><enabled>Y</enabled><name>LINES_UPDATED</name></field><field><id>LINES_INPUT</id><enabled>Y</enabled><name>LINES_INPUT</name></field><field><id>LINES_OUTPUT</id><enabled>Y</enabled><name>LINES_OUTPUT</name></field><field><id>LINES_REJECTED</id><enabled>Y</enabled><name>LINES_REJECTED</name></field><field><id>ERRORS</id><enabled>Y</enabled><name>ERRORS</name></field><field><id>LOG_FIELD</id><enabled>N</enabled><name>LOG_FIELD</name></field></step-log-table>
36
    </log>
37
    <maxdate>
38
      <connection/>
39
      <table/>
40
      <field/>
41
      <offset>0.0</offset>
42
      <maxdiff>0.0</maxdiff>
43
    </maxdate>
44
    <size_rowset>10000</size_rowset>
45
    <sleep_time_empty>50</sleep_time_empty>
46
    <sleep_time_full>50</sleep_time_full>
47
    <unique_connections>N</unique_connections>
48
    <feedback_shown>Y</feedback_shown>
49
    <feedback_size>50000</feedback_size>
50
    <using_thread_priorities>Y</using_thread_priorities>
51
    <shared_objects_file/>
52
    <capture_step_performance>N</capture_step_performance>
53
    <step_performance_capturing_delay>1000</step_performance_capturing_delay>
54
    <step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
55
    <dependencies>
56
    </dependencies>
57
    <partitionschemas>
58
    </partitionschemas>
59
    <slaveservers>
60
    </slaveservers>
61
    <clusterschemas>
62
    </clusterschemas>
63
  <created_user>-</created_user>
64
  <created_date>2012&#47;08&#47;26 11:16:19.521</created_date>
65
  <modified_user>-</modified_user>
66
  <modified_date>2012&#47;08&#47;26 11:16:19.521</modified_date>
67
  </info>
68
  <notepads>
69
  </notepads>
70
  <connection>
71
    <name>salesLocal</name>
72
    <server>localhost</server>
73
    <type>MYSQL</type>
74
    <access>Native</access>
75
    <database>sales</database>
76
    <port>3306</port>
77
    <username>root</username>
78
    <password>Encrypted 2be98afc86aa7f2e4b811a1608cc2fd8a</password>
79
    <servername/>
80
    <data_tablespace/>
81
    <index_tablespace/>
82
    <attributes>
83
      <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
84
      <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
85
      <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
86
      <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
87
      <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
88
      <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
89
      <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
90
      <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
91
      <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
92
      <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
93
    </attributes>
94
  </connection>
95
  <connection>
96
    <name>tranLocal</name>
97
    <server>localhost</server>
98
    <type>MYSQL</type>
99
    <access>Native</access>
100
    <database>transaction</database>
101
    <port>3306</port>
102
    <username>root</username>
103
    <password>Encrypted 2be98afc86aa7f2e4b811a1608cc2fd8a</password>
104
    <servername/>
105
    <data_tablespace/>
106
    <index_tablespace/>
107
    <attributes>
108
      <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
109
      <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
110
      <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
111
      <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
112
      <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
113
      <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
114
      <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
115
      <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
116
      <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
117
      <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
118
    </attributes>
119
  </connection>
120
  <connection>
121
    <name>tranProd</name>
5897 anupam.sin 122
    <server>192.168.190.113</server>
5896 anupam.sin 123
    <type>MYSQL</type>
124
    <access>Native</access>
125
    <database>transaction</database>
126
    <port>3306</port>
127
    <username>root</username>
128
    <password>Encrypted 2be98afc86aa7f2e4b811a1608cc2fd8a</password>
129
    <servername/>
130
    <data_tablespace/>
131
    <index_tablespace/>
132
    <attributes>
133
      <attribute><code>EXTRA_OPTION_MYSQL.defaultFetchSize</code><attribute>500</attribute></attribute>
134
      <attribute><code>EXTRA_OPTION_MYSQL.useCursorFetch</code><attribute>true</attribute></attribute>
135
      <attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
136
      <attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
137
      <attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
138
      <attribute><code>PORT_NUMBER</code><attribute>3306</attribute></attribute>
139
      <attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
140
      <attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
141
      <attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>N</attribute></attribute>
142
      <attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
143
    </attributes>
144
  </connection>
145
  <order>
146
  <hop> <from>customersInput</from><to>Table output</to><enabled>Y</enabled> </hop>  </order>
147
  <step>
148
    <name>Table output</name>
149
    <type>TableOutput</type>
150
    <description/>
151
    <distribute>Y</distribute>
152
    <copies>1</copies>
153
         <partitioning>
154
           <method>none</method>
155
           <schema_name/>
156
           </partitioning>
157
    <connection>salesLocal</connection>
158
    <schema>sales</schema>
159
    <table>repeatSales</table>
160
    <commit>1000</commit>
161
    <truncate>Y</truncate>
162
    <ignore_errors>N</ignore_errors>
163
    <use_batch>Y</use_batch>
164
    <specify_fields>N</specify_fields>
165
    <partitioning_enabled>N</partitioning_enabled>
166
    <partitioning_field/>
167
    <partitioning_daily>N</partitioning_daily>
168
    <partitioning_monthly>Y</partitioning_monthly>
169
    <tablename_in_field>N</tablename_in_field>
170
    <tablename_field/>
171
    <tablename_in_table>Y</tablename_in_table>
172
    <return_keys>N</return_keys>
173
    <return_field/>
174
    <fields>
175
        <field>
176
          <column_name>customer_id</column_name>
177
          <stream_name>customer_id</stream_name>
178
        </field>
179
        <field>
180
          <column_name>orderCount</column_name>
181
          <stream_name>orderCount</stream_name>
182
        </field>
183
        <field>
184
          <column_name>grandTotal</column_name>
185
          <stream_name>grandTotal</stream_name>
186
        </field>
187
        <field>
188
          <column_name>date_id1</column_name>
189
          <stream_name>date_id1</stream_name>
190
        </field>
191
        <field>
192
          <column_name>date_id2</column_name>
193
          <stream_name>date_id2</stream_name>
194
        </field>
195
        <field>
196
          <column_name>paymode1</column_name>
197
          <stream_name>paymode1</stream_name>
198
        </field>
199
        <field>
200
          <column_name>paymode2</column_name>
201
          <stream_name>paymode2</stream_name>
202
        </field>
203
        <field>
204
          <column_name>price_range1</column_name>
205
          <stream_name>price_range1</stream_name>
206
        </field>
207
        <field>
208
          <column_name>price_range2</column_name>
209
          <stream_name>price_range2</stream_name>
210
        </field>
211
        <field>
212
          <column_name>pin</column_name>
213
          <stream_name>pin</stream_name>
214
        </field>
215
        <field>
216
          <column_name>session_source_type1</column_name>
217
          <stream_name>session_source_type1</stream_name>
218
        </field>
219
        <field>
220
          <column_name>session_source_url1</column_name>
221
          <stream_name>session_source_url1</stream_name>
222
        </field>
223
        <field>
224
          <column_name>session_source_type2</column_name>
225
          <stream_name>session_source_type2</stream_name>
226
        </field>
227
        <field>
228
          <column_name>session_source_url2</column_name>
229
          <stream_name>session_source_url2</stream_name>
230
        </field>
231
        <field>
232
          <column_name>item1</column_name>
233
          <stream_name>item1</stream_name>
234
        </field>
235
        <field>
236
          <column_name>item2</column_name>
237
          <stream_name>item2</stream_name>
238
        </field>
239
        <field>
240
          <column_name>daysToPurchase</column_name>
241
          <stream_name>daysToPurchase</stream_name>
242
        </field>
243
    </fields>
244
     <cluster_schema/>
245
 <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
246
      <xloc>589</xloc>
247
      <yloc>125</yloc>
248
      <draw>Y</draw>
249
      </GUI>
250
    </step>
251
 
252
  <step>
253
    <name>customersInput</name>
254
    <type>TableInput</type>
255
    <description/>
256
    <distribute>Y</distribute>
257
    <copies>1</copies>
258
         <partitioning>
259
           <method>none</method>
260
           <schema_name/>
261
           </partitioning>
262
    <connection>tranProd</connection>
263
    <sql>select 
264
	o1.customer_id, temp.orderCount, 
265
	case when temp.grandTotal&lt;250 then 0 when temp.grandTotal&lt;500 then 1 when temp.grandTotal&lt;1000 then 2 when temp.grandTotal&lt;2000 then 3 when temp.grandTotal &lt; 5000 then 4 when temp.grandTotal &lt; 10000 then 5 when temp.grandTotal &lt; 15000 then 6 when temp.grandTotal &lt;20000 then 7 when temp.grandTotal &lt; 50000 then 8 else 9 end as grandTotal, 
266
	datediff(o1.created_timestamp, &apos;20101231&apos;) as date_id1, datediff(o2.created_timestamp, &apos;20101231&apos;) as date_id2, 
267
	case when o1.cod = 1 then 1 when o1.cod = 0 then 0 else null end as paymode1,
268
	case when o2.cod = 1 then 1 when o2.cod = 0 then 0 else null end as paymode2, 
269
	case when o1.total_amount&lt;250 then 0 when o1.total_amount&lt;500 then 1 when o1.total_amount&lt;1000 then 2 when o1.total_amount&lt;2000 then 3 when o1.total_amount &lt; 5000 then 4 when o1.total_amount &lt; 10000 then 5 when o1.total_amount &lt; 15000 then 6 when o1.total_amount &lt;20000 then 7 when o1.total_amount &lt; 50000 then 8 else 9 end as price_range1,
270
	case when o2.total_amount is null then 99 when o2.total_amount&lt;250 then 0 when o2.total_amount&lt;500 then 1 when o2.total_amount&lt;1000 then 2 when o2.total_amount&lt;2000 then 3 when o2.total_amount &lt; 5000 then 4 when o2.total_amount &lt; 10000 then 5 when o2.total_amount &lt; 15000 then 6 when o2.total_amount &lt;20000 then 7 when o2.total_amount &lt; 50000 then 8 else 9 end as price_range2,
271
	o1.customer_pincode as pin, 
272
	case when t1.session_source is null then &apos;Unknown&apos; when t1.session_source like &apos;DIRECT%&apos; then &apos;Direct&apos; when t1.session_source like &apos;ORGANIC%&apos; then &apos;Organic&apos; when t1.session_source like &apos;PAID%&apos; then &apos;Paid&apos; else &apos;Referer&apos; end as session_source_type1,
273
	SUBSTRING_INDEX(REPLACE(REPLACE(SUBSTR(t1.session_source, LOCATE(&apos;http:&#47;&#47;&apos;, LCASE(t1.session_source)), LENGTH(t1.session_source)), &apos;http:&#47;&#47;&apos;, &apos;&apos;), &apos;www.&apos;, &apos;&apos;), &apos;&#47;&apos;, 1) as session_source_url1, 
274
	case when t2.session_source is null then &apos;Unknown&apos; when t2.session_source like &apos;DIRECT%&apos; then &apos;Direct&apos; when t2.session_source like &apos;ORGANIC%&apos; then &apos;Organic&apos; when t2.session_source like &apos;PAID%&apos; then &apos;Paid&apos; else &apos;Referer&apos; end as session_source_type2,
275
	SUBSTRING_INDEX(REPLACE(REPLACE(SUBSTR(t2.session_source, LOCATE(&apos;http:&#47;&#47;&apos;, LCASE(t2.session_source)), LENGTH(t2.session_source)), &apos;http:&#47;&#47;&apos;, &apos;&apos;), &apos;www.&apos;, &apos;&apos;), &apos;&#47;&apos;, 1) as session_source_url2, 
276
	l1.item_id as item1, l2.item_id as item2, 
277
	case when datediff(o1.created_timestamp, u.active_since) &gt; 30 then 0 when datediff(o1.created_timestamp, u.active_since) &gt; 15 then 1
278
	when datediff(o1.created_timestamp, u.active_since) &gt; 7 then 2 when datediff(o1.created_timestamp, u.active_since) &gt; 2 then 3
279
	when datediff(o1.created_timestamp, u.active_since) &gt; 1 then 4 else 5 end as daysToPurchase
280
from 
281
	(select (count(o.id)+1) as orderCount, m.min_orderId, min(o.id) as second_min_orderId, m.grandTotal 
282
	from `order` o 
283
	right join 
284
		(select customer_id, sum(total_amount) as grandTotal, min(id) as min_orderId 
285
		from `order` o 
286
		where status not in (0,1,8,11,28,29,30,47,49,53,55,69,71,73,75,78) 
287
		group by customer_id) as m 
288
	on (o.customer_id = m.customer_id and o.id &gt; m.min_orderId and o.status not in (0,1,8,11,28,29,30,47,49,53,55,69,71,73,75,78)) 
289
	group by m.customer_id) as temp 
290
join `order` o1 on temp.min_orderId = o1.id 
291
left join `order` o2 on o2.id = temp.second_min_orderId 
292
left join transaction t1 on o1.transaction_id = t1.id 
293
left join transaction t2 on o2.transaction_id = t2.id 
294
left join lineitem l1 on o1.id = l1.order_id 
295
left join lineitem l2 on l2.order_id = o2.id 
296
left join user.user u on o1.customer_id = u.id</sql>
297
    <limit>0</limit>
298
    <lookup/>
299
    <execute_each_row>N</execute_each_row>
300
    <variables_active>N</variables_active>
301
    <lazy_conversion_active>N</lazy_conversion_active>
302
     <cluster_schema/>
303
 <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
304
      <xloc>147</xloc>
305
      <yloc>140</yloc>
306
      <draw>Y</draw>
307
      </GUI>
308
    </step>
309
 
310
  <step_error_handling>
311
  </step_error_handling>
312
   <slave-step-copy-partition-distribution>
313
</slave-step-copy-partition-distribution>
314
   <slave_transformation>N</slave_transformation>
315
</transformation>