forked from holysll/ETL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
public_generate_parameter_ods_min.ktr
335 lines (332 loc) · 19.3 KB
/
public_generate_parameter_ods_min.ktr
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<?xml version="1.0" encoding="UTF-8"?>
<transformation>
<info>
<name>public_generate_parameter_ods</name>
<description/>
<extended_description/>
<trans_version/>
<trans_type>Normal</trans_type>
<trans_status>0</trans_status>
<directory>/</directory>
<parameters>
</parameters>
<log>
<trans-log-table><connection/>
<schema/>
<table/>
<size_limit_lines/>
<interval/>
<timeout_days/>
<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><field><id>EXECUTING_SERVER</id><enabled>N</enabled><name>EXECUTING_SERVER</name></field><field><id>EXECUTING_USER</id><enabled>N</enabled><name>EXECUTING_USER</name></field><field><id>CLIENT</id><enabled>N</enabled><name>CLIENT</name></field></trans-log-table>
<perf-log-table><connection/>
<schema/>
<table/>
<interval/>
<timeout_days/>
<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>
<channel-log-table><connection/>
<schema/>
<table/>
<timeout_days/>
<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>
<step-log-table><connection/>
<schema/>
<table/>
<timeout_days/>
<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>
<metrics-log-table><connection/>
<schema/>
<table/>
<timeout_days/>
<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>METRICS_DATE</id><enabled>Y</enabled><name>METRICS_DATE</name></field><field><id>METRICS_CODE</id><enabled>Y</enabled><name>METRICS_CODE</name></field><field><id>METRICS_DESCRIPTION</id><enabled>Y</enabled><name>METRICS_DESCRIPTION</name></field><field><id>METRICS_SUBJECT</id><enabled>Y</enabled><name>METRICS_SUBJECT</name></field><field><id>METRICS_TYPE</id><enabled>Y</enabled><name>METRICS_TYPE</name></field><field><id>METRICS_VALUE</id><enabled>Y</enabled><name>METRICS_VALUE</name></field></metrics-log-table>
</log>
<maxdate>
<connection/>
<table/>
<field/>
<offset>0.0</offset>
<maxdiff>0.0</maxdiff>
</maxdate>
<size_rowset>10000</size_rowset>
<sleep_time_empty>50</sleep_time_empty>
<sleep_time_full>50</sleep_time_full>
<unique_connections>N</unique_connections>
<feedback_shown>Y</feedback_shown>
<feedback_size>50000</feedback_size>
<using_thread_priorities>Y</using_thread_priorities>
<shared_objects_file/>
<capture_step_performance>N</capture_step_performance>
<step_performance_capturing_delay>1000</step_performance_capturing_delay>
<step_performance_capturing_size_limit>100</step_performance_capturing_size_limit>
<dependencies>
</dependencies>
<partitionschemas>
</partitionschemas>
<slaveservers>
<slaveserver><name>prod_master</name><hostname>mcpl027</hostname><port>8080</port><webAppName/><username>cluster</username><password>Encrypted 2be98afc86aa7f2e4cb1aa265cd86aac8</password><proxy_hostname/><proxy_port/><non_proxy_hosts/><master>Y</master><sslMode>N</sslMode></slaveserver>
</slaveservers>
<clusterschemas>
</clusterschemas>
<created_user>-</created_user>
<created_date>2015/04/11 09:48:09.591</created_date>
<modified_user>-</modified_user>
<modified_date>2015/04/11 09:48:09.591</modified_date>
<key_for_session_key>H4sIAAAAAAAAAAMAAAAAAAAAAAA=</key_for_session_key>
<is_key_private>N</is_key_private>
</info>
<notepads>
</notepads>
<connection>
<name>parameter</name>
<server>${CMALDW_APD_DB_HOST}</server>
<type>MYSQL</type>
<access>Native</access>
<database>${CMALDW_APD_DB_SC}</database>
<port>${CMALDW_APD_DB_PORT}</port>
<username>${CMALDW_APD_DB_USER}</username>
<password>${CADW_APD_DB_PASSWORD}</password>
<servername/>
<data_tablespace/>
<index_tablespace/>
<attributes>
<attribute><code>FORCE_IDENTIFIERS_TO_LOWERCASE</code><attribute>N</attribute></attribute>
<attribute><code>FORCE_IDENTIFIERS_TO_UPPERCASE</code><attribute>N</attribute></attribute>
<attribute><code>IS_CLUSTERED</code><attribute>N</attribute></attribute>
<attribute><code>PORT_NUMBER</code><attribute>${CMALDW_APD_DB_PORT}</attribute></attribute>
<attribute><code>PRESERVE_RESERVED_WORD_CASE</code><attribute>N</attribute></attribute>
<attribute><code>QUOTE_ALL_FIELDS</code><attribute>N</attribute></attribute>
<attribute><code>STREAM_RESULTS</code><attribute>Y</attribute></attribute>
<attribute><code>SUPPORTS_BOOLEAN_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>SUPPORTS_TIMESTAMP_DATA_TYPE</code><attribute>Y</attribute></attribute>
<attribute><code>USE_POOLING</code><attribute>N</attribute></attribute>
</attributes>
</connection>
<order>
<hop> <from>START_DATE</from><to>设置变量</to><enabled>Y</enabled> </hop>
</order>
<step>
<name>START_DATE</name>
<type>TableInput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>parameter</connection>
<sql>SELECT 
 A.PARAMETER_VALUE AS START_DATE
 ,B.PARAMETER_VALUE AS END_DATE
 ,CASE WHEN A.FREQUENCY = 'DD' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 day),'%Y-%m-%d') 
 when A.FREQUENCY = 'MM' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 day),'%Y-%m-%d') 
 when A.FREQUENCY = 'YY' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 day),'%Y-%m-%d') 
 ELSE '0'
 END AS BEFORE_DATE
 ,case when A.FREQUENCY = 'DD' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 month),'%Y-%m-%d') 
 when A.FREQUENCY = 'MM' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 month),'%Y-%m-%d') 
 when A.FREQUENCY = 'YY' THEN date_format(date_sub(str_to_date(A.PARAMETER_VALUE,'%Y-%m-%d'), interval 1 month),'%Y-%m-%d') 
 ELSE '0'
 END AS BEFORE_MONTH
 ,REPLACE(A.PARAMETER_VALUE,'-','') AS CUR_DATE_WID
 ,C.JOB_NAME
 ,C.SRC_NAME
 ,C.SRC_TABLE_NAME
 ,C.TAR_STG_TAB_NAME
 ,C.TAR_ODS_TAB_NAME
 ,C.TAR_HIS_TAB_NAME
 ,C.DB_HOST
 ,C.DB_NAME
 ,C.DB_PASSWORD
 ,C.DB_PORT
 ,C.DB_USER
 ,C.DB_JDBC
 ,C.SPLIT_BY
 ,C.TERMINATED_BY
 ,C.JOIN_CONDITION
 ,C.EXTRACT_MODE
 ,C.INCREMENT_FIELD
 ,C.PARAR_NUM
 ,C.TAB_OR_VIEW
 ,C.QUERY_STATEMENT
 ,C.SRC_DB_TYPE
 ,C.TARGET_DIR
 ,C.FETCH_SIZE
 ,C.SET_ENGINE
 FROM MSS.APD_ODS_PARAMETER C 
 LEFT JOIN MSS.APD_FND_SCHEDULE_PARAMETER A
 ON A.WORKFLOW_NAME = C.JOB_NAME 
 AND A.PARAMETER_NAME = '$$START_EXTRACT_DATE'
 LEFT JOIN MSS.APD_FND_SCHEDULE_PARAMETER B
 ON A.WORKFLOW_NAME = B.WORKFLOW_NAME 
 AND B.PARAMETER_NAME = '$$LAST_EXTRACT_DATE'
 WHERE C.JOB_NAME = '${KETTLE_JOB_NAME}'</sql>
