mondrian-olap 1.1.0 → 1.2.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
  SHA256:
3
- metadata.gz: 0df66cbf2bfa1f2a0a746568e7491398870121101d15b23d486e270877de3900
4
- data.tar.gz: bfd14249c31c8f4b050c186cf5b355aaa6d91a8a042b89555d862868cfa52ee8
3
+ metadata.gz: e5b807f5866de6c32810049ddaa15cf62725bdd14db8c92be93828172cc4a0c6
4
+ data.tar.gz: 34eb04b5545e340509f8699ce499a447a32effee40749e1b580d6063b7d596cf
5
5
  SHA512:
6
- metadata.gz: 62219364cd64926f57429c4e6ff3373bc5fc19eaadd638544875407357ed11c5442716a6f5245078980762f31c170813bc8ed86e0c7dee6a54c1063c97827b03
7
- data.tar.gz: c48f2a34b98c53955af10ccf093bcb73797e6f122282d70ffdf4a0cfeecded72a413bdf782ad68a58c9b44733bd9d4129bf865551fab894b98e1dcafeec717d8
6
+ metadata.gz: 503b38add95142332eb40c8885075461b98bb2cbbb2f49446b213754a593b94fd2226a965e2d90383e96b163eeab180a5de999cc3631b347060e5c59323ef83b
7
+ data.tar.gz: 7a9e42bda5d2acc62ccda1da5ab63bb63ad51c49828ed08e89a83e5c4e1a2742118be320c925e7771e29e95166b2e73e26420ac5f7132c4ffb3a2e4221c8ce83
data/Changelog.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### Master
2
+
3
+ ### 1.2.0 / 2021-03-06
4
+
5
+ * New features
6
+ * Upgrade to the latest Mondrian version 9.1.0.0
7
+ * Improved Vertica and Snowflake tests to use bulk data loading
8
+ * Remove support of LucidDB (which is abandoned a long time ago)
9
+ * Improve bigint key columns support
10
+ * Add MySQL 8 JDBC driver support
11
+ * Tested with JRuby 9.2.14.0
12
+ * Remove JRuby 1.7 support
13
+
1
14
  ### 1.1.0 / 2019-11-09
2
15
 
3
16
  * New features
@@ -0,0 +1,87 @@
1
+ Eclipse Public License -v 1.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
4
+
5
+ 1. DEFINITIONS
6
+
7
+ "Contribution" means:
8
+
9
+ a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
10
+
11
+ b) in the case of each subsequent Contributor:
12
+
13
+ i) changes to the Program, and
14
+
15
+ ii) additions to the Program;
16
+
17
+ where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
18
+
19
+ "Contributor" means any person or entity that distributes the Program.
20
+
21
+ "Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
22
+
23
+ "Program" means the Contributions distributed in accordance with this Agreement.
24
+
25
+ "Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
26
+
27
+ 2. GRANT OF RIGHTS
28
+
29
+ a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
30
+
31
+ b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
32
+
33
+ c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
34
+
35
+ d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
36
+
37
+ 3. REQUIREMENTS
38
+
39
+ A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
40
+
41
+ a) it complies with the terms and conditions of this Agreement; and
42
+
43
+ b) its license agreement:
44
+
45
+ i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
46
+
47
+ ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
48
+
49
+ iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
50
+
51
+ iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
52
+
53
+ When the Program is made available in source code form:
54
+
55
+ a) it must be made available under this Agreement; and
56
+
57
+ b) a copy of this Agreement must be included with each copy of the Program.
58
+
59
+ Contributors may not remove or alter any copyright notices contained within the Program.
60
+
61
+ Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
62
+
63
+ 4. COMMERCIAL DISTRIBUTION
64
+
65
+ Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
66
+
67
+ For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
68
+
69
+ 5. NO WARRANTY
70
+
71
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
72
+
73
+ 6. DISCLAIMER OF LIABILITY
74
+
75
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
76
+
77
+ 7. GENERAL
78
+
79
+ If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
80
+
81
+ If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
82
+
83
+ All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
84
+
85
+ Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
86
+
87
+ This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2010-2019 Raimonds Simanovskis
3
+ Copyright (c) 2010-2021 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
@@ -273,9 +273,9 @@ See more examples of data access roles in `spec/connection_role_spec.rb`.
273
273
  REQUIREMENTS
