-
Notifications
You must be signed in to change notification settings - Fork 9
/
job.xml
executable file
·45 lines (45 loc) · 1.68 KB
/
job.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
<job name="transform-user-events">
<action name="load-users">
<actor type="file">
<properties>
<format>csv</format>
<options>
<header>false</header>
<delimiter>,</delimiter>
<quote>"</quote>
<timestampFormat>yyyy/MM/dd HH:mm:ss</timestampFormat>
</options>
<ddlSchemaString>user_id long, birth_year int, gender string, location string</ddlSchemaString>
<fileUri>${events.users_input}</fileUri>
</properties>
</actor>
<output-view name="users" global="true" />
</action>
<action name="load-events">
<actor type="flat">
<properties>
<fileUri>${events.events_input}</fileUri>
</properties>
</actor>
<output-view name="events_raw" global="false" />
</action>
<action name="transform-events">
<actor type="sql">
<properties>
<sqlString>
select
substr(row_value, 1, 12) as event_id,
substr(row_value, 13, 16) as event_time,
substr(row_value, 29, 12) as event_host,
substr(row_value, 41, 64) as event_location
from events_raw
where row_no not in (1, 2) and substr(row_value, 6, 5) != 'TFYKR'
</sqlString>
</properties>
</actor>
<input-views>
<view name="events_raw" />
</input-views>
<output-view name="events" global="true" />
</action>
</job>