GithubHelp home page GithubHelp logo

olap4j's Introduction

Build Status

olap4j

Olap4j is an open Java API for accessing OLAP data.

It is an extension to JDBC. For example, its OlapConnection class extends java.sql.Connection, from which you can create an OlapStatement, and execute to create a CellSet (analogous to a java.sql.ResultSet). There are also similar mechanisms for browsing metadata. As a result, olap4j is easy to learn if you have JDBC experience and know a little about OLAP.

Prerequisites

Olap4j requires ant (version 1.7 or later) and JDK 1.7 to build. (Once built, it also runs under JDK 1.5 and 1.6.)

Download and build

$ git clone git://github.com/olap4j/olap4j.git
$ cd olap4j
$ ant

Writing a simple program

You can now write and run a simple program against olap4j. For example, you can write:

import org.olap4j.*;
import org.olap4j.metadata.Member;
import java.sql.*;

Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
Connection connection =
    DriverManager.getConnection(
        "jdbc:xmla:Server=http://example.com:8080/mondrian/xmla");
OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
OlapStatement statement = olapConnection.createStatement();
CellSet cellSet =
    statement.executeOlapQuery(
        "SELECT {[Measures].[Unit Sales]} ON 0,\n"
        + "{[Product].Children} ON 1\n"
        + "FROM [Sales]");
for (Position row : cellSet.getAxes().get(1)) {
    for (Position column : cellSet.getAxes().get(0)) {
        for (Member member : row.getMembers()) {
            System.out.println(member.getUniqueName());
        }
        for (Member member : column.getMembers()) {
            System.out.println(member.getUniqueName());
        }
        final Cell cell = cellSet.getCell(column, row);
        System.out.println(cell.getFormattedValue());
        System.out.println();
    }
}

Or, if you are using the in-process mondrian driver, include mondrian.jar and its dependencies in your classpath, and change the appropriate lines in the above code to the following:

Class.forName("mondrian.olap4j.MondrianOlap4jDriver");
Connection connection =
    DriverManager.getConnection(
        "jdbc:mondrian:"
        + "Jdbc='jdbc:odbc:MondrianFoodMart';"
        + "Catalog='file://c:/open/mondrian/demo/FoodMart.xml';"
        + "JdbcDrivers=sun.jdbc.odbc.JdbcOdbcDriver;");

Packages and Roadmap

The core API of olap4j version 1.0 is a Long Term Support (LTS) release, but some parts of the olap4j project will remain considered as experimental, thus subject to change in future releases.

Core packages are as follows:

The following packages are considered experimental and are subject to change:

Version 2.0

Olap4j version 2.0 is currently under development. Goals are:

  • Support metadata and API changes in recent SSAS (Microsoft SQL Server Analysis Services) and XMLA (XML for Analysis)
  • Support metadata and API changes in Mondrian version 4

We aim to be backwards compatible in the same way that each JDBC release is backwards compatible:

  • Applications developed against earlier versions will work against 2
  • Drivers supporting version 2 will also serve as 1.x drivers (JDBC version 4 broke this rule, and it was painful for driver developers)
  • Some work will be required to convert a version 1.x driver to a version 2 driver

Version 2 specification is here.

More information

General project information:

Related projects:

If you have downloaded a release:

  • README.txt describes the release structure.
  • CHANGES.txt describes what has changed in the release.
  • The VERSION.txt file holds the version number of the release.

olap4j's People

Contributors

asbachb avatar drndos avatar jsichi avatar julianhyde avatar kon901 avatar lgrill-pentaho avatar lucboudreau avatar mkambol avatar pstoellberger avatar tesluk avatar uday-rayala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

olap4j's Issues

API docs offline

At the moment (22. January 2018) the project's website www.olap4j.org seems to be offline/misconfigured.

A request to www.olap4j.org leads to a site starting with "As clever as clever" and "(Julian's home page)".
A request to www.olap4j.org/api results in HTTP 404.

Where could I found the API docs for olap4j?

Thanks in advice,
T1233

How to configure pool connection with apache DBCP 2?

I see that there are two DBCP dependencies in pom.xml:

<commons-dbcp.version>1.1</commons-dbcp.version>
<commons-dbcp2.version>2.1</commons-dbcp2.version>

I'd like to use dbcp2 as it's the latest, but I cannot find sample code. It's different from version 1 as the object GenericObjectPool is no longer in version 2.

Thanks
Pablo

