umbrellio-utils 1.16.2 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a7c14a1b2eb6b966828ef21ffe220125114d6ff5b7ff5138b4f4b8c29468cc4d
4
- data.tar.gz: '09751ceed95d1fb73b1ff71b18f455999bf22b0a00ec1327b0b3a8365672a56e'
3
+ metadata.gz: 5da47e7215c62353c7682a24fd57420b09af5f55ba37ffc11658a4a6ba51d5b0
4
+ data.tar.gz: 6026f030b0eac12fec699b847a28744e41d9120c236aef1aa0a311fb3b43d732
5
5
  SHA512:
6
- metadata.gz: 453183b841b35ded94451993497b70d2228b897bb00351d191c5ed432943e0575b0f4eb9e71db4d5557d75662acac3ce31092c7c9706e11322192dd337eb591d
7
- data.tar.gz: 8b12202e78c716ec7eee7f680143252e6766b3d290e048681959904636968b9d930570016eac28d4296028c213cdddb2b9365917430fea03ebb539a6a529099c
6
+ metadata.gz: 7c3d87cc1f6597a2adf44e9e0ef7110e69ea9c6855c02e6987d853529eabdf135a7cd3a267f626c1b0fab581f191efcf4d2b5aab40cf5f42755efe78d4aa7018
7
+ data.tar.gz: 13c9d2306c4736234dd3ecb648d9a79f6c297d5b17911ed7f2c0ee342b2ff29ed21315c151c78ab07014c551ae8683bb55fddab172603d21d490b9b56f33757a
@@ -7,48 +7,8 @@ on:
7
7
 
8
8
  jobs:
9
9
  release:
10
- runs-on: ubuntu-latest
11
10
  permissions:
12
11
  contents: write
13
- steps:
14
- - uses: actions/checkout@v4
15
-
16
- - name: Extract version
17
- id: version
18
- run: |
19
- version=$(grep -oP '(?<=VERSION = ")[^"]+' lib/umbrellio_utils/version.rb)
20
- echo "tag=v$version" >> "$GITHUB_OUTPUT"
21
-
22
- - name: Check if release already exists
23
- id: check
24
- run: |
25
- if gh release view "${{ steps.version.outputs.tag }}" &>/dev/null; then
26
- echo "exists=true" >> "$GITHUB_OUTPUT"
27
- else
28
- echo "exists=false" >> "$GITHUB_OUTPUT"
29
- fi
30
- env:
31
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
-
33
- - uses: ruby/setup-ruby@v1
34
- if: steps.check.outputs.exists == 'false'
35
- with:
36
- ruby-version: "3.4"
37
- bundler-cache: true
38
-
39
- - name: Build gem
40
- if: steps.check.outputs.exists == 'false'
41
- run: gem build umbrellio_utils.gemspec
42
-
43
- - name: Push gem to RubyGems
44
- if: steps.check.outputs.exists == 'false'
45
- run: gem push *.gem
46
- env:
47
- GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
48
-
49
- - uses: softprops/action-gh-release@v3
50
- if: steps.check.outputs.exists == 'false'
51
- with:
52
- tag_name: ${{ steps.version.outputs.tag }}
53
- files: "*.gem"
54
- generate_release_notes: true
12
+ uses: umbrellio/github-workflows/.github/workflows/gem-release.yml@v1
13
+ secrets:
14
+ GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
data/Gemfile.lock CHANGED
@@ -11,7 +11,7 @@ GIT
11
11
  PATH
12
12
  remote: .
13
13
  specs:
14
- umbrellio-utils (1.16.2)
14
+ umbrellio-utils (1.17.0)
15
15
  memery (~> 1)
16
16
 
17
17
  GEM
data/README.md CHANGED
@@ -142,7 +142,7 @@ The sorting key, version column and `is_deleted` column are read from `system.ta
142
142
 
143
143
  `is_deleted` is applied after the boundary for exactly that reason, and is omitted when the engine declares no such column.
144
144
 
145
- Two chain methods are handled rather than passed through, because the dedup subquery has to control them: the subquery always projects `SELECT *` (so the outer query can still filter on `is_deleted` and on columns you did not select) and any projection you set is re-applied outside it; and the version ordering leads the subquery's `ORDER BY`, since it decides which row survives, with any ordering you set kept after it as a tiebreaker.
145
+ Two chain methods are handled rather than passed through, because the dedup subquery has to control them: the subquery always projects `SELECT *` (so the outer query can still filter on `is_deleted` and on columns you did not select) and any projection you set is re-applied outside it; and the version ordering leads the subquery's `ORDER BY`, since it decides which row survives. Equal versions are resolved as FINAL resolves them: the greater partition ID wins (`_partition_id DESC`), then the last inserted row within a partition (`_block_number DESC`), and any ordering you set comes last. The `_block_number` virtual column needs ClickHouse 23.9 or later.
146
146
 
147
147
  `#deduplicate` raises on a table it cannot collapse — a non-Replacing engine, a Replacing engine declared without a version argument, or a dataset that is not a single table source (joined, multi-source, or a subquery).
148
148
 
@@ -92,11 +92,16 @@ module UmbrellioUtils
92
92
  # filter on `is_deleted` and so a caller's projection still resolves;
93
93
  # that projection is re-applied outside instead.
94
94
  #
95
- # The version ordering leads, since it decides which row survives —
96
- # any ordering the caller set is kept after it as a tiebreaker.
95
+ # Equal versions are resolved as FINAL does: the greater partition ID,
96
+ # then the last insert within it. The caller's ordering comes last.
97
97
  def deduplicated_source(meta)
98
98
  clone(select: nil)
99
- .order(Sequel.desc(meta.version), *@opts[:order])
99
+ .order(
100
+ Sequel.desc(meta.version),
101
+ Sequel.desc(:_partition_id),
102
+ Sequel.desc(:_block_number),
103
+ *@opts[:order],
104
+ )
100
105
  .limit_by(*meta.sorting_key.map { |expr| Sequel.lit(expr) })
101
106
  end
102
107
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UmbrellioUtils
4
- VERSION = "1.16.2"
4
+ VERSION = "1.17.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: umbrellio-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Umbrellio