directiverecord 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +4 -0
- data/VERSION +1 -1
- data/lib/directive_record/query/big_query.rb +2 -2
- data/lib/directive_record/version.rb +1 -1
- data/test/unit/query/test_big_query.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGU4Njg2NzU3OTk2NzUyYzlkYWVhMTQ3OTYwODQ1YWVjNmMyNjRiZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWE2MjQ5NThkZTZhMmJlZmZiODZiMzdkMGZlNjk4YWIzODcyMzBhZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2ZlOGE0Yjc2NDU4YzViOWZmZGRlMzAxOWM1YTY0OWQ4MmU3MjFiODQ4MTlm
|
10
|
+
N2RlYjFhNWE4NzZhYjNlODMxYmFkYTQ5NmQyNDJjMjlkNzE3NmMyZmQ0Njc3
|
11
|
+
YjAxYzhlNTUyY2UwOTQ0NmE3MGNiMTk1ZTI2ODg1ZWI2ZjRhMjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDdkZWVmZDExZmMwMzY1ZTRkZjdmODI2OWIwY2M4NTc4OTMwZTk1MWZmNmUz
|
14
|
+
ZGZkYjQwNjY3Zjk0ZTQ1NjU0MDExYWU5MzI0Y2E1N2I4NDdhYjk1NTJiYjQ2
|
15
|
+
YTM2YTAzNjFmMzQ2Yzc4NmIzODcwZDllZDg0OWM1ODc5NjhlZDc=
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
= DirectiveRecord CHANGELOG
|
2
2
|
|
3
|
+
== Version 0.1.8 (February 25, 2015)
|
4
|
+
|
5
|
+
* Corrected auto-applying MAX(..) aggregate function within BigQuery SELECT statements
|
6
|
+
|
3
7
|
== Version 0.1.7 (February 20, 2015)
|
4
8
|
|
5
9
|
* Improved BigQuery FROM statement (using TABLE_DATE_RANGE)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
@@ -19,7 +19,7 @@ module DirectiveRecord
|
|
19
19
|
end
|
20
20
|
if begin_date
|
21
21
|
dataset = ::BigQuery.connection.instance_variable_get(:@dataset) # TODO: fix this
|
22
|
-
options[:from] = "\n
|
22
|
+
options[:from] = "\n TABLE_DATE_RANGE(#{dataset}.#{base.table_name}_, TIMESTAMP('#{begin_date}'), TIMESTAMP('#{end_date}'))"
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
@@ -38,7 +38,7 @@ module DirectiveRecord
|
|
38
38
|
select_expression ||= string
|
39
39
|
group_by_expression = select_alias || string
|
40
40
|
|
41
|
-
if options[:group_by].include?(group_by_expression) || !select_expression.match(/^\w+(\.\w+)*$/)
|
41
|
+
if options[:group_by].include?(group_by_expression) || options[:group_by].include?(select_expression) || !select_expression.match(/^\w+(\.\w+)*$/)
|
42
42
|
string
|
43
43
|
else
|
44
44
|
["MAX(#{select_expression})", select_alias].compact.join(" AS ")
|
@@ -23,7 +23,7 @@ module Unit
|
|
23
23
|
SUM(order_details_price_each) AS sum__order_details_price_each,
|
24
24
|
SUM(order_details_quantity_ordered * order_details_price_each) AS price
|
25
25
|
FROM
|
26
|
-
|
26
|
+
TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-21'), TIMESTAMP('2015-01-21'))
|
27
27
|
GROUP BY id
|
28
28
|
ORDER BY price DESC
|
29
29
|
}.strip.gsub(/\s+/, " "),
|
@@ -45,7 +45,7 @@ module Unit
|
|
45
45
|
%Q{
|
46
46
|
SELECT id, SUM(order_details_quantity_ordered * order_details_price_each)
|
47
47
|
FROM
|
48
|
-
|
48
|
+
TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21'))
|
49
49
|
GROUP BY id
|
50
50
|
ORDER BY id
|
51
51
|
}.strip.gsub(/\s+/, " "),
|
@@ -63,7 +63,7 @@ module Unit
|
|
63
63
|
%Q{
|
64
64
|
SELECT id, MAX(customer_id), SUM(order_details_quantity_ordered * order_details_price_each)
|
65
65
|
FROM
|
66
|
-
|
66
|
+
TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21'))
|
67
67
|
GROUP BY id
|
68
68
|
ORDER BY id
|
69
69
|
}.strip.gsub(/\s+/, " "),
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: directiverecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Engel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|