274
274
  ------------
275
275
 
276
- mondrian-olap gem is compatible with JRuby versions 1.7 and 9.x, and Java 8 and 11 VM. mondrian-olap works only with JRuby and not with other Ruby implementations as it includes Mondrian OLAP Java libraries.
276
+ mondrian-olap gem is compatible with JRuby version 9.2.x, and Java 8 and 11 VM. mondrian-olap works only with JRuby and not with other Ruby implementations as it includes Mondrian OLAP Java libraries.
277
277
 
278
- 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 (`ojdbc8.jar` for Java 8) 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 then include the latest `mssql-jdbc-*.jar` in `CLASSPATH` or copy to `JRUBY_HOME/lib` or require it in application manually.
278
+ mondrian-olap supports MySQL, PostgreSQL, Oracle, Microsoft SQL Server, Vertica and Snowflake databases as well as other databases that are supported by Mondrian OLAP engine (using jdbc_driver and jdbc_url connection parameters). When using MySQL or PostgreSQL databases then install jdbc-mysql or jdbc-postgres gem and require "jdbc/mysql" or "jdbc/postgres" to load the corresponding JDBC database driver. When using Oracle then require Oracle JDBC driver (`ojdbc8.jar` for Java 8). 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 then require the latest `mssql-jdbc-*.jar`. When using Vertica or Snowflake then require corresponding JDBC drivers.
279
279
 
280
280
  INSTALL
281
281
  -------
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
Binary file
@@ -294,97 +294,137 @@ module Mondrian
294
294
  def connection_string
295
295
  string = "jdbc:mondrian:Jdbc=#{quote_string(jdbc_uri)};JdbcDrivers=#{jdbc_driver};"
296
296
  # by default use content checksum to reload schema when catalog has changed
297
- string << "UseContentChecksum=true;" unless @params[:use_content_checksum] == false
298
- string << "PinSchemaTimeout=#{@params[:pin_schema_timeout]};" if @params[:pin_schema_timeout]
297
+ string += "UseContentChecksum=true;" unless @params[:use_content_checksum] == false
298
+ string += "PinSchemaTimeout=#{@params[:pin_schema_timeout]};" if @params[:pin_schema_timeout]
299
299
  if role = @params[:role] || @params[:roles]
300
300
  roles = Array(role).map{|r| r && r.to_s.gsub(',', ',,')}.compact
301
- string << "Role=#{quote_string(roles.join(','))};" unless roles.empty?
301
+ string += "Role=#{quote_string(roles.join(','))};" unless roles.empty?
302
302
  end
303
303
  if locale = @params[:locale]
304
- string << "Locale=#{quote_string(locale.to_s)};"
304
+ string += "Locale=#{quote_string(locale.to_s)};"
305
305
  end
306
- string << (@params[:catalog] ? "Catalog=#{catalog_uri}" : "CatalogContent=#{quote_string(catalog_content)}")
306
+ string + (@params[:catalog] ? "Catalog=#{catalog_uri}" : "CatalogContent=#{quote_string(catalog_content)}")
307
307
  end
308
308
 
309
309
  def jdbc_uri