[FATAL]:22:3: The element type "link" must be terminated by the matching end-tag "</link>"

Hi all,

Have you already seen this problem?

 java.lang.RuntimeException: [FATAL]:22:3: The element type "link" must be terminated by the matching end-tag "</link>".
    at org.olap4j.driver.xmla.XmlaOlap4jUtil.checkForParseError(XmlaOlap4jUtil.java:135)
    at org.olap4j.driver.xmla.XmlaOlap4jUtil.parse(XmlaOlap4jUtil.java:84)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.executeMetadataRequest(XmlaOlap4jConnection.java:884)
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getMetadata(XmlaOlap4jDatabaseMetaData.java:137)
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getMetadata(XmlaOlap4jDatabaseMetaData.java:67)
    at org.olap4j.driver.xmla.XmlaOlap4jDatabaseMetaData.getDatabaseProperties(XmlaOlap4jDatabaseMetaData.java:1044)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.makeConnectionPropertyList(XmlaOlap4jConnection.java:324)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.generateRequest(XmlaOlap4jConnection.java:1037)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:849)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.populateList(DeferredNamedListImpl.java:136)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.getList(DeferredNamedListImpl.java:90)
    at org.olap4j.driver.xmla.DeferredNamedListImpl.size(DeferredNamedListImpl.java:116)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.getOlapDatabase(XmlaOlap4jConnection.java:451)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.getOlapCatalog(XmlaOlap4jConnection.java:501)
    at org.olap4j.driver.xmla.XmlaOlap4jConnection.getCatalog(XmlaOlap4jConnection.java:496)
    at org.olap4j.driver.xmla.XmlaOlap4jStatement.executeOlapQuery(XmlaOlap4jStatement.java:291)
    at MondrianTeste.main(MondrianTeste.java:18)
Caused by: org.xml.sax.SAXParseException; lineNumber: 22; columnNumber: 3; The element type "link" must be terminated by the matching end-tag "</link>".
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.olap4j.driver.xmla.XmlaOlap4jUtil.parse(XmlaOlap4jUtil.java:81)

My code:

public class MondrianTeste {

    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");

        Connection connection = DriverManager.getConnection("jdbc:xmla:Server=http://127.0.0.1:8080/pentaho/xmla");
        OlapConnection olapConnection = connection.unwrap(OlapConnection.class);
        OlapStatement statement = olapConnection.createStatement();

        CellSet cellSet = statement.executeOlapQuery("SELECT {([Customers].[All Customers])} ON COLUMNS FROM [SteelWheelsSales]");
        for (Position row : cellSet.getAxes().get(1)) {
            for (Position column : cellSet.getAxes().get(0)) {
                for (Member member : row.getMembers()) {
                    System.out.println(member.getUniqueName());
                }
                for (Member member : column.getMembers()) {
                    System.out.println(member.getUniqueName());
                }
                final Cell cell = cellSet.getCell(column, row);
                System.out.println(cell.getFormattedValue());
                System.out.println();
            }
        }
    }

}

When olap4j2 will be released ?

In the documentation, olap4j version 2 is targetted :

Beta in Q3 2013
Production in Q4 2013

We are in January the 14th and it is still not released and has snapshot dependencies on Mondrain 4.0.0-SNAPSHOT.

When do you expect to release it ? Thks

Null pointer on XmlaOlap4jProperty (icCube OLAP Server)

XmlaOlap4jProperty is using his description as 'uniqueName' and the uniqueName is used as key for some maps. This is causing a NPE.

Description is not mandatory and it sounds a bit dangerous using the description as a key.

// XmlaOlap4jConnection; line 1865
String uniqueName = stringElement(row, "DESCRIPTION");
...
new XmlaOlap4jProperty(uniqueName)

Thanks for your work.

-> more info : http://issues.iccube.com/issue/ic3pub-80

401 error when using DAX query

I'm trying to query my tabular cube using DAX query and I'm getting 401 error. When I tried to find doc for DAX I couldn't find one. Does this library support DAX query?

[Help] Method executeQuery() inside OlapStatement does not throw an exception when SOAP response XML contains error under Messages section

Our application is using Olap4j to talk to remote XMLA services. The SOAP response at times does not have any faults/errors inside the "Fault" XML element. Instead a messages section right after cellset contains an error as below.

<Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception">
                        <Error ErrorCode="3239837705" Description="Server:  The operation was cancelled because of locking conflicts." Source="Microsoft SQL Server 2014 Analysis Services" HelpFile=""/>
                        <Error ErrorCode="3239837705" Description="Server:  The operation was cancelled because of locking conflicts." Source="Microsoft SQL Server 2014 Analysis Services" HelpFile=""/>
                    </Messages>

The XML contains only partial data for the MDX query requested.
As per the DBA, this is an expected exception and the application needs to handle it. The problem is that CellSet is returned without any exception by the method executeQuery() inside OlapStatement.
Is there anyway to actually bubble up this error at the API level?

Release 1.3.0

It's been a while since a new release. Make a release 1.3.0 based on the current code plus any github pull requests that are ready, and deploy to Maven Central. Also release olap4j-xmlaserver.

This release should have real sources and javadoc. (In 1.2.0 I created dummy -sources.jar and -javadoc.jar files.)

See instructions in RELEASE_CHECKLIST.txt.

failed to build with ant

Hi olap4j team

actually i am new to olap4j , i just download the source code and checkout the master branch and run the ant command in the project directory . but i got this error :

`
PS D:\O\olap4j\src> ant
Buildfile: D:\O\olap4j\src\build.xml

clean-tests:

cobertura.clean-instrumented-classes:

cobertura.clean-coverage-reports:

clean-cobertura:

clean-javadoc:

clean-dist:

subfloor.clean:

clean-generated:

clean-foodmart:

clean:

version-properties:

checkJdkVersion:

init:
[mkdir] Created dir: D:\O\olap4j\src\bin\classes
[mkdir] Created dir: D:\O\olap4j\src\dist
[mkdir] Created dir: D:\O\olap4j\src\lib
[mkdir] Created dir: D:\O\olap4j\src\testlib

antcontrib.download-check:

antcontrib.download:

install-antcontrib:

ivy.download-check:

ivy.download:

install-ivy:
[echo] Installing IVY...

resolve:

antcontrib.download-check:

antcontrib.download:

install-antcontrib:

ivy.download-check:

ivy.download:

install-ivy:
[echo] Skipping IVY install. IVY has already been configured by the build

resolve-init:

clean-jars:
[delete] Deleting directory D:\O\olap4j\src\lib
[delete] Deleting directory D:\O\olap4j\src\testlib

resolve-default:
[ivy:resolve] :: Ivy 2.1.0 - 20090925235825 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: file = D:\O\olap4j\src\ivysettings.xml
[ivy:resolve] :: resolving dependencies :: org.olap4j#olap4j;TRUNK-SNAPSHOT
[ivy:resolve] confs: [default]
[ivy:resolve] :: resolution report :: resolve 533ms :: artifacts dl 0ms
---------------------------------------------------------------------
| | modules || artifacts |
| conf | number| search|dwnlded|evicted|| number|dwnlded|
---------------------------------------------------------------------
| default | 1 | 0 | 0 | 0 || 0 | 0 |
---------------------------------------------------------------------
[ivy:resolve]
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
[ivy:resolve] module not found: net.java.dev.javacc#javacc;5.0
[ivy:resolve] ==== local: tried
[ivy:resolve] C:\Users\LENOVO.ivy2/local/net.java.dev.javacc/javacc/5.0/ivys/ivy.xml
[ivy:resolve] -- artifact net.java.dev.javacc#javacc;5.0!javacc.jar:
[ivy:resolve] C:\Users\LENOVO.ivy2/local/net.java.dev.javacc/javacc/5.0/jars/javacc-5.0.jar
[ivy:resolve] ==== pentaho-ivy: tried
[ivy:resolve] http://ivy-nexus.pentaho.org/content/groups/omni/net.java.dev.javacc/javacc/5.0/javacc-5.0.ivy.xml
[ivy:resolve] ==== pentaho-mvn: tried
[ivy:resolve] http://ivy-nexus.pentaho.org/content/groups/omni/net/java/dev/javacc/javacc/5.0/javacc-5.0.pom
[ivy:resolve] -- artifact net.java.dev.javacc#javacc;5.0!javacc.jar:
[ivy:resolve] http://ivy-nexus.pentaho.org/content/groups/omni/net/java/dev/javacc/javacc/5.0/javacc-5.0.jar
[ivy:resolve] ==== public-maven: tried
[ivy:resolve] http://ivy-nexus.pentaho.org/content/groups/omni/net/java/dev/javacc/javacc/5.0/javacc-5.0.pom
[ivy:resolve] -- artifact net.java.dev.javacc#javacc;5.0!javacc.jar:
[ivy:resolve] http://ivy-nexus.pentaho.org/content/groups/omni/net/java/dev/javacc/javacc/5.0/javacc-5.0.jar
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: net.java.dev.javacc#javacc;5.0: not found
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve]
[ivy:resolve]
[ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

BUILD FAILED
D:\O\olap4j\src\build.xml:372: The following error occurred while executing this line:
D:\O\olap4j\src\subfloor.xml:673: impossible to resolve dependencies:
resolve failed - see output for details

Total time: 1 second
`