<limit>100</limit>
<lookup/>
<execute_each_row>N</execute_each_row>
<variables_active>Y</variables_active>
<lazy_conversion_active>N</lazy_conversion_active>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>140</xloc>
<yloc>179</yloc>
<draw>Y</draw>
</GUI>
</step>
<step>
<name>设置变量</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<field_name>START_DATE</field_name>
<variable_name>START_DATE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>END_DATE</field_name>
<variable_name>END_DATE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>BEFORE_DATE</field_name>
<variable_name>BEFORE_DATE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>BEFORE_MONTH</field_name>
<variable_name>BEFORE_MONTH</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>CUR_DATE_WID</field_name>
<variable_name>CUR_DATE_WID</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>JOB_NAME</field_name>
<variable_name>JOB_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>SRC_NAME</field_name>
<variable_name>SRC_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>SRC_TABLE_NAME</field_name>
<variable_name>SRC_TABLE_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TAR_STG_TAB_NAME</field_name>
<variable_name>TAR_STG_TAB_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TAR_ODS_TAB_NAME</field_name>
<variable_name>TAR_ODS_TAB_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TAR_HIS_TAB_NAME</field_name>
<variable_name>TAR_HIS_TAB_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_HOST</field_name>
<variable_name>DB_HOST</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_NAME</field_name>
<variable_name>DB_NAME</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_PASSWORD</field_name>
<variable_name>DB_PASSWORD</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_PORT</field_name>
<variable_name>DB_PORT</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_USER</field_name>
<variable_name>DB_USER</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>DB_JDBC</field_name>
<variable_name>DB_JDBC</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>SPLIT_BY</field_name>
<variable_name>SPLIT_BY</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TERMINATED_BY</field_name>
<variable_name>TERMINATED_BY</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>JOIN_CONDITION</field_name>
<variable_name>JOIN_CONDITION</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>EXTRACT_MODE</field_name>
<variable_name>EXTRACT_MODE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>INCREMENT_FIELD</field_name>
<variable_name>INCREMENT_FIELD</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>PARAR_NUM</field_name>
<variable_name>PARAR_NUM</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TAB_OR_VIEW</field_name>
<variable_name>TAB_OR_VIEW</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>QUERY_STATEMENT</field_name>
<variable_name>QUERY_STATEMENT</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>SRC_DB_TYPE</field_name>
<variable_name>SRC_DB_TYPE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>TARGET_DIR</field_name>
<variable_name>TARGET_DIR</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>FETCH_SIZE</field_name>
<variable_name>FETCH_SIZE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
<field>
<field_name>SET_ENGINE</field_name>
<variable_name>SET_ENGINE</variable_name>
<variable_type>ROOT_JOB</variable_type>
<default_value/>
</field>
</fields>
<use_formatting>Y</use_formatting>
<cluster_schema/>
<remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
<xloc>464</xloc>
<yloc>177</yloc>
<draw>Y</draw>
</GUI>
</step>
<step_error_handling>
</step_error_handling>
<slave-step-copy-partition-distribution>
</slave-step-copy-partition-distribution>
<slave_transformation>N</slave_transformation>
</transformation>