activecube 0.1.28 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +6 -0
- data/lib/activecube/processor/index.rb +5 -1
- data/lib/activecube/processor/table.rb +2 -1
- data/lib/activecube/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21b32d45c2412d7be46e4f044b3287262b5014ad617ac9929fc0f740c7c64520
|
4
|
+
data.tar.gz: f5c97c62544274087c0ca1cfedf403384f3dc04bb05ba327cc2c51a6a5bc9ff0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2dd6dc3bcb0b4f1b2acc83aceb94d677564d2c70c51646018b0b91c2e168f41459cc0e7541e5b4182aebb8bc4e288d88ae2fc017836ca2d1475afb0c28f019
|
7
|
+
data.tar.gz: '0709d3aa9adef226869f016a46d58a11cbfee94315fac2f22c7740ca3bf215c8ab691191a9b6ce50e69ed3ff072de84993bc313cf86f9095b41a71cf5be88072'
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -121,6 +121,12 @@ index ['currency_id'], cardinality: 4
|
|
121
121
|
index ['currency_id','date'], cardinality: 6
|
122
122
|
```
|
123
123
|
|
124
|
+
You can require using index in some cases. If required: true added, the table will be used **only** in case when this field is used
|
125
|
+
in query metric, dimension or selector.
|
126
|
+
```ruby
|
127
|
+
index ['currency_id'], cardinality: 4, required: true
|
128
|
+
```
|
129
|
+
|
124
130
|
### Query language
|
125
131
|
|
126
132
|
You use the cube class to create and execute queries.
|
@@ -2,16 +2,20 @@ module Activecube
|
|
2
2
|
module Processor
|
3
3
|
class Index
|
4
4
|
|
5
|
-
attr_reader :fields, :cardinality
|
5
|
+
attr_reader :fields, :cardinality, :required
|
6
6
|
def initialize name, *args
|
7
7
|
@fields = [name].flatten
|
8
8
|
@cardinality = args.first && args.first[:cardinality]
|
9
|
+
@required = args.first && args.first[:required]
|
9
10
|
end
|
10
11
|
|
11
12
|
def indexes? query, measures
|
12
13
|
(fields - query.selector_column_names(measures)).empty?
|
13
14
|
end
|
14
15
|
|
16
|
+
def matches? query, measures
|
17
|
+
!required || (fields - query.column_names(measures)).empty?
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
21
|
end
|
@@ -12,7 +12,8 @@ module Activecube::Processor
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def matches? query, measures = query.measures
|
15
|
-
(query.column_names(measures)-model.attribute_types.keys).empty?
|
15
|
+
(query.column_names(measures)-model.attribute_types.keys).empty? &&
|
16
|
+
!model.activecube_indexes.detect{|index| !index.matches?(query, measures) }
|
16
17
|
end
|
17
18
|
|
18
19
|
def measures? measure
|
data/lib/activecube/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activecube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.29
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksey Studnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|