also there are some error on my IDE this is screenshot of the error :

image

i search in the internet but with no valuable result

i know i miss something , but i do not know what it is?

thank you .

Remove javacc from olap4j's runtime dependencies

Javacc is required to build olap4j but since it generates all the code it needs (it has no runtime library) it is not required at runtime.

Olap4j's generated pom shows javacc as a dependency of "compile" scope:

net.java.dev.javacc javacc 5.0 compile

This is wrong. It should be "provided" or not present at all. ("compile" means required at compile time, run time, and transitive; see http://maven.apache.org/pom.html#Dependencies.)

Because of this bug, olap4j-xmlaserver lists javacc as a dependency.

TESTPROXYCOOKIE should really just be PROXYCOOKIE

I think it's useful to be able to override the default proxy for other than testing purposes. Specifically, I need to allow for JWT authentication.

Having a more general name would make it look less suspicious in the code.

Using olap4j in Android Studio

Hi guys,

I am quite new to Java, I usually use C++ and I would like to use olap4j in my android project.

I have added the dependency by right click my app folder and now have a dependency for olap4j and olap4j:XML server.

But I am receiving the error classpath not found exception, what exactly do I need to add to my gradle to make this work? Like I said I am still learning so if you could please give me some code samples to get me going that would be much appreciated.

Thanks for the help.

Unable to build from github, failure to resolve ivy-xmlaserver dependencies

Hi, I'm trying to build the latest version of the github source but am running into the following problems:

$ ant resolve
:
:
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: UNRESOLVED DEPENDENCIES ::
[ivy:resolve] ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:resolve] :: org.olap4j#olap4j-xmlaserver;1.2.0: java.text.ParseException: [xml parsing: ivy-1.2.0.xml.original:1:7: cvc-elt.1: Cannot find the declaration of element 'html'. in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag html in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag head in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag title in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag meta in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag link in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , unknown tag link in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] , [Fatal Error] ivy-1.2.0.xml.original:12:5: The element type "link" must be terminated by the matching end-tag "". in file:/Users/cru/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original
[ivy:resolve] ]

Looking at the downloaded cache file, i see:

$ cat ~/.ivy2/cache/org.olap4j/olap4j-xmlaserver/ivy-1.2.0.xml.original

<html>
  <head>
    <title>404 - Path /org.olap4j/olap4j-xmlaserver/1.2.0/olap4j-xmlaserver-1.2.0.ivy.xml not found in group repository "public-release-repos" [id=public-release-repos].</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

    <link rel="icon" type="image/png" href="http://127.0.0.1:8081/favicon.png">
    <!--[if IE]>
    <link rel="SHORTCUT ICON" href="http://127.0.0.1:8081/favicon.ico"/>
    <![endif]-->

    <link rel="stylesheet" href="http://127.0.0.1:8081/static/css/Sonatype-content.css?2.8.0-05" type="text/css" media="screen" title="no title" charset="utf-8">
  </head>
  <body>
    <h1>404 - Path /org.olap4j/olap4j-xmlaserver/1.2.0/olap4j-xmlaserver-1.2.0.ivy.xml not found in group repository "public-release-repos" [id=public-release-repos].</h1>
    <p>Path /org.olap4j/olap4j-xmlaserver/1.2.0/olap4j-xmlaserver-1.2.0.ivy.xml not found in group repository &quot;public-release-repos&quot; [id=public-release-repos].</p>
  </body>
</html>

I'm not sure how this was supposed to be set up, but I imagine some of the repos got moved around on the pentaho artifactory server. Any ideas on how to build this? Thanks!

Apache Xerces dependency 2.11.0 has security vulnerability so replace it with 2.12.0

