bmg 0.21.0 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bmg/operator/join.rb +23 -0
- data/lib/bmg/operator/restrict.rb +1 -1
- data/lib/bmg/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0ca5faec7c7529e032eca725661a0e480b0e527
|
4
|
+
data.tar.gz: b2891c92b61211b40048d8545988bc1de5fd5bfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 399c045c70776108049673574a0f7631dc6b3b70e879b180de00feab49bd4ec4553b991a04549c4a336741cbadd3195204d918d1de5b060ee3195748d7bd2446
|
7
|
+
data.tar.gz: 97304f0d053a2755bfc0a15504610e917686e86f5b8fa7871ff09f66446a6b7cef9aa7043f68637ee5d72ac394838f773522dcfb4a175b2cc7443bb723cb279c
|
data/lib/bmg/operator/join.rb
CHANGED
@@ -70,6 +70,29 @@ module Bmg
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def _restrict(type, predicate)
|
74
|
+
return super if left_join?
|
75
|
+
|
76
|
+
# right_p makes no reference to attributes in left => full on right
|
77
|
+
# left_p makes no reference to attributes in right => full on left
|
78
|
+
up1, right_p = predicate.and_split(left.type.attrlist! - on)
|
79
|
+
up2, left_p = predicate.and_split(right.type.attrlist! - on)
|
80
|
+
if right_p.tautology? && left_p.tautology?
|
81
|
+
# no optimization can be done
|
82
|
+
super
|
83
|
+
else
|
84
|
+
# remains the full reduction, that up2 is not, since we got it
|
85
|
+
# from predicate, not from up1
|
86
|
+
remains, _ = up1.and_split(right.type.attrlist! - on)
|
87
|
+
left
|
88
|
+
.restrict(left_p)
|
89
|
+
.join(right.restrict(right_p), on)
|
90
|
+
.restrict(remains)
|
91
|
+
end
|
92
|
+
rescue UnknownAttributesError
|
93
|
+
super
|
94
|
+
end
|
95
|
+
|
73
96
|
def _unautowrap(operand, options)
|
74
97
|
return [operand, false] unless operand.is_a?(Operator::Autowrap)
|
75
98
|
return [operand, false] unless operand.same_options?(options)
|
data/lib/bmg/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bmg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: predicate
|