Subversion Repositories SmartDukaan

Rev

Rev 3382 | Rev 3481 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3382 Rev 3436
Line 158... Line 158...
158
    <sql>SELECT SQL_NO_CACHE o.id &apos;order_id&apos;, o.customer_id, o.customer_pincode, 
158
    <sql>SELECT SQL_NO_CACHE o.id &apos;order_id&apos;, o.customer_id, o.customer_pincode, 
159
o.status &apos;order_status&apos;, o.total_amount, 
159
o.status &apos;order_status&apos;, o.total_amount, 
160
datediff(o.created_timestamp, &apos;20101231&apos;) as date_id, hour(o.created_timestamp) as order_hour,
160
datediff(o.created_timestamp, &apos;20101231&apos;) as date_id, hour(o.created_timestamp) as order_hour,
161
o.transaction_id, l.item_id, l.quantity, l.unit_price, l.transfer_price, p.gatewayId, 
161
o.transaction_id, l.item_id, l.quantity, l.unit_price, l.transfer_price, p.gatewayId, 
162
case when pa.value is null then case when p.gatewayId = 1 then 2099 when p.gatewayId = 2 then 1099 else null end else pa.value end &apos;payment_method&apos;,
162
case when pa.value is null then case when p.gatewayId = 1 then 2099 when p.gatewayId = 2 then 1099 else null end else pa.value end &apos;payment_method&apos;,
-
 
163
t.coupon_code, 
163
t.coupon_code, t.session_source, 
164
case when t.session_source is null then &apos;Unknown&apos; when t.session_source like &apos;DIRECT%&apos; then &apos;Direct&apos; when t.session_source like &apos;ORGANIC%&apos; then &apos;Organic&apos; when t.session_source like &apos;PAID%&apos; then &apos;Paid&apos; else &apos;Referer&apos; end as session_source_type,
-
 