For some reason, the 1.2 seemed to have 2.11.0 version of Apache Xerces however, in future versions including master the version is moved back to 2.6.2. I will open a discussion topic in the forum for this.

The versions 2.6.2 and 2.11.0 have security vulnerabilities as shown below
https://snyk.io/vuln/maven:xerces:xercesImpl (all versions)
https://www.cvedetails.com/vulnerability-list/vendor_id-45/product_id-41304/version_id-243635/Apache-Xerces2-Java-2.11.0.html (2.11.0)

I will create a PR to update the dependency to the latest 2.12.0.

How to set parameter to SOAP/XML?

I cant get metadata from SAP BW system.Because the parameter cant be set.I used fiddler to capture request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <Execute xmlns="urn:schemas-microsoft-com:xml-analysis">
        <Command>
        <Statement>
           <![CDATA[
SELECT  NON EMPTY { [0SALES_DIST__0CUST_GRP2].[LEVEL01].Members  } ON COLUMNS, NON EMPTY { [0CALMONTH].[LEVEL01].Members } ON ROWS FROM [ZQD_C28/ZQD_C28_Q0001] WHERE [0CALMONTH].[201503]]]>
         </Statement>
        </Command>
        <Properties>
          <PropertyList>
            <Catalog>ZBF_C51</Catalog>
            <DataSourceInfo>SAP_BW</DataSourceInfo>
            <Format>Multidimensional</Format>
            <AxisFormat>TupleFormat</AxisFormat>
          </PropertyList>
        </Properties>
        <Parameters>
               <Parameter>
               </Parameter>
        </Parameters></Execute>
</soapenv:Body>
</soapenv:Envelope>

So,how can I set the parameter by olap4j.Thanks!

Running select in Sybase/SAP Hana fails due to incorrect Dialect

This works (note that code is in Scala):

      val connectionString = "jdbc:mondrian:Jdbc=jdbc:sap://10.194.19.20:39013?" + 
          "user=uuuuu&password=pppp;" + 
          "Catalog=lib/Schema.xml;JdbcDrivers=com.sap.db.jdbc.Driver"
      val connection = DriverManager.getConnection(connectionString)
      val olapConnection = connection.unwrap(classOf[OlapConnection])
		
      val parserFactory = olapConnection.getParserFactory
      val parser = parserFactory.createMdxParser(olapConnection)
      val query = parser.parseSelect(
            "select from [DDABalances] WHERE [Bank].[1]")
       val statement = olapConnection.createStatement

However when I try to run this statement, I get an exception, because "BANKS"."sk" is incorrect as it shouldn't have quotes:

     val cellSet = statement.executeOlapQuery(query)

The exception:

Caused by: mondrian.olap.MondrianException: Mondrian Error:Internal error: while counting members of level '[Bank].[Bank SK]; sql=[select count(*) as "c0" from (select distinct "BANKS"."sk" as "c0" from "BANKS" as "BANKS") as "init"]
at mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:987)
at mondrian.olap.Util.newInternal(Util.java:2410)
at mondrian.olap.Util.newError(Util.java:2426)
at mondrian.rolap.SqlStatement.handle(SqlStatement.java:364)
at mondrian.rolap.SqlStatement.execute(SqlStatement.java:254)
at mondrian.rolap.RolapUtil.executeQuery(RolapUtil.java:350)
at mondrian.rolap.RolapUtil.executeQuery(RolapUtil.java:303)
at mondrian.rolap.SqlMemberSource.getMemberCount(SqlMemberSource.java:149)
at mondrian.rolap.SqlMemberSource.getLevelMemberCount(SqlMemberSource.java:142)
at mondrian.rolap.SmartMemberReader.getLevelMemberCount(SmartMemberReader.java:158)

Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [260] (at 54): invalid column name: BANKS.sk: line 1 col 55 (at pos 54)
at com.sap.db.jdbc.exceptions.SQLExceptionSapDB._createException(SQLExceptionSapDB.java:208)

How to specify that the dialect is Sybase?

Expand All Option

We want to create an analysis which has different measures and dimensions with different levels. (Lets say store sales categorized by year, quarters, months and dates)
Currently, on first hit it shows all data, on expand years data, than it shows quarters and so on. Is there any method which can show all data expanded till last child?

What is the status of this project?

Judging by the absence of recent releases, the lack of commit activity, and the lack of msg activity on the dev list since mid-2016, it seems to be dead.

[FATAL]:1:324866: Invalid byte 2 of 2-byte UTF-8 sequence

