directiverecord 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.rdoc +5 -1
- data/VERSION +1 -1
- data/lib/directive_record/query/big_query.rb +1 -4
- data/lib/directive_record/version.rb +1 -1
- data/test/unit/query/test_big_query.rb +3 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODFhYjVlZWJhYWQxOTQyZDRjZDgwNmI0ODhjOGM1NzMwMGJmM2I5Zg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGFhNzc2NWRhOWQ0MGQwM2RjZDVlNWNhYmJhNjY1MGI1MTdlYzgyOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGU1MTQ0NTZiNmY1MjBiMmJhN2Y2ZGQ4ZTBiNGQwN2ZkNjFjYzAzN2FhYWM1
|
10
|
+
Nzk4NjllY2ZiZjczMTA1OWM2NmYwM2YwYWY3MTY2ZDVkZDgwMGJkNjQ5YzEx
|
11
|
+
OGQ4MzcxNjllNjRiMDA3ZWJlYmU2MmIyYWViM2M5MDQ1MDc5NGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTBjOGM1ODRmYTk4MTI0YmJkY2YwYjljOTUwNDJkMDEzYzg5MmFiMTcwMDA3
|
14
|
+
NDU1ZDg3YTBjNWU4MjM0NjJlYzA5OThkNjJjMjFkMjg1OGExMjA5MWM5Yzk3
|
15
|
+
M2JjMDA0ZmM1NDc2OWE0OWMzMGZhMTE4YTcwZTg4MDhkYmMyN2I=
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
= DirectiveRecord CHANGELOG
|
2
2
|
|
3
|
+
== Version 0.1.7 (February 20, 2015)
|
4
|
+
|
5
|
+
* Improved BigQuery FROM statement (using TABLE_DATE_RANGE)
|
6
|
+
|
3
7
|
== Version 0.1.6 (February 11, 2015)
|
4
8
|
|
5
|
-
* Improved BigQuery
|
9
|
+
* Improved BigQuery SELECT statement correction concerning the group by statement
|
6
10
|
|
7
11
|
== Version 0.1.5 (February 11, 2015)
|
8
12
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
@@ -19,10 +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] = (
|
23
|
-
"[#{dataset}.#{base.table_name}_#{date.strftime("%Y%m%d")}]"
|
24
|
-
end
|
25
|
-
options[:from] = "\n #{options[:from].join(",\n ")}"
|
22
|
+
options[:from] = "\n (TABLE_DATE_RANGE(#{dataset}.#{base.table_name}_, TIMESTAMP('#{begin_date}'), TIMESTAMP('#{end_date}')))"
|
26
23
|
end
|
27
24
|
end
|
28
25
|
end
|
@@ -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,13 +45,7 @@ module Unit
|
|
45
45
|
%Q{
|
46
46
|
SELECT id, SUM(order_details_quantity_ordered * order_details_price_each)
|
47
47
|
FROM
|
48
|
-
|
49
|
-
[my_stats.orders_20150116],
|
50
|
-
[my_stats.orders_20150117],
|
51
|
-
[my_stats.orders_20150118],
|
52
|
-
[my_stats.orders_20150119],
|
53
|
-
[my_stats.orders_20150120],
|
54
|
-
[my_stats.orders_20150121]
|
48
|
+
(TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21')))
|
55
49
|
GROUP BY id
|
56
50
|
ORDER BY id
|
57
51
|
}.strip.gsub(/\s+/, " "),
|
@@ -69,13 +63,7 @@ module Unit
|
|
69
63
|
%Q{
|
70
64
|
SELECT id, MAX(customer_id), SUM(order_details_quantity_ordered * order_details_price_each)
|
71
65
|
FROM
|
72
|
-
|
73
|
-
[my_stats.orders_20150116],
|
74
|
-
[my_stats.orders_20150117],
|
75
|
-
[my_stats.orders_20150118],
|
76
|
-
[my_stats.orders_20150119],
|
77
|
-
[my_stats.orders_20150120],
|
78
|
-
[my_stats.orders_20150121]
|
66
|
+
(TABLE_DATE_RANGE(my_stats.orders_, TIMESTAMP('2015-01-15'), TIMESTAMP('2015-01-21')))
|
79
67
|
GROUP BY id
|
80
68
|
ORDER BY id
|
81
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.7
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|