165
SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(t.session_source,&apos;:&#47;&#47;&apos;,-1),&apos;&#47;&apos;,1),&apos;www.&apos;,-1) as session_source_url,
164
case when datediff(t.session_start_time, &apos;20101231&apos;) &gt; 0 then datediff(t.session_start_time, &apos;20101231&apos;) else 1 end as session_start_date_id, 
166
case when datediff(t.session_start_time, &apos;20101231&apos;) &gt; 0 then datediff(t.session_start_time, &apos;20101231&apos;) else 1 end as session_start_date_id, 
165
case when datediff(u.source_start_time, &apos;20101231&apos;) &gt; 0 then datediff(u.source_start_time, &apos;20101231&apos;) else 1 end as first_source_start_date_id, 
167
case when datediff(u.source_start_time, &apos;20101231&apos;) &gt; 0 then datediff(u.source_start_time, &apos;20101231&apos;) else 1 end as first_source_start_date_id, 
166
hour(t.session_start_time) as session_start_hour, aff.name aff_name
168
hour(t.session_start_time) as session_start_hour, aff.name aff_name
167
FROM `order` o 
169
FROM `order` o 
168
left join lineitem l on(o.id = l.order_id ) 
170
left join lineitem l on(o.id = l.order_id ) 
Line 195... Line 197...
195
         <partitioning>
197
         <partitioning>
196
           <method>none</method>
198
           <method>none</method>
197
           <schema_name/>
199
           <schema_name/>
198
           </partitioning>
200
           </partitioning>
199
    <fields>      <field>        <name>order_id</name>
201
    <fields>      <field>        <name>order_id</name>
200
        <rename/>
202
        <rename>order_id</rename>
201
        <length>-2</length>
203
        <length>-2</length>
202
        <precision>-2</precision>
204
        <precision>-2</precision>
203
      </field>      <field>        <name>customer_id</name>
205
      </field>      <field>        <name>customer_id</name>
204
        <rename/>
206
        <rename>customer_id</rename>
205
        <length>-2</length>
207
        <length>-2</length>
206
        <precision>-2</precision>
208
        <precision>-2</precision>
207
      </field>      <field>        <name>total_amount</name>
209
      </field>      <field>        <name>total_amount</name>
208
        <rename/>
210
        <rename>total_amount</rename>
209
        <length>-2</length>
211
        <length>-2</length>
210
        <precision>-2</precision>
212
        <precision>-2</precision>
211
      </field>      <field>        <name>date_id</name>
213
      </field>      <field>        <name>date_id</name>
212
        <rename/>
214
        <rename>date_id</rename>
213
        <length>-2</length>
215
        <length>-2</length>
214
        <precision>-2</precision>
216
        <precision>-2</precision>
215
      </field>      <field>        <name>order_hour</name>
217
      </field>      <field>        <name>order_hour</name>
216
        <rename/>
218
        <rename>order_hour</rename>
217
        <length>-2</length>
219
        <length>-2</length>
218
        <precision>-2</precision>
220
        <precision>-2</precision>
219
      </field>      <field>        <name>transaction_id</name>
221
      </field>      <field>        <name>transaction_id</name>
220
        <rename/>
222
        <rename>transaction_id</rename>
221
        <length>-2</length>
223
        <length>-2</length>
222
        <precision>-2</precision>
224
        <precision>-2</precision>
223
      </field>      <field>        <name>item_id</name>
225
      </field>      <field>        <name>item_id</name>
224
        <rename/>
226
        <rename>item_id</rename>
225
        <length>-2</length>
227
        <length>-2</length>
226
        <precision>-2</precision>
228
        <precision>-2</precision>
227
      </field>      <field>        <name>quantity</name>
229
      </field>      <field>        <name>quantity</name>
228
        <rename/>
230
        <rename>quantity</rename>
229
        <length>-2</length>
231
        <length>-2</length>
230
        <precision>-2</precision>
232
        <precision>-2</precision>
231
      </field>      <field>        <name>unit_price</name>
233
      </field>      <field>        <name>unit_price</name>
232
        <rename/>
234
        <rename>unit_price</rename>
233
        <length>-2</length>
235
        <length>-2</length>
234
        <precision>-2</precision>
236
        <precision>-2</precision>
235
      </field>      <field>        <name>transfer_price</name>
237
      </field>      <field>        <name>transfer_price</name>
236
        <rename/>
238
        <rename>transfer_price</rename>
237
        <length>-2</length>
239
        <length>-2</length>
238
        <precision>-2</precision>
240
        <precision>-2</precision>
239
      </field>      <field>        <name>gatewayId</name>
241
      </field>      <field>        <name>gatewayId</name>
240
        <rename/>
242
        <rename>gatewayId</rename>
241
        <length>-2</length>
243
        <length>-2</length>
242
        <precision>-2</precision>
244
        <precision>-2</precision>
243
      </field>      <field>        <name>payment_method</name>
245
      </field>      <field>        <name>payment_method</name>
244
        <rename/>
246
        <rename>payment_method</rename>
245
        <length>-2</length>
247
        <length>-2</length>
246
        <precision>-2</precision>
248
        <precision>-2</precision>
247
      </field>      <field>        <name>coupon_code</name>
249
      </field>      <field>        <name>coupon_code</name>
248
        <rename/>
-
 
249
        <length>-2</length>
250
        <rename>coupon_code</rename>
250
        <precision>-2</precision>
-
 
251
      </field>      <field>        <name>session_source</name>
-
 
252
        <rename/>
-
 
253
        <length>-2</length>
251
        <length>-2</length>
254
        <precision>-2</precision>
252
        <precision>-2</precision>
255
      </field>      <field>        <name>session_start_date_id</name>
253
      </field>      <field>        <name>session_start_date_id</name>
256
        <rename/>
254
        <rename>session_start_date_id</rename>
257
        <length>-2</length>
255
        <length>-2</length>
258
        <precision>-2</precision>
256
        <precision>-2</precision>
259
      </field>      <field>        <name>session_start_hour</name>
257
      </field>      <field>        <name>session_start_hour</name>
260
        <rename/>
258
        <rename>session_start_hour</rename>
261
        <length>-2</length>
259
        <length>-2</length>
262
        <precision>-2</precision>
260
        <precision>-2</precision>
263
      </field>      <field>        <name>customer_pincode</name>
261
      </field>      <field>        <name>customer_pincode</name>
264
        <rename>pincode</rename>
262
        <rename>pincode</rename>
265
        <length>-2</length>
263
        <length>-2</length>
Line 267... Line 265...
267
      </field>      <field>        <name>order_status</name>
265
      </field>      <field>        <name>order_status</name>
268
        <rename>status</rename>
266
        <rename>status</rename>
269
        <length>-2</length>
267
        <length>-2</length>
270
        <precision>-2</precision>
268
        <precision>-2</precision>
271
      </field>      <field>        <name>aff_name</name>
269
      </field>      <field>        <name>aff_name</name>
272
        <rename/>
270
        <rename>aff_name</rename>
273
        <length>-2</length>
271
        <length>-2</length>
274
        <precision>-2</precision>
272
        <precision>-2</precision>
275
      </field>      <field>        <name>first_source_start_date_id</name>
273
      </field>      <field>        <name>first_source_start_date_id</name>
-
 
274
        <rename>first_source_start_date_id</rename>
276
        <rename/>
275
        <length>-2</length>
-
 
276
        <precision>-2</precision>
-
 
277
      </field>      <field>        <name>session_source_type</name>
-
 
278
        <rename>session_source_type</rename>
-
 
279
        <length>-2</length>
-
 
280
        <precision>-2</precision>
-
 
281
      </field>      <field>        <name>session_source_url</name>
-
 
282
        <rename>session_source_url</rename>
277
        <length>-2</length>
283
        <length>-2</length>
278
        <precision>-2</precision>
284
        <precision>-2</precision>
279
      </field>        <select_unspecified>N</select_unspecified>
285
      </field>        <select_unspecified>N</select_unspecified>
280
    </fields>     <cluster_schema/>
286
    </fields>     <cluster_schema/>
281
 <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>
287
 <remotesteps>   <input>   </input>   <output>   </output> </remotesteps>    <GUI>