masamune 0.17.9 → 0.17.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f638075056a6d6b8ef776e42e1cd54b0dd8751ca
|
4
|
+
data.tar.gz: f9bac35901816b810e83da6e7ecbdcbc70e4a110
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 293482ddeba0fe77d3e78f04ec9e50f4b26ca3245fec87c32338b0a74946b3e06e8949fd47c256bad14c0af8f4a2faca89d703581c71fbecb6447f1c6fa8d9ec
|
7
|
+
data.tar.gz: d48aa19c8c17612c4eb044d802bacfd1dd60511be11e5fce33cb6fefd76ea4ae98e05f3c727da8fb87bc4ae287b6a93f64d92a3325f2e1e1375b8100567810a2
|
@@ -28,11 +28,11 @@ http://www.postgresql.org/message-id/CAGnEbohhKmW55oB0FpQd3naXBkwi74E=8DRZBGFjS-
|
|
28
28
|
WITH ranges AS (
|
29
29
|
SELECT *,
|
30
30
|
CASE WHEN delta = 0
|
31
|
-
THEN 1 ELSE
|
31
|
+
THEN 1 ELSE 0 END r
|
32
32
|
FROM <%= source.name %>
|
33
33
|
), windows AS (
|
34
34
|
SELECT *,
|
35
|
-
SUM(r) OVER (
|
35
|
+
SUM(r) OVER (PARTITION BY <%= target.window.join(', ') %> ORDER BY <%= ["start_at #{order}", 'delta', "source_uuid #{order}"].join(', ') %>) AS window_id
|
36
36
|
FROM ranges
|
37
37
|
), snapshot AS (
|
38
38
|
SELECT
|
@@ -41,15 +41,15 @@ WITH ranges AS (
|
|
41
41
|
<%- end -%>
|
42
42
|
consolidated.start_at
|
43
43
|
FROM (
|
44
|
-
SELECT DISTINCT ON (<%= target.window('start_at'
|
44
|
+
SELECT DISTINCT ON (<%= target.window('start_at').join(', ') %>)
|
45
45
|
<%- target.insert_values(window: 'w').each do |value, last| -%>
|
46
46
|
<%= value %><%= ',' %>
|
47
47
|
<%- end -%>
|
48
48
|
start_at AS start_at
|
49
49
|
FROM
|
50
50
|
windows
|
51
|
-
WINDOW w AS (PARTITION BY <%= target.window('window_id').join(', ') %> ORDER BY start_at
|
52
|
-
ORDER BY <%= target.window("start_at #{order}", "
|
51
|
+
WINDOW w AS (PARTITION BY <%= target.window('window_id').join(', ') %> ORDER BY <%= ["start_at #{order}", "source_uuid #{order}"].join(', ') %>)
|
52
|
+
ORDER BY <%= target.window("start_at #{order}", "source_uuid DESC", 'window_id').join(', ') %>
|
53
53
|
) consolidated
|
54
54
|
WHERE
|
55
55
|
<%- target.insert_view_constraints.each do |constraint, last| -%>
|
data/lib/masamune/version.rb
CHANGED
@@ -47,11 +47,11 @@ describe Masamune::Transform::SnapshotDimension do
|
|
47
47
|
WITH ranges AS (
|
48
48
|
SELECT *,
|
49
49
|
CASE WHEN delta = 0
|
50
|
-
THEN 1 ELSE
|
50
|
+
THEN 1 ELSE 0 END r
|
51
51
|
FROM user_dimension_ledger
|
52
52
|
), windows AS (
|
53
53
|
SELECT *,
|
54
|
-
SUM(r) OVER (
|
54
|
+
SUM(r) OVER (PARTITION BY tenant_id, user_id ORDER BY start_at ASC, delta, source_uuid ASC) AS window_id
|
55
55
|
FROM ranges
|
56
56
|
), snapshot AS (
|
57
57
|
SELECT
|
@@ -61,7 +61,7 @@ describe Masamune::Transform::SnapshotDimension do
|
|
61
61
|
consolidated.preferences,
|
62
62
|
consolidated.start_at
|
63
63
|
FROM (
|
64
|
-
SELECT DISTINCT ON (tenant_id, user_id, start_at
|
64
|
+
SELECT DISTINCT ON (tenant_id, user_id, start_at)
|
65
65
|
coalesce_merge(user_account_state_type_id) OVER w AS user_account_state_type_id,
|
66
66
|
tenant_id AS tenant_id,
|
67
67
|
user_id AS user_id,
|
@@ -69,8 +69,8 @@ describe Masamune::Transform::SnapshotDimension do
|
|
69
69
|
start_at AS start_at
|
70
70
|
FROM
|
71
71
|
windows
|
72
|
-
WINDOW w AS (PARTITION BY tenant_id, user_id, window_id ORDER BY start_at ASC)
|
73
|
-
ORDER BY tenant_id, user_id, start_at ASC,
|
72
|
+
WINDOW w AS (PARTITION BY tenant_id, user_id, window_id ORDER BY start_at ASC, source_uuid ASC)
|
73
|
+
ORDER BY tenant_id, user_id, start_at ASC, source_uuid DESC, window_id
|
74
74
|
) consolidated
|
75
75
|
WHERE
|
76
76
|
consolidated.user_account_state_type_id IS NOT NULL AND
|
@@ -100,11 +100,11 @@ describe Masamune::Transform::SnapshotDimension do
|
|
100
100
|
WITH ranges AS (
|
101
101
|
SELECT *,
|
102
102
|
CASE WHEN delta = 0
|
103
|
-
THEN 1 ELSE
|
103
|
+
THEN 1 ELSE 0 END r
|
104
104
|
FROM user_dimension_ledger
|
105
105
|
), windows AS (
|
106
106
|
SELECT *,
|
107
|
-
SUM(r) OVER (
|
107
|
+
SUM(r) OVER (PARTITION BY tenant_id, user_id ORDER BY start_at DESC, delta, source_uuid DESC) AS window_id
|
108
108
|
FROM ranges
|
109
109
|
), snapshot AS (
|
110
110
|
SELECT
|
@@ -114,7 +114,7 @@ describe Masamune::Transform::SnapshotDimension do
|
|
114
114
|
consolidated.preferences,
|
115
115
|
consolidated.start_at
|
116
116
|
FROM (
|
117
|
-
SELECT DISTINCT ON (tenant_id, user_id, start_at
|
117
|
+
SELECT DISTINCT ON (tenant_id, user_id, start_at)
|
118
118
|
coalesce_merge(user_account_state_type_id) OVER w AS user_account_state_type_id,
|
119
119
|
tenant_id AS tenant_id,
|
120
120
|
user_id AS user_id,
|
@@ -122,8 +122,8 @@ describe Masamune::Transform::SnapshotDimension do
|
|
122
122
|
start_at AS start_at
|
123
123
|
FROM
|
124
124
|
windows
|
125
|
-
WINDOW w AS (PARTITION BY tenant_id, user_id, window_id ORDER BY start_at DESC)
|
126
|
-
ORDER BY tenant_id, user_id, start_at DESC,
|
125
|
+
WINDOW w AS (PARTITION BY tenant_id, user_id, window_id ORDER BY start_at DESC, source_uuid DESC)
|
126
|
+
ORDER BY tenant_id, user_id, start_at DESC, source_uuid DESC, window_id
|
127
127
|
) consolidated
|
128
128
|
WHERE
|
129
129
|
consolidated.user_account_state_type_id IS NOT NULL AND
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|