@@ -3,13 +3,19 @@ bound force_reimport_not_chunk_partitioned
3
3
bound resources_data_to_delete
4
4
bound declared_sources_to_delete = String, String
5
5
bound new_source_config_csv = RelName, FilePos, String
6
+ bound expired_source_config_csv = RelName, FilePos, String
6
7
7
8
def new_source_config[:syntax, :header_row] = -1
8
9
def new_source_config[:syntax, :header] = (1, :Relation); (2, :Path); (3, :ChunkPartitioned)
9
10
def new_source_config[:schema, :Relation] = "string"
10
11
def new_source_config[:schema, :Path] = "string"
11
12
def new_source_config[:schema, :ChunkPartitioned] = "string"
12
13
14
+ def expired_source_config[:syntax, :header_row] = -1
15
+ def expired_source_config[:syntax, :header] = (1, :Relation); (2, :Path)
16
+ def expired_source_config[:schema, :Relation] = "string"
17
+ def expired_source_config[:schema, :Path] = "string"
18
+
13
19
def chunk_partitioned_sources(rel, path, p_idx) {
14
20
new_source_config_csv(:Path, i, path) and
15
21
new_source_config_csv(:Relation, i, rel) and
@@ -25,6 +31,12 @@ def simple_sources(rel, path) {
25
31
from i
26
32
}
27
33
34
+ def expired_sources(rel, path) {
35
+ expired_source_config_csv(:Path, i, path) and
36
+ expired_source_config_csv(:Relation, i, rel)
37
+ from i
38
+ }
39
+
28
40
/*
29
41
* All simple sources are affected if they match with declared sources.
30
42
*/
@@ -57,25 +69,30 @@ def potentially_affected_sources(rel, o_path, p_idx) {
57
69
from n_path, res
58
70
}
59
71
/*
60
- * Identify sources for replacement .
72
+ * Identify sources for invalidation .
61
73
*/
62
- def part_resource_to_replace (rel, p_idx, path) {
74
+ def part_resource_to_invalidate (rel, p_idx, path) {
63
75
not force_reimport and
64
76
potentially_affected_sources(rel, path, p_idx) and
65
77
not chunk_partitioned_sources(rel, path, p_idx)
66
78
}
67
79
68
- def part_resource_to_replace (rel, p_idx, path) {
80
+ def part_resource_to_invalidate (rel, p_idx, path) {
69
81
force_reimport and
70
82
potentially_affected_sources(rel, path, p_idx)
71
83
}
84
+ // We support invalidation only for partitioned expired sources
85
+ def part_resource_to_invalidate(rel, p_idx, path) {
86
+ expired_sources(rel, path) and
87
+ part_resource:parse_part_index[path](p_idx)
88
+ }
72
89
73
- def resource_to_replace (rel, o_path) {
90
+ def resource_to_invalidate (rel, o_path) {
74
91
force_reimport_not_chunk_partitioned and
75
92
simple_sources(rel, o_path)
76
93
}
77
94
78
- def resource_to_replace (rel, o_path) {
95
+ def resource_to_invalidate (rel, o_path) {
79
96
force_reimport and
80
97
simple_sources(rel, o_path)
81
98
}
@@ -84,16 +101,16 @@ def resource_to_replace(rel, o_path) {
84
101
* Save resources that we are marked for data reimport.
85
102
*/
86
103
// PRODUCT_LIMITATION: Message: Argument for specializing is more complex than the current staging implementation supports.
87
- def reverse_part_resource_to_replace (path, p_idx, rel) = part_resource_to_replace (rel, p_idx, path)
104
+ def reverse_part_resource_to_invalidate (path, p_idx, rel) = part_resource_to_invalidate (rel, p_idx, path)
88
105
// resource partitions to delete
89
106
def resources_to_delete(rel, val) {
90
- rel = #(reverse_part_resource_to_replace [_, p_idx]) and
107
+ rel = #(reverse_part_resource_to_invalidate [_, p_idx]) and
91
108
p_idx = ^PartIndex[val]
92
109
from p_idx
93
110
}
94
111
// resources to delete
95
112
def resources_to_delete(rel) {
96
- rel = #(transpose[resource_to_replace ][_])
113
+ rel = #(transpose[resource_to_invalidate ][_])
97
114
}
98
115
99
116
def resources_data_to_delete_idx = enumerate[resources_data_to_delete]
0 commit comments