Hi all,

Have you already seen this problem?

java.lang.RuntimeException: [FATAL]:1:324866: Invalid byte 2 of 2-byte UTF-8 sequence.

org.olap4j.driver.xmla.XmlaOlap4jUtil.checkForParseError(XmlaOlap4jUtil.java:135)
org.olap4j.driver.xmla.XmlaOlap4jUtil.parse(XmlaOlap4jUtil.java:84)
org.olap4j.driver.xmla.XmlaOlap4jConnection.executeMetadataRequest(XmlaOlap4jConnection.java:884)
org.olap4j.driver.xmla.XmlaOlap4jConnection.populateList(XmlaOlap4jConnection.java:851)
org.olap4j.driver.xmla.XmlaOlap4jCube$RawMetadataReader.lookupMemberRelatives(XmlaOlap4jCube.java:547)
org.olap4j.driver.xmla.XmlaOlap4jCube$DelegatingMetadataReader.lookupMemberRelatives(XmlaOlap4jCube.java:268)
org.olap4j.driver.xmla.XmlaOlap4jMember.getChildMembers(XmlaOlap4jMember.java:104)

LevelSelectionImpl issue when connecting to SSAS 2012 time dimension date

When attempting to browse a SQL Server 2012 cube with a time dimension - specifically only when the date level is selected - a NullPointerException is thrown. I have tracked it down to LevelSelectionImpl.java at line 99.

level.getLevelType()

returns null, which causes

level.getLevelType().equals(Type.ALL)
            && operator.equals(Operator.MEMBERS)

to throw a null pointer exception. Suggestion is to use guava-like usage (or just use guava flat-out):

Objects.equals(level.getLevelType(), Type.ALL) && Objects.equals(operator, Operator.MEMBERS)

How do I issue an MDX writeback query

I'd like to issue the query below. The backend DB does support this via XMLA

UPDATE CUBE [SimpleCubeWithWhatIf] SET ([Measures].[MyMeasure]) = 2147483647 USE_EQUAL_ALLOCATION

However using executeOlapQuery gives an internal error as I think it's expecting some response data, and the other execute methods don't work.

I've tried using setValue on the cell, but olapConnection.createScenario throws a UnsupportedOperationException exception.

Olap4J transform package

Hi,

The transform package is experimental, but is it developed? if not, will it be implemented in version 2.0?

Thanks
Pablo

NameList<? extends Foo> instead of NamedList<Foo>

Hello,

I've found current interfaces generecs inconvenient for implementers. Now many methods returns NamedList getFoos(). It's no-brainer that i'll return new NamedListImpl();, where class FooAdapter implements Foo, Named. I did it many times for this wide api. Why don't use generics in a more accurate manner NamedList<? extends Foo> like in the snippet below, in this case I'll be able to avoid Olap4jUtil.cast(list) which is spreaded across Mondrian's impl sources.

class Olap {

   NamedList<? extends Cube> getCubes(){
       NamedList<CubeAdapter> result =  new NamedListImpl<CubeAdapter>();
       result.add( new CubeAdapter() {
           public String getName(){
               return "me";
           }
       }
       );
       return result;
   }
}

NamedList<? extends Cube> list = new Olap().getCubes();
Cube elem = list.get(0);
elem.getName();

wdyt?

Need an API to see if cell writeback is supported on a cube.

Mondrian has cell write back feature for a while, but it seems there's no way to check whether or not a cube support it using the Olap4J's API.

The API document says that the OlapDatabaseMetadata.getCubes() would return IS_WRITE_ENABLED column if it supports it, but it's apparently for the XMLA driver only.

And it'd be nice if we have such a method like Cube.isWritebackEnabled() also.

Thanks!

Bugs of ol4j.mdx.parser

Hello, i'm doing a project about MDX parser.
When I use MdxParser to parse a MDX statement to a parseTree, I find some bugs.
Those statements contain follow parts can not be parsed.

  1. "Having"
  2. "("xxx")"
  3. "$"

Connection question

Just as we can see in Connection properties :

the Property Server need a URL of HTTP server. Required.

But in many case use a http is not fast enough.

So, I wonder if I can use another way to connect.

Just like Excel, we can connect to our olap server use http://my-pc/olap/msmdpump.dll, and we can also use my-pc\sql2012 as well.

how to generate "WITH SET" and "WITH MEMBER"by olap4j

