bmg 0.16.0.pre.rc1 → 0.16.0.pre.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bmg.rb +1 -0
- data/lib/bmg/algebra.rb +17 -1
- data/lib/bmg/algebra/shortcuts.rb +27 -11
- data/lib/bmg/error.rb +4 -0
- data/lib/bmg/operator.rb +6 -44
- data/lib/bmg/operator/autowrap.rb +80 -8
- data/lib/bmg/operator/join.rb +19 -0
- data/lib/bmg/operator/shared/binary.rb +22 -0
- data/lib/bmg/operator/shared/nary.rb +19 -0
- data/lib/bmg/operator/shared/unary.rb +21 -0
- data/lib/bmg/operator/summarize.rb +77 -0
- data/lib/bmg/sequel/translator.rb +16 -1
- data/lib/bmg/sql/builder.rb +8 -0
- data/lib/bmg/sql/grammar.rb +2 -0
- data/lib/bmg/sql/grammar.sexp.yml +11 -0
- data/lib/bmg/sql/nodes/group_by_clause.rb +20 -0
- data/lib/bmg/sql/nodes/select_exp.rb +4 -0
- data/lib/bmg/sql/nodes/summarizer.rb +23 -0
- data/lib/bmg/sql/processor.rb +1 -0
- data/lib/bmg/sql/processor/summarize.rb +48 -0
- data/lib/bmg/sql/processor/where.rb +10 -5
- data/lib/bmg/sql/relation.rb +17 -0
- data/lib/bmg/sql/support/from_clause_orderer.rb +129 -39
- data/lib/bmg/summarizer.rb +132 -0
- data/lib/bmg/summarizer/avg.rb +36 -0
- data/lib/bmg/summarizer/collect.rb +31 -0
- data/lib/bmg/summarizer/concat.rb +42 -0
- data/lib/bmg/summarizer/count.rb +31 -0
- data/lib/bmg/summarizer/max.rb +31 -0
- data/lib/bmg/summarizer/min.rb +31 -0
- data/lib/bmg/summarizer/stddev.rb +26 -0
- data/lib/bmg/summarizer/sum.rb +31 -0
- data/lib/bmg/summarizer/variance.rb +42 -0
- data/lib/bmg/type.rb +11 -0
- data/lib/bmg/version.rb +1 -1
- metadata +34 -3
data/lib/bmg/type.rb
CHANGED
@@ -56,6 +56,10 @@ module Bmg
|
|
56
56
|
!self.attrlist.nil?
|
57
57
|
end
|
58
58
|
|
59
|
+
def knows_attrlist!
|
60
|
+
raise UnknownAttributesError unless knows_attrlist?
|
61
|
+
end
|
62
|
+
|
59
63
|
def to_attrlist
|
60
64
|
self.attrlist
|
61
65
|
end
|
@@ -216,6 +220,13 @@ module Bmg
|
|
216
220
|
}
|
217
221
|
end
|
218
222
|
|
223
|
+
def summarize(by, summarization)
|
224
|
+
dup.tap{|x|
|
225
|
+
x.attrlist = by + summarization.keys
|
226
|
+
x.keys = Keys.new([by])
|
227
|
+
}
|
228
|
+
end
|
229
|
+
|
219
230
|
def union(other)
|
220
231
|
if typechecked? && knows_attrlist? && other.knows_attrlist?
|
221
232
|
missing = self.attrlist - other.attrlist
|
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.16.0.pre.
|
4
|
+
version: 0.16.0.pre.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: predicate
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: roo
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.7'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.7'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: sequel
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,6 +139,10 @@ files:
|
|
125
139
|
- lib/bmg/operator/rename.rb
|
126
140
|
- lib/bmg/operator/restrict.rb
|
127
141
|
- lib/bmg/operator/rxmatch.rb
|
142
|
+
- lib/bmg/operator/shared/binary.rb
|
143
|
+
- lib/bmg/operator/shared/nary.rb
|
144
|
+
- lib/bmg/operator/shared/unary.rb
|
145
|
+
- lib/bmg/operator/summarize.rb
|
128
146
|
- lib/bmg/operator/union.rb
|
129
147
|
- lib/bmg/reader.rb
|
130
148
|
- lib/bmg/reader/csv.rb
|
@@ -170,6 +188,7 @@ files:
|
|
170
188
|
- lib/bmg/sql/nodes/except.rb
|
171
189
|
- lib/bmg/sql/nodes/expr.rb
|
172
190
|
- lib/bmg/sql/nodes/from_clause.rb
|
191
|
+
- lib/bmg/sql/nodes/group_by_clause.rb
|
173
192
|
- lib/bmg/sql/nodes/inner_join.rb
|
174
193
|
- lib/bmg/sql/nodes/intersect.rb
|
175
194
|
- lib/bmg/sql/nodes/limit_clause.rb
|
@@ -188,6 +207,7 @@ files:
|
|
188
207
|
- lib/bmg/sql/nodes/set_operator.rb
|
189
208
|
- lib/bmg/sql/nodes/set_quantifier.rb
|
190
209
|
- lib/bmg/sql/nodes/subquery_as.rb
|
210
|
+
- lib/bmg/sql/nodes/summarizer.rb
|
191
211
|
- lib/bmg/sql/nodes/table_as.rb
|
192
212
|
- lib/bmg/sql/nodes/table_name.rb
|
193
213
|
- lib/bmg/sql/nodes/union.rb
|
@@ -211,10 +231,21 @@ files:
|
|
211
231
|
- lib/bmg/sql/processor/requalify.rb
|
212
232
|
- lib/bmg/sql/processor/semi_join.rb
|
213
233
|
- lib/bmg/sql/processor/star.rb
|
234
|
+
- lib/bmg/sql/processor/summarize.rb
|
214
235
|
- lib/bmg/sql/processor/where.rb
|
215
236
|
- lib/bmg/sql/relation.rb
|
216
237
|
- lib/bmg/sql/support/from_clause_orderer.rb
|
217
238
|
- lib/bmg/sql/version.rb
|
239
|
+
- lib/bmg/summarizer.rb
|
240
|
+
- lib/bmg/summarizer/avg.rb
|
241
|
+
- lib/bmg/summarizer/collect.rb
|
242
|
+
- lib/bmg/summarizer/concat.rb
|
243
|
+
- lib/bmg/summarizer/count.rb
|
244
|
+
- lib/bmg/summarizer/max.rb
|
245
|
+
- lib/bmg/summarizer/min.rb
|
246
|
+
- lib/bmg/summarizer/stddev.rb
|
247
|
+
- lib/bmg/summarizer/sum.rb
|
248
|
+
- lib/bmg/summarizer/variance.rb
|
218
249
|
- lib/bmg/support.rb
|
219
250
|
- lib/bmg/support/keys.rb
|
220
251
|
- lib/bmg/support/tuple_algebra.rb
|
@@ -242,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
273
|
version: 1.3.1
|
243
274
|
requirements: []
|
244
275
|
rubyforge_project:
|
245
|
-
rubygems_version: 2.
|
276
|
+
rubygems_version: 2.6.11
|
246
277
|
signing_key:
|
247
278
|
specification_version: 4
|
248
279
|
summary: Bmg is Alf's successor.
|