|
22 | 22 | -- snapshotting fields |
23 | 23 | updated_at TIMESTAMP, |
24 | 24 | test_valid_from TIMESTAMP, |
25 | | - test_valid_to TIMESTAMP, |
| 25 | + TEST_VAILD_TO TIMESTAMP, |
26 | 26 | test_scd_id TEXT, |
27 | 27 | test_updated_at TIMESTAMP |
28 | 28 | ); |
|
68 | 68 | ip_address, |
69 | 69 | updated_at, |
70 | 70 | test_valid_from, |
71 | | - test_valid_to, |
| 71 | + TEST_VALID_TO, |
72 | 72 | test_updated_at, |
73 | 73 | test_scd_id |
74 | 74 | ) |
|
83 | 83 | updated_at, |
84 | 84 | -- fields added by snapshotting |
85 | 85 | updated_at as test_valid_from, |
86 | | - null::timestamp as test_valid_to, |
| 86 | + null::timestamp as TEST_VALID_TO, |
87 | 87 | updated_at as test_updated_at, |
88 | 88 | md5(id || '-' || first_name || '|' || updated_at::text) as test_scd_id |
89 | 89 | from {schema}.seed; |
|
100 | 100 | ip_address, |
101 | 101 | updated_at, |
102 | 102 | test_valid_from, |
103 | | - test_valid_to, |
| 103 | + TEST_VAILD_TO, |
104 | 104 | test_updated_at, |
105 | 105 | test_scd_id |
106 | 106 | ) |
|
115 | 115 | updated_at, |
116 | 116 | -- fields added by snapshotting |
117 | 117 | updated_at as test_valid_from, |
118 | | - date('2099-12-31') as test_valid_to, |
| 118 | + date('2099-12-31') as TEST_VALID_TO, |
119 | 119 | updated_at as test_updated_at, |
120 | 120 | md5(id || '-' || first_name || '|' || updated_at::text) as test_scd_id |
121 | 121 | from {schema}.seed; |
|
142 | 142 | strategy: timestamp |
143 | 143 | updated_at: updated_at |
144 | 144 | snapshot_meta_column_names: |
145 | | - dbt_valid_to: test_valid_to |
| 145 | + dbt_valid_to: TEST_VALID_TO |
146 | 146 | dbt_valid_from: test_valid_from |
147 | 147 | dbt_scd_id: test_scd_id |
148 | 148 | dbt_updated_at: test_updated_at |
|
171 | 171 |
|
172 | 172 | -- invalidate records 11 - 21 |
173 | 173 | update {schema}.snapshot_expected set |
174 | | - test_valid_to = updated_at + interval '1 hour' |
| 174 | + TEST_VALID_TO = updated_at + interval '1 hour' |
175 | 175 | where id >= 10 and id <= 20; |
176 | 176 |
|
177 | 177 | """ |
|
188 | 188 | ip_address, |
189 | 189 | updated_at, |
190 | 190 | test_valid_from, |
191 | | - test_valid_to, |
| 191 | + TEST_VALID_TO, |
192 | 192 | test_updated_at, |
193 | 193 | test_scd_id |
194 | 194 | ) |
|
203 | 203 | updated_at, |
204 | 204 | -- fields added by snapshotting |
205 | 205 | updated_at as test_valid_from, |
206 | | - null::timestamp as test_valid_to, |
| 206 | + null::timestamp as TEST_VALID_TO, |
207 | 207 | updated_at as test_updated_at, |
208 | 208 | md5(id || '-' || first_name || '|' || updated_at::text) as test_scd_id |
209 | 209 | from {schema}.seed |
|
220 | 220 | updated_at: updated_at |
221 | 221 | dbt_valid_to_current: "date('2099-12-31')" |
222 | 222 | snapshot_meta_column_names: |
223 | | - dbt_valid_to: test_valid_to |
| 223 | + dbt_valid_to: TEST_VALID_TO |
224 | 224 | dbt_valid_from: test_valid_from |
225 | 225 | dbt_scd_id: test_scd_id |
226 | 226 | dbt_updated_at: test_updated_at |
|
238 | 238 | ip_address, |
239 | 239 | updated_at, |
240 | 240 | test_valid_from, |
241 | | - test_valid_to, |
| 241 | + TEST_VALID_TO, |
242 | 242 | test_updated_at, |
243 | 243 | test_scd_id |
244 | 244 | ) |
|
253 | 253 | updated_at, |
254 | 254 | -- fields added by snapshotting |
255 | 255 | updated_at as test_valid_from, |
256 | | - date('2099-12-31') as test_valid_to, |
| 256 | + date('2099-12-31') as TEST_VALID_TO, |
257 | 257 | updated_at as test_updated_at, |
258 | 258 | md5(id || '-' || first_name || '|' || updated_at::text) as test_scd_id |
259 | 259 | from {schema}.seed |
|
290 | 290 | -- snapshotting fields |
291 | 291 | updated_at TIMESTAMP, |
292 | 292 | test_valid_from TIMESTAMP, |
293 | | - test_valid_to TIMESTAMP, |
| 293 | + TEST_VALID_TO TIMESTAMP, |
294 | 294 | test_scd_id TEXT, |
295 | 295 | test_updated_at TIMESTAMP |
296 | 296 | ); |
|
335 | 335 | ip_address, |
336 | 336 | updated_at, |
337 | 337 | test_valid_from, |
338 | | - test_valid_to, |
| 338 | + TEST_VALID_TO, |
339 | 339 | test_updated_at, |
340 | 340 | test_scd_id |
341 | 341 | ) |
|
351 | 351 | updated_at, |
352 | 352 | -- fields added by snapshotting |
353 | 353 | updated_at as test_valid_from, |
354 | | - null::timestamp as test_valid_to, |
| 354 | + null::timestamp as TEST_VALID_TO, |
355 | 355 | updated_at as test_updated_at, |
356 | 356 | md5(id1::text || '|' || id2::text || '|' || updated_at::text) as test_scd_id |
357 | 357 | from {schema}.seed; |
|
372 | 372 | - id1 |
373 | 373 | - id2 |
374 | 374 | snapshot_meta_column_names: |
375 | | - dbt_valid_to: test_valid_to |
| 375 | + dbt_valid_to: TEST_VALID_TO |
376 | 376 | dbt_valid_from: test_valid_from |
377 | 377 | dbt_scd_id: test_scd_id |
378 | 378 | dbt_updated_at: test_updated_at |
|
388 | 388 |
|
389 | 389 | -- invalidate records 11 - 21 |
390 | 390 | update {schema}.snapshot_expected set |
391 | | - test_valid_to = updated_at + interval '1 hour' |
| 391 | + TEST_VALID_TO = updated_at + interval '1 hour' |
392 | 392 | where id1 >= 10 and id1 <= 20; |
393 | 393 |
|
394 | 394 | """ |
|
406 | 406 | ip_address, |
407 | 407 | updated_at, |
408 | 408 | test_valid_from, |
409 | | - test_valid_to, |
| 409 | + TEST_VALID_TO, |
410 | 410 | test_updated_at, |
411 | 411 | test_scd_id |
412 | 412 | ) |
|
422 | 422 | updated_at, |
423 | 423 | -- fields added by snapshotting |
424 | 424 | updated_at as test_valid_from, |
425 | | - null::timestamp as test_valid_to, |
| 425 | + null::timestamp as TEST_VALID_TO, |
426 | 426 | updated_at as test_updated_at, |
427 | 427 | md5(id1::text || '|' || id2::text || '|' || updated_at::text) as test_scd_id |
428 | 428 | from {schema}.seed |
|
0 commit comments