Hi,I recently use olap4j to generate mdx query, but I don't know how to generate "WITH SET" and "WITH MEMBER" in my program. could you give me some suggests to solve this problem? Furthermore, I want to know if olap4j 2.0 has support this way to generate query schema.

Batch lookup of members for Xmla

At the moment only mondrian supports a batch lookup of members, in general we could use an MDX query to fetch several members at the same time

Additional rowset columns needed for XML/A interface

The following columns are missing from Mondrian's XML/A implementation. This is causing a problem for Microstrategy when importing a cube definition.

MDSCHEMA_CUBES

  • BASE_CUBE_NAME

MDSCHEMA_MEASURES

  • NUMERIC_PRECISION
  • NUMERIC_SCALE

MDSCHEMA_PROPERTIES

  • CHARACTER_MAXIMUM_LENGTH
  • CHARACTER_OCTET_LENGTH
  • NUMERIC_PRECISION
  • NUMERIC_SCALE

Note: It would also be nice to be able to supply a custom implementation for a given rowset.

Note: this is actually a subset of the missing columns as documented in MONDRIAN-884

Extended drillThrough support on Cell interface

Mondrian has an ability to include an extendedContext (data from additional columns) in drill through result-sets, this functionality is available on mondrian.rolap.RolapCell.drillThroughInternal(...) but is not exposed through mondrian.olap.Cell interface.

We would like to suggest to expose this functionality through Cell interface to make it easily available to users.

The new method signature can be:

        /**
         * Drills through from this cell to the underlying fact table data,
         * and returns a {@link java.sql.ResultSet} of the results.
         *
         * <p>If drill-through is not possible, returns null.
         *
         * @param extendedContext   If true, add non-constraining columns to the
         *                          query for levels below each current member.
         *
         * @return result set of the fact rows underlying this Cell
         *
         * @throws OlapException if a database error occurs
         */
        ResultSet drillThrough(boolean extendedContext) throws OlapException;

Implementation seems to be as easy as calling drillThroughInternal with the proper value of extendedContext flag.

NullPointerException when using IBM InfoSphere Warehouse Cubing Services Server

Hi,

I'm not sure if IBM Warehouse is supported, but I know IBM is supporting XMLA.
So when I try to execute following query I got NullPointerException here, if it is fixed I may try some more samples;

CellSet cellSet = statement.executeOlapQuery("SELECT {[Measures].[Products]} ON 0,\n" + "{[Time].2004} ON 1\n" + "FROM [SalesCube]");

OLAP4J CODE --------------------------------------------------------------------------
description="IBM InfoSphere Warehouse Cubing Services Server"
providerName="IBM InfoSphedataSourceInfore Warehouse XML For Analysis Provider"
dataSourceInfo =null

XmlaOlap4jConnection$BackendFlavor.getFlavor(XmlaOlap4jConnection) line: 834
...
for (BackendFlavor flavor : BackendFlavor.values()) {
if (dataSourceInfo.contains(flavor.token)) { <--- dataSourceInfo is null, so NullPointerException is thrown
return flavor;
}
}
...

Order of query axes should be COLUMNS, ROWS, PAGES, SECTIONS, CHAPTERS

Order of query axes should be COLUMNS, ROWS, PAGES, SECTIONS, CHAPTERS. This is consistent with SSASS 2005 and later.

The current order, as of olap4j 1.2, is COLUMNS, ROWS, PAGES, CHAPTERS, SECTIONS. This is based on Mondrian, which in turn was based upon an earlier version of MDX.

This is a breaking change, so we should implement in olap4j 2.0 but not olap4j 1.x. It is a fairly unusual problem, because few queries have more than 2 axes.

For maximum compatibility we recommend that people write ON AXIS(x) or ON x rather than ON CHAPTERS or ON SECTIONS.

See also rsim/mondrian-olap#35.

Identify query has a non visual clause

Is there any way to differentiate query like -

select [Product].[Hierarchy].[Category] all members on columns
from (select [Product].[Hierarchy].[Category]&[Accessories] on columns from
[Product_Cube])

select [Product].[Hierarchy].[Category] all members on columns
from NON VISUAL (select [Product].[Hierarchy].[Category]&[Accessories] on columns from
[Product_Cube])

In simple words, is there any way to recognise queries with NON VISUAL clause?

Tag for olap4j 1.1.0

The git repository appears to be missing tags for the 1.1.0 release (and possibly others)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.