310
- case @driver
311
- when 'mysql', 'postgresql', 'vertica'
312
- uri = "jdbc:#{@driver}://#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}/#{@params[:database]}"
313
- uri << "?useUnicode=yes&characterEncoding=UTF-8" if @driver == 'mysql'
314
- if (properties = @params[:properties]).is_a?(Hash) && !properties.empty?
315
- uri << (@driver == 'mysql' ? '&' : '?')
316
- uri << properties.map{|k, v| "#{k}=#{v}"}.join('&')
317
- end
318
- uri
319
- when 'oracle'
320
- # connection using TNS alias
321
- if @params[:database] && !@params[:host] && !@params[:url] && ENV['TNS_ADMIN']
322
- "jdbc:oracle:thin:@#{@params[:database]}"
323
- else
324
- @params[:url] || begin
325
- database = @params[:database]
326
- unless database =~ %r{^(:|/)}
327
- # assume database is a SID if no colon or slash are supplied (backward-compatibility)
328
- database = ":#{database}"
329
- end
330
- "jdbc:oracle:thin:@#{@params[:host] || 'localhost'}:#{@params[:port] || 1521}#{database}"
310
+ if respond_to?(method_name = "jdbc_uri_#{@driver}", true)
311
+ send method_name
312
+ else
313
+ raise ArgumentError, 'unknown JDBC driver'
314
+ end
315
+ end
316
+
317
+ def jdbc_uri_generic(options = {})
318
+ uri_prefix = options[:uri_prefix] || "jdbc:#{@driver}://"
319
+ uri = "#{uri_prefix}#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}"
320
+ uri += "/#{@params[:database]}" if @params[:database] && options[:add_database] != false
321
+ properties = new_empty_properties
322
+ properties.merge!(options[:default_properties]) if options[:default_properties].is_a?(Hash)
323
+ properties.merge!(@params[:properties]) if @params[:properties].is_a?(Hash)
324
+ "#{uri}#{uri_properties_string(properties, options[:separator], options[:first_separator])}"
325
+ end
326
+
327
+ def new_empty_properties
328
+ # If ActiveSupport::HashWithIndifferentAccess is present then treat symbol and string keys as equal
329
+ defined?(ActiveSupport::HashWithIndifferentAccess) ? ActiveSupport::HashWithIndifferentAccess.new : {}
330
+ end
331
+
332
+ def uri_properties_string(properties, separator = nil, first_separator = nil)
333
+ properties_string = properties.map { |k, v| "#{k}=#{v}" }.join(separator || '&')
334
+ unless properties_string.empty?
335
+ first_separator ||= '?'
336
+ "#{first_separator}#{properties_string}"
337
+ end
338
+ end
339
+
340
+ def jdbc_uri_mysql
341
+ jdbc_uri_generic(default_properties: {useUnicode: true, characterEncoding: 'UTF-8'})
342
+ end
343
+
344
+ alias_method :jdbc_uri_postgresql, :jdbc_uri_generic
345
+ alias_method :jdbc_uri_vertica, :jdbc_uri_generic
346
+
347
+ def jdbc_uri_oracle
348
+ # connection using TNS alias
349
+ if @params[:database] && !@params[:host] && !@params[:url] && ENV['TNS_ADMIN']
350
+ "jdbc:oracle:thin:@#{@params[:database]}"
351
+ else
352
+ @params[:url] || begin
353
+ database = @params[:database]
354
+ unless database =~ %r{^(:|/)}
355
+ # assume database is a SID if no colon or slash are supplied (backward-compatibility)
356
+ database = ":#{database}"
331
357
  end
358
+ "jdbc:oracle:thin:@#{@params[:host] || 'localhost'}:#{@params[:port] || 1521}#{database}"
332
359
  end
333
- when 'luciddb'
334
- uri = "jdbc:luciddb:http://#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}"
335
- uri << ";schema=#{@params[:database_schema]}" if @params[:database_schema]
336
- uri
337
- when 'mssql'
338
- uri = "jdbc:jtds:sqlserver://#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}/#{@params[:database]}"
339
- uri << ";instance=#{@params[:instance]}" if @params[:instance]
340
- uri << ";domain=#{@params[:domain]}" if @params[:domain]
341
- uri << ";appname=#{@params[:appname]}" if @params[:appname]
342
- uri
343
- when 'sqlserver'
344
- uri = "jdbc:sqlserver://#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}"
345
- uri << ";databaseName=#{@params[:database]}" if @params[:database]
346
- uri << ";integratedSecurity=#{@params[:integrated_security]}" if @params[:integrated_security]
347
- uri << ";applicationName=#{@params[:application_name]}" if @params[:application_name]
348
- uri << ";instanceName=#{@params[:instance_name]}" if @params[:instance_name]
349
- uri
350
- when 'snowflake'
351
- uri = "jdbc:snowflake://#{@params[:host]}#{@params[:port] && ":#{@params[:port]}"}/?db=#{@params[:database]}"
352
- uri << "&schema=#{@params[:database_schema]}" if @params[:database_schema]
353
- uri << "&warehouse=#{@params[:warehouse]}" if @params[:warehouse]
354
- if (properties = @params[:properties]).is_a?(Hash) && !properties.empty?
355
- uri << '&'
356
- uri << properties.map{|k, v| "#{k}=#{v}"}.join('&')
360
+ end
361
+ end
362
+
363
+ def jdbc_uri_mssql
364
+ jdbc_uri_generic(
365
+ uri_prefix: 'jdbc:jtds:sqlserver://', separator: ';', first_separator: ';',
366
+ default_properties: @params.slice(:instance, :domain, :appname)
367
+ )
368
+ end
369
+
370
+ JDBC_SQLSERVER_PARAM_PROPERTIES = {
371
+ database: 'databaseName',
372
+ integrated_security: 'integratedSecurity',
373
+ application_name: 'applicationName',
374
+ instance_name: 'instanceName'
375
+ }
376
+
377
+ def jdbc_uri_sqlserver
378
+ jdbc_uri_generic(
379
+ uri_prefix: 'jdbc:sqlserver://', add_database: false, separator: ';', first_separator: ';',
380
+ default_properties: uri_default_param_properties(JDBC_SQLSERVER_PARAM_PROPERTIES)
381
+ )
382
+ end
383
+
384
+ def uri_default_param_properties(param_properties)
385
+ default_properties = {}
386
+ param_properties.each do |key, property|
387
+ if value = @params[key]
388
+ default_properties[property] = value
357
389
  end
