mondrian-olap 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33377438a5e2533d61b3304824a4e0aefe545f68
4
- data.tar.gz: 13ef2ecd466795a07f43252231e4e7ad586c1e45
3
+ metadata.gz: 62331aaa1c73a54c6adde925d5ee226ed05e73c6
4
+ data.tar.gz: 9c1f2557b90a4b1f9cb26da6358eaa36a1d33d79
5
5
  SHA512:
6
- metadata.gz: c0ac6bc10f6ed6b4725d0991131402735e50c9c4cbc3de016a8714c7ceca5ce420ce9b5090fe006ae5495f0e8add0cf4f4cbb773b2f3da35767481e60b04a7d4
7
- data.tar.gz: b7a47e4872dd58434b05e8d07b99d06d73d1ef023be953b4be00a5de2bd6c18db6e943496cecf1b3cad0fab60a5e3850b1084b7e31896533df3d1e6f2112d03c
6
+ metadata.gz: dedc6bee9ea5e9fb01f00a6de70c6d35edaa5ff6c30b80e7553db2cf30099b153056ac1979286bc4114c866c3d6e71d63723d7ce17026ee8d92e86ecf36d24cd
7
+ data.tar.gz: 8b39386fd21332b74baf56c47cabba12667f0d8231f99f24d8a3fd690de9a556d4e65048549ca59e53f26340b49a212b3e365d9e516ef4b90935fd42ab409015
@@ -1,3 +1,16 @@
1
+ ### 0.7.0 / 2015-12-12
2
+
3
+ * New features
4
+ * upgraded to latest the latest Mondrian version 3.11
5
+ * removed Java 6 support
6
+ * fixes for JRuby 9.0 support
7
+ * added a query builder method "distinct"
8
+ * Improvements
9
+ * added annotations for dimension_usage and virtual_cube_dimension schema elements
10
+ * Bug fixes
11
+ * fixed the order of axis aliases - columns, rows, pages, chapters, sections
12
+
13
+
1
14
  ### 0.6.0 / 2014-11-10
2
15
 
3
16
  * New features
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2010-2014 Raimonds Simanovskis
3
+ Copyright (c) 2010-2015 Raimonds Simanovskis
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -105,7 +105,7 @@ require "jdbc/mysql"
105
105
 
