我想实现一个为 MDX 查询提供支持的应用程序。为此,我想使用 pentaho mondrian 中的一个库(带有 MDX 接口的开源 OLTP 服务器) )将 MDX 查询转换为下划线数据库的 SQL(基于 xml 描述),不幸的是,我找不到任何信息,我需要在我的项目中包含哪些库以及如何使用它们,以使 MDX 到 SQL 映射工作。
有人有在她/他的应用程序中重用蒙德里安组件的经验吗?
I want to implement an application that provides support for MDX queries. For this purpose I would like to use one of libraries from pentaho mondrian (an open source OLTP server with the MDX interface) that transforms MDX queries into SQL of underlining database (based on a xml description), unfortunately I can not find any information which libraries I need to include -- and how to use them -- in my project to have MDX to SQL mapping working.
Does anybody have some experience in reusing mondrian components in her/his application?
发布评论
评论(4)
我建议下载 Mondrian 的最新 3.2.0 版本,它随其所有依赖项一起分发。发行版中还包含一个 ivy 文件,它描述了其依赖项。
最新版本:
文档也可以在 Pentaho 的网站上找到。祝你好运!
I recommend downloading the latest 3.2.0 build of Mondrian, it is distributed with all of its dependencies. Also included in the distribution is an ivy file which describes its dependencies.
Latest Release:
http://forums.pentaho.com/showthread.php?77035-Mondrian-3.2-GA-Schema-Workbench-and-Agg-Designer-stable-available-on-SourceForge&p=239443#poststop
Documentation can be found on Pentaho's Website as well. Good luck!
Olap4j 现在是 pentaho mondrian 的一部分。
也许您可以在olap4j API 中找到信息? http://www.olap4j.org/
在此页面上我看到:
org.olap4j.mdx .parser:
MDX 查询语言的解析器。
Olap4j is part of pentaho mondrian now .
Perhaps you can find information into olap4j API ? http://www.olap4j.org/
On this page i see :
org.olap4j.mdx.parser :
Parser for the MDX query language.
看起来 mondrian.rolap.agg.AggregationManager 有一些与之相关的代码,但它并不直接。
如果你遵循最后一行,
你会在这里结束
但我不太确定 mondrian 是否只为 mdx 生成一个 SQL。我认为通过 XMLA(大多数工具将其用作接口),您可以请求在单个轴上进行钻取,其中完整的查询不会被重写。
希望这个答案。
It looks like mondrian.rolap.agg.AggregationManager has some code related to it but its not straight forward.
If you follow the last line,
you will end up here
But I am not so sure if mondrian generates only one SQL for an mdx. I think through XMLA (which most tools use as interface), you can request a drill through on a single axis, in which the complete query is not rewritten.
Hope this answers.
我使用 hsqldb 支持的 Mondrian,以便开发人员针对内存数据库进行工作,但当我们部署到实际环境时,切换到非 Mondrian OLAP 实现。意味着我们可以做一些更灵活的开发,本质上只是使用 Mondrian 将 MDX 转换为 sql。
我创建了一个 SpringBoot/mvn 测试用例并使用 此处评论之一中的 MondrianDaoSupport 模板。同一页面还对所需的 mvn 依赖项提供了一些帮助(注意:我必须将 jflex 1.4.1 与 mondrian 3.2.0 一起使用才能解决 NPE 问题)。使用 SpringBoot 和 hsqldb,我使用测试启动时的数据创建 ROLAP 模式。然后我将架构文件作为类路径资源注入,数据源就是自动装配的 hsqldb 数据源。到目前为止,它运行良好 - 只需约一秒钟即可运行 Junit 测试,该测试用数据引导新的数据库并执行 MDX 查询。我预计在尝试使用更复杂的 MDX 查询时会出现一些问题 - 但让我们看看。
I’m using Mondrian backed by hsqldb so that developers work against in-memory dbs, but then switch to non-Mondrian OLAP implementation when we deploy to real environment. Means we can do some more nimble development, essentially just using Mondrian to convert MDX to sql.
I have created a SpringBoot/mvn test case and used this page to get started – copying the ROLAP ddl and Mondrian mapping schema. I used the MondrianDaoSupport template from one of the comments here. Same page also has some help on mvn dependencies required (nb: i had to use jflex 1.4.1 with mondrian 3.2.0 in order to get past a NPE issue). Using SpringBoot with hsqldb i create the ROLAP schema with data on test start up. Then I inject the schema file as a classpath resource, and Datasource is then the autowired hsqldb datasource. It’s working well so far – taking just ~second to run Junit test that bootstraps a fresh db with data and executes an MDX query. I expect some problems when trying to use more complex MDX queries – but let’s see.