358
- uri
359
- when 'jdbc'
360
- @params[:jdbc_url] or raise ArgumentError, 'missing jdbc_url parameter'
361
- else
362
- raise ArgumentError, 'unknown JDBC driver'
363
390
  end
391
+ default_properties
392
+ end
393
+
394
+ JDBC_SNOWFLAKE_PARAM_PROPERTIES = {
395
+ database: 'db',
396
+ database_schema: 'schema',
397
+ warehouse: 'warehouse'
398
+ }
399
+
400
+ def jdbc_uri_snowflake
401
+ jdbc_uri_generic(
402
+ add_database: false, separator: '&', first_separator: '/?',
403
+ default_properties: uri_default_param_properties(JDBC_SNOWFLAKE_PARAM_PROPERTIES)
404
+ )
364
405
  end
365
406
 
407
+ def jdbc_uri_jdbc
408
+ @params[:jdbc_url] or raise ArgumentError, 'missing jdbc_url parameter'
409
+ end
410
+
411
+ JDBC_DRIVER_CLASS = {
412
+ 'postgresql' => 'org.postgresql.Driver',
413
+ 'oracle' => 'oracle.jdbc.OracleDriver',
414
+ 'mssql' => 'net.sourceforge.jtds.jdbc.Driver',
415
+ 'sqlserver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
416
+ 'vertica' => 'com.vertica.jdbc.Driver',
417
+ 'snowflake' => 'net.snowflake.client.jdbc.SnowflakeDriver'
418
+ }
419
+
366
420
  def jdbc_driver
367
421
  case @driver
368
422
  when 'mysql'
369
- 'com.mysql.jdbc.Driver'
370
- when 'postgresql'
371
- 'org.postgresql.Driver'
372
- when 'oracle'
373
- 'oracle.jdbc.OracleDriver'
374
- when 'luciddb'
375
- 'org.luciddb.jdbc.LucidDbClientDriver'
376
- when 'mssql'
377
- 'net.sourceforge.jtds.jdbc.Driver'
378
- when 'sqlserver'
379
- 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
380
- when 'vertica'
381
- 'com.vertica.jdbc.Driver'
382
- when 'snowflake'
383
- 'net.snowflake.client.jdbc.SnowflakeDriver'
423
+ (Java::com.mysql.cj.jdbc.Driver rescue nil) ? 'com.mysql.cj.jdbc.Driver' : 'com.mysql.jdbc.Driver'
384
424
  when 'jdbc'
385
425
  @params[:jdbc_driver] or raise ArgumentError, 'missing jdbc_driver parameter'
386
426
  else
387
- raise ArgumentError, 'unknown JDBC driver'
427
+ JDBC_DRIVER_CLASS[@driver] or raise ArgumentError, 'unknown JDBC driver'
388
428
  end
389
429
  end
390
430
 
@@ -394,6 +394,11 @@ module Mondrian
394
394
  end
395
395
  end
396
396
 