106
106
  olap = Mondrian::OLAP::Connection.create(
107
107
  driver: 'mysql',
108
- host: 'localhost,
108
+ host: 'localhost',
109
109
  database: 'mondrian_test',
110
110
  username: 'mondrian_user',
111
111
  password: 'secret',
@@ -270,9 +270,9 @@ See more examples of data access roles in `spec/connection_role_spec.rb`.
270
270
  REQUIREMENTS
271
271
  ------------
272
272
 
273
- mondrian-olap gem is compatible with JRuby version 1.7 and Java 6, 7 or 8 VM. mondrian-olap works only with JRuby and not with other Ruby implementations as it includes Mondrian OLAP Java libraries.
273
+ mondrian-olap gem is compatible with JRuby versions 1.7 and 9.0 and Java 7 or 8 VM. mondrian-olap works only with JRuby and not with other Ruby implementations as it includes Mondrian OLAP Java libraries.
274
274
 
275
- mondrian-olap supports MySQL, PostgreSQL, Oracle, LucidDB and Microsoft SQL Server databases as well as other databases that are supported by Mondrian OLAP engine (using jdbc_driver and jdbc_url connection parameters). When using MySQL, PostgreSQL or LucidDB databases then install jdbc-mysql, jdbc-postgres or jdbc-luciddb gem and require "jdbc/mysql", "jdbc/postgres" or "jdbc/luciddb" to load the corresponding JDBC database driver. When using Oracle then include Oracle JDBC driver (`ojdbc6.jar` for Java 6) in `CLASSPATH` or copy to `JRUBY_HOME/lib` or require it in application manually. When using SQL Server you can choose between the jTDS or Microsoft JDBC drivers. If you use jTDS require "jdbc/jtds". If you use the Microsoft JDBC driver include `sqljdbc.jar` or `sqljdbc4.jar` in `CLASSPATH` or copy to `JRUBY_HOME/lib` or require it in application manually.
275
+ mondrian-olap supports MySQL, PostgreSQL, Oracle, LucidDB and Microsoft SQL Server databases as well as other databases that are supported by Mondrian OLAP engine (using jdbc_driver and jdbc_url connection parameters). When using MySQL, PostgreSQL or LucidDB databases then install jdbc-mysql, jdbc-postgres or jdbc-luciddb gem and require "jdbc/mysql", "jdbc/postgres" or "jdbc/luciddb" to load the corresponding JDBC database driver. When using Oracle then include Oracle JDBC driver (`ojdbc7.jar` for Java 7) in `CLASSPATH` or copy to `JRUBY_HOME/lib` or require it in application manually. When using SQL Server you can choose between the jTDS or Microsoft JDBC drivers. If you use jTDS require "jdbc/jtds". If you use the Microsoft JDBC driver include `sqljdbc.jar` or `sqljdbc4.jar` in `CLASSPATH` or copy to `JRUBY_HOME/lib` or require it in application manually.
276
276
 
277
277
  INSTALL
278
278
  -------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.7.0
@@ -34,7 +34,7 @@ module Mondrian
34
34
  end
35
35
  end
36
36
 
37
- AXIS_ALIASES = %w(columns rows pages sections chapters)
37
+ AXIS_ALIASES = %w(columns rows pages chapters sections)
38
38
  AXIS_ALIASES.each_with_index do |axis, i|
39
39
  class_eval <<-RUBY, __FILE__, __LINE__ + 1
40
40
  def #{axis}(*axis_members)
@@ -73,6 +73,12 @@ module Mondrian
73
73
  self
74
74
  end
75
75
 
76
+ def distinct
77
+ raise ArgumentError, "cannot use distinct method before axis method" unless @current_set
78
+ @current_set.replace [:distinct, @current_set.clone]
79
+ self
80
+ end
81
+
76
82
  def filter(condition, options={})
77
83
  raise ArgumentError, "cannot use filter method before axis or with_set method" unless @current_set
78
84
  @current_set.replace [:filter, @current_set.clone, condition]
@@ -309,6 +315,8 @@ module Mondrian
309
315
  "EXCEPT(#{members_to_mdx(members[1])}, #{members_to_mdx(members[2])})"
310
316
  when :nonempty
311
317
  "NON EMPTY #{members_to_mdx(members[1])}"
318
+ when :distinct
319
+ "DISTINCT(#{members_to_mdx(members[1])})"
312
320
  when :filter
313
321
  as_alias = members[3] ? " AS #{members[3]}" : nil
314
322
  "FILTER(#{members_to_mdx(members[1])}#{as_alias}, #{members[2]})"
@@ -333,7 +333,7 @@ module Mondrian
333
333
 
334
334
  def self.parse_return_fields(result, params)
335
335
  return_field_names = []
336
- return_expressions = nil
336
+ return_expressions = []
337
337
  nonempty_columns = []
338
338
 
339
339
  if params[:return] || params[:nonempty]
@@ -354,10 +354,10 @@ module Mondrian
354
354
 
355
355
  case level_or_member
356
356
  when Java::MondrianOlap::Level
357
- Java::MondrianMdx::LevelExpr.new level_or_member
357
+ level_or_member
358
358
  when Java::MondrianOlap::Member
359
359
  raise ArgumentError, "cannot use calculated member #{return_field} as return field" if level_or_member.isCalculated
360
- Java::mondrian.mdx.MemberExpr.new level_or_member
360
+ level_or_member
361
361
  else
362
362
  raise ArgumentError, "return field #{return_field} should be level or measure"
363
363
  end
@@ -115,6 +115,7 @@ module Mondrian
115
115
  # Required in a private Dimension or a DimensionUsage, but not in a public Dimension.
116
116
  :foreign_key
117
117
  data_dictionary_names :usage_prefix, :foreign_key # values in XML will be uppercased when using Oracle driver
118
+ elements :annotations
118
119
 
119
120
  def initialize(name = nil, attributes = {}, parent = nil)
120
121
  super
@@ -347,6 +348,7 @@ module Mondrian
347
348
  :cube_name,
348
349
  # Whether this dimension is visible in the user-interface. Default true.
349
350
  :visible
351
+ elements :annotations
350
352
  end
351
353
 
352
354
  class VirtualCubeMeasure < SchemaElement
@@ -179,6 +179,13 @@ describe "Query" do
179
179
  end
180
180
  end
181
181
 
182
+ describe "distinct" do
183
+ it "should limit to set of distinct tuples" do
184
+ @query.rows('[Product].children').distinct.nonempty.columns('[Measures].[Unit Sales]', '[Measures].[Store Sales]')
185
+ @query.rows.should == [:nonempty, [:distinct, ["[Product].children"]]]
186
+ end
187
+ end
188
+
182
189
  describe "order" do
183
190
  it "should order by one measure" do
184
191
  @query.rows('[Product].children').order('[Measures].[Unit Sales]', :bdesc)
@@ -784,12 +791,14 @@ describe "Query" do
784
791
  end if %w(mysql postgresql).include? MONDRIAN_DRIVER
785
792
 
786
793
  it "should return table names" do
787
- @drill_through.table_names.should == [
794
+ # ignore calculated customer full name column name which is shown differently on each database
795
+ @drill_through.table_names[0..12].should == [
788
796
  "time", "time", "time", "time", "time",
789
797
  "product_classes", "product_classes", "product_classes", "product_classes", "products", "products",
790
- "customers", "customers", "", "customers",
791
- "customers",
792
- "sales"
798
+ "customers", "customers"
799
+ ]
800
+ @drill_through.table_names[14..16].should == [
801
+ "customers", "customers", "sales"
793
802
  ]
794
803
  end if %w(mysql postgresql).include? MONDRIAN_DRIVER
795
804
 
@@ -67,7 +67,7 @@ end
67
67
  puts "==> Using #{MONDRIAN_DRIVER} driver"
68
68
 
69
69
  require 'mondrian/olap'
70
- require 'spec/support/matchers/be_like'
70
+ require_relative 'support/matchers/be_like'
71
71
 
72
72
  RSpec.configure do |config|
73
73
  config.include Matchers
metadata CHANGED
@@ -1,25 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mondrian-olap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raimonds Simanovskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-10 00:00:00.000000000 Z
11
+ date: 2015-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  requirement: !ruby/object:Gem::Requirement
21
21
  requirements:
22
- - - '>='
22
+ - - ">="
23
23
  - !ruby/object:Gem::Version
24
24
  version: '0'
25
25
  prerelease: false
@@ -28,12 +28,12 @@ dependencies:
28
28
  name: bundler
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: '0'
39
39
  prerelease: false
@@ -42,12 +42,12 @@ dependencies:
42
42
  name: rake
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  prerelease: false
@@ -56,12 +56,12 @@ dependencies:
56
56
  name: rspec
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  requirement: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  prerelease: false
@@ -70,12 +70,12 @@ dependencies:
70
70
  name: rdoc
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirement: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  prerelease: false
@@ -84,12 +84,12 @@ dependencies:
84
84
  name: jdbc-mysql
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirement: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  prerelease: false
@@ -98,12 +98,12 @@ dependencies:
98
98
  name: jdbc-postgres
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  prerelease: false
@@ -112,12 +112,12 @@ dependencies:
112
112
  name: jdbc-luciddb
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirement: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - '>='
120
+ - - ">="
121
121
  - !ruby/object:Gem::Version
122
122
  version: '0'
123
123
  prerelease: false
@@ -126,12 +126,12 @@ dependencies:
126
126
  name: jdbc-jtds
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: 1.2.8
132
132
  requirement: !ruby/object:Gem::Requirement
133
133
  requirements:
134
- - - ~>
134
+ - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: 1.2.8
137
137
  prerelease: false
@@ -140,26 +140,26 @@ dependencies:
140
140
  name: activerecord
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 4.0.0
146
146
  requirement: !ruby/object:Gem::Requirement
147
147
  requirements:
148
- - - '>='
148
+ - - "~>"
149
149
  - !ruby/object:Gem::Version
150
- version: '0'
150
+ version: 4.0.0
151
151
  prerelease: false
152
152
  type: :development
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: activerecord-jdbc-adapter
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  requirements:
162
- - - '>='
162
+ - - ">="
163
163
  - !ruby/object:Gem::Version
164
164
  version: '0'
165
165
  prerelease: false
@@ -168,12 +168,12 @@ dependencies:
168
168
  name: activerecord-oracle_enhanced-adapter
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirement: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - '>='
176
+ - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  prerelease: false
@@ -182,12 +182,12 @@ dependencies:
182
182
  name: pry
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - '>='
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  requirement: !ruby/object:Gem::Requirement
189
189
  requirements:
190
- - - '>='
190
+ - - ">="
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  prerelease: false
@@ -196,12 +196,12 @@ dependencies:
196
196
  name: therubyrhino
197
197
  version_requirements: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - '>='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  requirement: !ruby/object:Gem::Requirement
203
203
  requirements:
204
- - - '>='
204
+ - - ">="
205
205
  - !ruby/object:Gem::Version
206
206
  version: '0'
207
207
  prerelease: false
@@ -210,18 +210,20 @@ dependencies:
210
210
  name: coffee-script
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - '>='
213
+ - - ">="
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  requirement: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - '>='
218
+ - - ">="
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  prerelease: false
222
222
  type: :development
223
- description: |
224
- JRuby gem for performing multidimensional queries of relational database data using Mondrian OLAP Java library
223
+ description: 'JRuby gem for performing multidimensional queries of relational database
224
+ data using Mondrian OLAP Java library
225
+
226
+ '
225
227
  email:
226
228
  - raimonds.simanovskis@gmail.com
227
229
  executables: []
@@ -235,22 +237,22 @@ files:
235
237
  - README.md
236
238
  - VERSION
237
239
  - lib/mondrian-olap.rb
238
- - lib/mondrian/olap.rb
239
240
  - lib/mondrian/jars/commons-collections-3.2.1.jar
240
241
  - lib/mondrian/jars/commons-dbcp-1.4.jar
241
242
  - lib/mondrian/jars/commons-io-2.2.jar
242
243
  - lib/mondrian/jars/commons-logging-1.1.1.jar
243
244
  - lib/mondrian/jars/commons-math-1.1.jar
244
245
  - lib/mondrian/jars/commons-pool-1.5.7.jar
245
- - lib/mondrian/jars/commons-vfs-20100924-pentaho.jar
246
+ - lib/mondrian/jars/commons-vfs2-2.1-20150824.jar
246
247
  - lib/mondrian/jars/eigenbase-properties-1.1.2.jar
247
248
  - lib/mondrian/jars/eigenbase-resgen-1.3.1.jar
248
249
  - lib/mondrian/jars/eigenbase-xom-1.3.1.jar
249
250
  - lib/mondrian/jars/javacup-10k.jar
250
251
  - lib/mondrian/jars/log4j-1.2.17.jar
251
252
  - lib/mondrian/jars/log4j.properties
252
- - lib/mondrian/jars/mondrian-3.8.0.0-209.jar
253
+ - lib/mondrian/jars/mondrian-3.11.0.0-353.jar
253
254
  - lib/mondrian/jars/olap4j-1.2.0.jar
255
+ - lib/mondrian/olap.rb
254
256
  - lib/mondrian/olap/connection.rb
255
257
  - lib/mondrian/olap/cube.rb
256
258
  - lib/mondrian/olap/error.rb
@@ -263,13 +265,13 @@ files:
263
265
  - spec/connection_role_spec.rb
264
266
  - spec/connection_spec.rb
265
267
  - spec/cube_spec.rb
268
+ - spec/fixtures/MondrianTest.xml
269
+ - spec/fixtures/MondrianTestOracle.xml
266
270
  - spec/mondrian_spec.rb
267
271
  - spec/query_spec.rb
268
272
  - spec/rake_tasks.rb
269
273
  - spec/schema_definition_spec.rb
270
274
  - spec/spec_helper.rb
271
- - spec/fixtures/MondrianTest.xml
272
- - spec/fixtures/MondrianTestOracle.xml
273
275
  - spec/support/matchers/be_like.rb
274
276
  homepage: http://github.com/rsim/mondrian-olap
275
277
  licenses:
@@ -281,17 +283,17 @@ require_paths:
281
283
  - lib
282
284
  required_ruby_version: !ruby/object:Gem::Requirement
283
285
  requirements:
284
- - - '>='
286
+ - - ">="
285
287
  - !ruby/object:Gem::Version
286
288
  version: '0'
287
289
  required_rubygems_version: !ruby/object:Gem::Requirement
288
290
  requirements:
289
- - - '>='
291
+ - - ">="
290
292
  - !ruby/object:Gem::Version
291
293
  version: '0'
292
294
  requirements: []
293
295
  rubyforge_project:
294
- rubygems_version: 2.1.9
296
+ rubygems_version: 2.4.8
295
297
  signing_key:
296
298
  specification_version: 4
297
299
  summary: JRuby API for Mondrian OLAP Java library
@@ -299,11 +301,11 @@ test_files:
299
301
  - spec/connection_role_spec.rb
300
302
  - spec/connection_spec.rb
301
303
  - spec/cube_spec.rb
304
+ - spec/fixtures/MondrianTest.xml
305
+ - spec/fixtures/MondrianTestOracle.xml
302
306
  - spec/mondrian_spec.rb
303
307
  - spec/query_spec.rb
304
308
  - spec/rake_tasks.rb
305
309
  - spec/schema_definition_spec.rb
306
310
  - spec/spec_helper.rb
307
- - spec/fixtures/MondrianTest.xml
308
- - spec/fixtures/MondrianTestOracle.xml
309
311
  - spec/support/matchers/be_like.rb