mondrian-olap 0.8.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Changelog.md +36 -0
- data/LICENSE.txt +1 -1
- data/README.md +5 -2
- data/VERSION +1 -1
- data/lib/mondrian/jars/commons-collections-3.2.2.jar +0 -0
- data/lib/mondrian/jars/commons-lang-2.6.jar +0 -0
- data/lib/mondrian/jars/commons-logging-1.2.jar +0 -0
- data/lib/mondrian/jars/commons-vfs2-2.2.jar +0 -0
- data/lib/mondrian/jars/eigenbase-xom-1.3.5.jar +0 -0
- data/lib/mondrian/jars/log4j.properties +2 -4
- data/lib/mondrian/jars/mondrian-8.3.0.5.jar +0 -0
- data/lib/mondrian/olap/connection.rb +112 -16
- data/lib/mondrian/olap/cube.rb +9 -2
- data/lib/mondrian/olap/error.rb +37 -8
- data/lib/mondrian/olap/query.rb +14 -17
- data/lib/mondrian/olap/result.rb +73 -40
- data/lib/mondrian/olap/schema.rb +1 -0
- data/lib/mondrian/olap/schema_element.rb +20 -4
- data/lib/mondrian/olap/schema_udf.rb +21 -16
- data/spec/connection_role_spec.rb +65 -12
- data/spec/connection_spec.rb +2 -0
- data/spec/cube_cache_control_spec.rb +16 -12
- data/spec/query_spec.rb +157 -21
- data/spec/schema_definition_spec.rb +151 -55
- data/spec/spec_helper.rb +75 -0
- metadata +65 -64
- data/lib/mondrian/jars/commons-collections-3.2.1.jar +0 -0
- data/lib/mondrian/jars/commons-logging-1.1.1.jar +0 -0
- data/lib/mondrian/jars/commons-vfs2-2.1-20150824.jar +0 -0
- data/lib/mondrian/jars/eigenbase-xom-1.3.1.jar +0 -0
- data/lib/mondrian/jars/mondrian-3.12.0.6-237.jar +0 -0
data/spec/spec_helper.rb
CHANGED
@@ -32,7 +32,56 @@ when 'mssql'
|
|
32
32
|
require 'jdbc/jtds'
|
33
33
|
JDBC_DRIVER = 'net.sourceforge.jtds.jdbc.Driver'
|
34
34
|
when 'sqlserver'
|
35
|
+
Dir[File.expand_path("{mssql-jdbc,sqljdbc}*.jar", 'spec/support/jars')].each do |jdbc_driver_file|
|
36
|
+
require jdbc_driver_file
|
37
|
+
end
|
35
38
|
JDBC_DRIVER = 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
|
39
|
+
when 'vertica'
|
40
|
+
Dir[File.expand_path("vertica*.jar", 'spec/support/jars')].each do |jdbc_driver_file|
|
41
|
+
require jdbc_driver_file
|
42
|
+
end
|
43
|
+
JDBC_DRIVER = 'com.vertica.jdbc.Driver'
|
44
|
+
DATABASE_SCHEMA = ENV["#{env_prefix}_DATABASE_SCHEMA"] || ENV['DATABASE_SCHEMA'] || 'mondrian_test'
|
45
|
+
# patches for Vertica minimal AR support
|
46
|
+
require 'arjdbc/jdbc/adapter'
|
47
|
+
ActiveRecord::ConnectionAdapters::JdbcAdapter.class_eval do
|
48
|
+
def modify_types(tp)
|
49
|
+
# mapping of ActiveRecord data types to Vertica data types
|
50
|
+
tp[:primary_key] = "identity"
|
51
|
+
tp[:integer] = "int"
|
52
|
+
end
|
53
|
+
# by default Vertica stores table and column names in uppercase
|
54
|
+
def quote_table_name(name)
|
55
|
+
"\"#{name.to_s}\""
|
56
|
+
end
|
57
|
+
def quote_column_name(name)
|
58
|
+
"\"#{name.to_s}\""
|
59
|
+
end
|
60
|
+
# exec_insert tries to use Statement.RETURN_GENERATED_KEYS which is not supported by Vertica
|
61
|
+
def exec_insert(sql, name, binds, pk = nil, sequence_name = nil)
|
62
|
+
exec_update(sql, name, binds)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
when 'snowflake'
|
66
|
+
Dir[File.expand_path("snowflake*.jar", 'spec/support/jars')].each do |jdbc_driver_file|
|
67
|
+
require jdbc_driver_file
|
68
|
+
end
|
69
|
+
JDBC_DRIVER = 'net.snowflake.client.jdbc.SnowflakeDriver'
|
70
|
+
DATABASE_SCHEMA = ENV["#{env_prefix}_DATABASE_SCHEMA"] || ENV['DATABASE_SCHEMA'] || 'mondrian_test'
|
71
|
+
WAREHOUSE_NAME = ENV["#{env_prefix}_WAREHOUSE_NAME"] || ENV['WAREHOUSE_NAME'] || 'mondrian_test'
|
72
|
+
CATALOG_FILE = File.expand_path('../fixtures/MondrianTestOracle.xml', __FILE__)
|
73
|
+
require 'arjdbc/jdbc/adapter'
|
74
|
+
ActiveRecord::ConnectionAdapters::JdbcAdapter.class_eval do
|
75
|
+
def modify_types(tp)
|
76
|
+
# mapping of ActiveRecord data types to Snowflake data types
|
77
|
+
tp[:primary_key] = "integer"
|
78
|
+
tp[:integer] = "integer"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
require 'arjdbc/jdbc/type_converter'
|
82
|
+
# Hack to disable :text and :binary types for Snowflake
|
83
|
+
ActiveRecord::ConnectionAdapters::JdbcTypeConverter::AR_TO_JDBC_TYPES.delete(:text)
|
84
|
+
ActiveRecord::ConnectionAdapters::JdbcTypeConverter::AR_TO_JDBC_TYPES.delete(:binary)
|
36
85
|
when 'luciddb'
|
37
86
|
require 'jdbc/luciddb'
|
38
87
|
CATALOG_FILE = File.expand_path('../fixtures/MondrianTestOracle.xml', __FILE__)
|
@@ -137,6 +186,24 @@ when 'sqlserver'
|
|
137
186
|
:password => CONNECTION_PARAMS[:password],
|
138
187
|
:connection_alive_sql => 'SELECT 1'
|
139
188
|
}
|
189
|
+
when 'vertica'
|
190
|
+
AR_CONNECTION_PARAMS = {
|
191
|
+
adapter: 'jdbc',
|
192
|
+
driver: JDBC_DRIVER,
|
193
|
+
url: "jdbc:#{MONDRIAN_DRIVER}://#{CONNECTION_PARAMS[:host]}/#{CONNECTION_PARAMS[:database]}?SearchPath=#{DATABASE_SCHEMA}&LogLevel=DEBUG",
|
194
|
+
username: CONNECTION_PARAMS[:username],
|
195
|
+
password: CONNECTION_PARAMS[:password]
|
196
|
+
}
|
197
|
+
when 'snowflake'
|
198
|
+
CONNECTION_PARAMS[:database_schema] = DATABASE_SCHEMA
|
199
|
+
CONNECTION_PARAMS[:warehouse] = WAREHOUSE_NAME
|
200
|
+
AR_CONNECTION_PARAMS = {
|
201
|
+
adapter: 'jdbc',
|
202
|
+
driver: JDBC_DRIVER,
|
203
|
+
url: "jdbc:#{MONDRIAN_DRIVER}://#{CONNECTION_PARAMS[:host]}/?db=#{CONNECTION_PARAMS[:database]}&schema=#{DATABASE_SCHEMA}&warehouse=#{WAREHOUSE_NAME}&tracing=ALL",
|
204
|
+
username: CONNECTION_PARAMS[:username],
|
205
|
+
password: CONNECTION_PARAMS[:password]
|
206
|
+
}
|
140
207
|
when /jdbc/
|
141
208
|
AR_CONNECTION_PARAMS = {
|
142
209
|
:adapter => 'jdbc',
|
@@ -157,6 +224,14 @@ else
|
|
157
224
|
}
|
158
225
|
end
|
159
226
|
|
227
|
+
# Avoid "Establishing SSL connection without server's identity verification ..." warnings
|
228
|
+
case MONDRIAN_DRIVER
|
229
|
+
when 'mysql'
|
230
|
+
AR_CONNECTION_PARAMS[:properties] = CONNECTION_PARAMS[:properties] = {useSSL: false}
|
231
|
+
when 'jdbc_mysql'
|
232
|
+
AR_CONNECTION_PARAMS[:url] = CONNECTION_PARAMS[:jdbc_url] << '?useSSL=false'
|
233
|
+
end
|
234
|
+
|
160
235
|
CONNECTION_PARAMS_WITH_CATALOG = CONNECTION_PARAMS.merge(:catalog => CATALOG_FILE)
|
161
236
|
|
162
237
|
ActiveRecord::Base.establish_connection(AR_CONNECTION_PARAMS)
|
metadata
CHANGED
@@ -1,225 +1,225 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mondrian-olap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.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:
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: nokogiri
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
14
|
requirement: !ruby/object:Gem::Requirement
|
21
15
|
requirements:
|
22
16
|
- - ">="
|
23
17
|
- !ruby/object:Gem::Version
|
24
18
|
version: '0'
|
19
|
+
name: nokogiri
|
25
20
|
prerelease: false
|
26
21
|
type: :runtime
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
22
|
version_requirements: !ruby/object:Gem::Requirement
|
30
23
|
requirements:
|
31
24
|
- - ">="
|
32
25
|
- !ruby/object:Gem::Version
|
33
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
34
28
|
requirement: !ruby/object:Gem::Requirement
|
35
29
|
requirements:
|
36
30
|
- - ">="
|
37
31
|
- !ruby/object:Gem::Version
|
38
32
|
version: '0'
|
33
|
+
name: bundler
|
39
34
|
prerelease: false
|
40
35
|
type: :development
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
36
|
version_requirements: !ruby/object:Gem::Requirement
|
44
37
|
requirements:
|
45
38
|
- - ">="
|
46
39
|
- !ruby/object:Gem::Version
|
47
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
48
42
|
requirement: !ruby/object:Gem::Requirement
|
49
43
|
requirements:
|
50
|
-
- - "
|
44
|
+
- - "~>"
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
46
|
+
version: 10.3.2
|
47
|
+
name: rake
|
53
48
|
prerelease: false
|
54
49
|
type: :development
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
50
|
version_requirements: !ruby/object:Gem::Requirement
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
54
|
+
version: 10.3.2
|
55
|
+
- !ruby/object:Gem::Dependency
|
62
56
|
requirement: !ruby/object:Gem::Requirement
|
63
57
|
requirements:
|
64
|
-
- -
|
58
|
+
- - "~>"
|
65
59
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
60
|
+
version: 2.14.0
|
61
|
+
name: rspec
|
67
62
|
prerelease: false
|
68
63
|
type: :development
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rdoc
|
71
64
|
version_requirements: !ruby/object:Gem::Requirement
|
72
65
|
requirements:
|
73
|
-
- - "
|
66
|
+
- - "~>"
|
74
67
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
68
|
+
version: 2.14.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
76
70
|
requirement: !ruby/object:Gem::Requirement
|
77
71
|
requirements:
|
78
|
-
- - "
|
72
|
+
- - "~>"
|
79
73
|
- !ruby/object:Gem::Version
|
80
|
-
version:
|
74
|
+
version: 4.2.2
|
75
|
+
name: rdoc
|
81
76
|
prerelease: false
|
82
77
|
type: :development
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: jdbc-mysql
|
85
78
|
version_requirements: !ruby/object:Gem::Requirement
|
86
79
|
requirements:
|
87
|
-
- - "
|
80
|
+
- - "~>"
|
88
81
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
82
|
+
version: 4.2.2
|
83
|
+
- !ruby/object:Gem::Dependency
|
90
84
|
requirement: !ruby/object:Gem::Requirement
|
91
85
|
requirements:
|
92
86
|
- - ">="
|
93
87
|
- !ruby/object:Gem::Version
|
94
88
|
version: '0'
|
89
|
+
name: jdbc-mysql
|
95
90
|
prerelease: false
|
96
91
|
type: :development
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: jdbc-postgres
|
99
92
|
version_requirements: !ruby/object:Gem::Requirement
|
100
93
|
requirements:
|
101
94
|
- - ">="
|
102
95
|
- !ruby/object:Gem::Version
|
103
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
104
98
|
requirement: !ruby/object:Gem::Requirement
|
105
99
|
requirements:
|
106
100
|
- - ">="
|
107
101
|
- !ruby/object:Gem::Version
|
108
102
|
version: '0'
|
103
|
+
name: jdbc-postgres
|
109
104
|
prerelease: false
|
110
105
|
type: :development
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: jdbc-luciddb
|
113
106
|
version_requirements: !ruby/object:Gem::Requirement
|
114
107
|
requirements:
|
115
108
|
- - ">="
|
116
109
|
- !ruby/object:Gem::Version
|
117
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
118
112
|
requirement: !ruby/object:Gem::Requirement
|
119
113
|
requirements:
|
120
114
|
- - ">="
|
121
115
|
- !ruby/object:Gem::Version
|
122
116
|
version: '0'
|
117
|
+
name: jdbc-luciddb
|
123
118
|
prerelease: false
|
124
119
|
type: :development
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: jdbc-jtds
|
127
120
|
version_requirements: !ruby/object:Gem::Requirement
|
128
121
|
requirements:
|
129
|
-
- - "
|
122
|
+
- - ">="
|
130
123
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
132
126
|
requirement: !ruby/object:Gem::Requirement
|
133
127
|
requirements:
|
134
128
|
- - "~>"
|
135
129
|
- !ruby/object:Gem::Version
|
136
130
|
version: 1.2.8
|
131
|
+
name: jdbc-jtds
|
137
132
|
prerelease: false
|
138
133
|
type: :development
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: activerecord
|
141
134
|
version_requirements: !ruby/object:Gem::Requirement
|
142
135
|
requirements:
|
143
136
|
- - "~>"
|
144
137
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
138
|
+
version: 1.2.8
|
139
|
+
- !ruby/object:Gem::Dependency
|
146
140
|
requirement: !ruby/object:Gem::Requirement
|
147
141
|
requirements:
|
148
142
|
- - "~>"
|
149
143
|
- !ruby/object:Gem::Version
|
150
144
|
version: 4.0.0
|
145
|
+
name: activerecord
|
151
146
|
prerelease: false
|
152
147
|
type: :development
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: activerecord-jdbc-adapter
|
155
148
|
version_requirements: !ruby/object:Gem::Requirement
|
156
149
|
requirements:
|
157
|
-
- - "
|
150
|
+
- - "~>"
|
158
151
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
152
|
+
version: 4.0.0
|
153
|
+
- !ruby/object:Gem::Dependency
|
160
154
|
requirement: !ruby/object:Gem::Requirement
|
161
155
|
requirements:
|
162
|
-
- - "
|
156
|
+
- - "~>"
|
163
157
|
- !ruby/object:Gem::Version
|
164
|
-
version:
|
158
|
+
version: 1.3.25
|
159
|
+
name: activerecord-jdbc-adapter
|
165
160
|
prerelease: false
|
166
161
|
type: :development
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: activerecord-oracle_enhanced-adapter
|
169
162
|
version_requirements: !ruby/object:Gem::Requirement
|
170
163
|
requirements:
|
171
164
|
- - "~>"
|
172
165
|
- !ruby/object:Gem::Version
|
173
|
-
version: 1.
|
166
|
+
version: 1.3.25
|
167
|
+
- !ruby/object:Gem::Dependency
|
174
168
|
requirement: !ruby/object:Gem::Requirement
|
175
169
|
requirements:
|
176
170
|
- - "~>"
|
177
171
|
- !ruby/object:Gem::Version
|
178
172
|
version: 1.5.6
|
173
|
+
name: activerecord-oracle_enhanced-adapter
|
179
174
|
prerelease: false
|
180
175
|
type: :development
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: pry
|
183
176
|
version_requirements: !ruby/object:Gem::Requirement
|
184
177
|
requirements:
|
185
|
-
- - "
|
178
|
+
- - "~>"
|
186
179
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
180
|
+
version: 1.5.6
|
181
|
+
- !ruby/object:Gem::Dependency
|
188
182
|
requirement: !ruby/object:Gem::Requirement
|
189
183
|
requirements:
|
190
184
|
- - ">="
|
191
185
|
- !ruby/object:Gem::Version
|
192
186
|
version: '0'
|
187
|
+
name: pry
|
193
188
|
prerelease: false
|
194
189
|
type: :development
|
195
|
-
- !ruby/object:Gem::Dependency
|
196
|
-
name: therubyrhino
|
197
190
|
version_requirements: !ruby/object:Gem::Requirement
|
198
191
|
requirements:
|
199
192
|
- - ">="
|
200
193
|
- !ruby/object:Gem::Version
|
201
194
|
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
202
196
|
requirement: !ruby/object:Gem::Requirement
|
203
197
|
requirements:
|
204
198
|
- - ">="
|
205
199
|
- !ruby/object:Gem::Version
|
206
200
|
version: '0'
|
201
|
+
name: therubyrhino
|
207
202
|
prerelease: false
|
208
203
|
type: :development
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: coffee-script
|
211
204
|
version_requirements: !ruby/object:Gem::Requirement
|
212
205
|
requirements:
|
213
206
|
- - ">="
|
214
207
|
- !ruby/object:Gem::Version
|
215
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
216
210
|
requirement: !ruby/object:Gem::Requirement
|
217
211
|
requirements:
|
218
212
|
- - ">="
|
219
213
|
- !ruby/object:Gem::Version
|
220
214
|
version: '0'
|
215
|
+
name: coffee-script
|
221
216
|
prerelease: false
|
222
217
|
type: :development
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
223
223
|
description: 'JRuby gem for performing multidimensional queries of relational database
|
224
224
|
data using Mondrian OLAP Java library
|
225
225
|
|
@@ -237,20 +237,21 @@ files:
|
|
237
237
|
- README.md
|
238
238
|
- VERSION
|
239
239
|
- lib/mondrian-olap.rb
|
240
|
-
- lib/mondrian/jars/commons-collections-3.2.
|
240
|
+
- lib/mondrian/jars/commons-collections-3.2.2.jar
|
241
241
|
- lib/mondrian/jars/commons-dbcp-1.4.jar
|
242
242
|
- lib/mondrian/jars/commons-io-2.2.jar
|
243
|
-
- lib/mondrian/jars/commons-
|
243
|
+
- lib/mondrian/jars/commons-lang-2.6.jar
|
244
|
+
- lib/mondrian/jars/commons-logging-1.2.jar
|
244
245
|
- lib/mondrian/jars/commons-math-1.1.jar
|
245
246
|
- lib/mondrian/jars/commons-pool-1.5.7.jar
|
246
|
-
- lib/mondrian/jars/commons-vfs2-2.
|
247
|
+
- lib/mondrian/jars/commons-vfs2-2.2.jar
|
247
248
|
- lib/mondrian/jars/eigenbase-properties-1.1.2.jar
|
248
249
|
- lib/mondrian/jars/eigenbase-resgen-1.3.1.jar
|
249
|
-
- lib/mondrian/jars/eigenbase-xom-1.3.
|
250
|
+
- lib/mondrian/jars/eigenbase-xom-1.3.5.jar
|
250
251
|
- lib/mondrian/jars/javacup-10k.jar
|
251
252
|
- lib/mondrian/jars/log4j-1.2.17.jar
|
252
253
|
- lib/mondrian/jars/log4j.properties
|
253
|
-
- lib/mondrian/jars/mondrian-3.
|
254
|
+
- lib/mondrian/jars/mondrian-8.3.0.5.jar
|
254
255
|
- lib/mondrian/jars/olap4j-1.2.0.jar
|
255
256
|
- lib/mondrian/olap.rb
|
256
257
|
- lib/mondrian/olap/connection.rb
|
@@ -294,7 +295,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
295
|
version: '0'
|
295
296
|
requirements: []
|
296
297
|
rubyforge_project:
|
297
|
-
rubygems_version: 2.
|
298
|
+
rubygems_version: 2.7.10
|
298
299
|
signing_key:
|
299
300
|
specification_version: 4
|
300
301
|
summary: JRuby API for Mondrian OLAP Java library
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|