397
+ # Old versions of Oracle had a limit of 30 character identifiers.
398
+ # Do not limit it for other databases (as e.g. in MySQL aliases can be longer than column names)
399
+ max_alias_length = dialect.getMaxColumnNameLength
400
+ max_alias_length = nil if max_alias_length && max_alias_length > 30
401
+
397
402
  return_fields.size.times do |i|
398
403
  member_full_name = return_fields[i][:member_full_name]
399
404
  begin
@@ -402,7 +407,7 @@ module Mondrian
402
407
  raise ArgumentError, "invalid return field #{member_full_name}"
403
408
  end
404
409
 
405
- # if this is property field then the name is initilized already
410
+ # if this is property field then the name is initialized already
406
411
  return_fields[i][:name] ||= segment_list.to_a.last.name
407
412
  level_or_member = schema_reader.lookupCompound rolap_cube, segment_list, false, 0
408
413
  return_fields[i][:member] = level_or_member
@@ -448,7 +453,9 @@ module Mondrian
448
453
  else
449
454
  return_fields[i][:name]
450
455
  end
451
- return_fields[i][:column_alias] = dialect.quoteIdentifier(column_alias)
456
+ return_fields[i][:column_alias] = dialect.quoteIdentifier(
457
+ max_alias_length ? column_alias[0, max_alias_length] : column_alias
458
+ )
452
459
  end
453
460
  end
454
461
 
@@ -140,8 +140,8 @@ module Mondrian
140
140
 
141
141
  def xmlized_attributes(options)
142
142
  # data dictionary values should be in uppercase if schema defined with :upcase_data_dictionary => true
143
- # or by default when using Oracle or LucidDB driver (can be overridden by :upcase_data_dictionary => false)
144
- upcase_attributes = if options[:upcase_data_dictionary].nil? && %w(oracle luciddb snowflake).include?(options[:driver]) ||
143
+ # or by default when using Oracle or Snowflake driver (can be overridden by :upcase_data_dictionary => false)
144
+ upcase_attributes = if options[:upcase_data_dictionary].nil? && %w(oracle snowflake).include?(options[:driver]) ||
145
145
  options[:upcase_data_dictionary]
146
146
  self.class.data_dictionary_names
147
147
  else
@@ -149,7 +149,10 @@ module Mondrian
149
149
  end
150
150
  hash = {}
151
151
  @attributes.each do |attr, value|
152
- value = value.upcase if upcase_attributes.include?(attr)
152
+ # Support value calculation in parallel threads.
153
+ # value could be either Thread or a future object from concurrent-ruby
154
+ value = value.value if value.respond_to?(:value)
155
+ value = value.upcase if upcase_attributes.include?(attr) && value.is_a?(String)
153
156
  hash[
154
157
  # camelcase attribute name
155
158
  attr.to_s.gsub(/_([^_]+)/){|m| $1.capitalize}
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe "Connection role" do
4
4
 
5
5
  describe "create connection" do
6
- before(:each) do
6
+ before(:all) do
7
7
  @all_roles = [
8
8
  @role_name = role_name = 'California manager',
9
9
  @role_name2 = role_name2 = 'Dummy, with comma',
@@ -86,6 +86,9 @@ describe "Connection role" do
86
86
  end
87
87
  end
88
88
  end
89
+ end
90
+
91
+ before(:each) do
89
92
  @olap = Mondrian::OLAP::Connection.create(CONNECTION_PARAMS.merge :schema => @schema)
90
93
  end
91
94
 
@@ -49,11 +49,10 @@ describe "Connection" do
49
49
  when 'mysql' then 'mondrian.spi.impl.MySqlDialect'
50
50
  when 'postgresql' then 'mondrian.spi.impl.PostgreSqlDialect'
51
51
  when 'oracle' then 'mondrian.spi.impl.OracleDialect'
52
- when 'luciddb' then 'mondrian.spi.impl.LucidDbDialect'
53
52
  when 'mssql' then 'mondrian.spi.impl.MicrosoftSqlServerDialect'
54
53
  when 'sqlserver' then 'mondrian.spi.impl.MicrosoftSqlServerDialect'
55
54
  when 'vertica' then 'mondrian.spi.impl.VerticaDialect'
56
- when 'snowflake' then 'mondrian.spi.impl.JdbcDialectImpl'
55
+ when 'snowflake' then 'mondrian.spi.impl.SnowflakeDialect'
57
56
  end
58
57
  end
59
58