LucidDbOlap

From Eigenpedia

Jump to: navigation, search

LucidDB and Mondrian

For OLAP applications, LucidDB works well when run in tandem with Mondrian, an open-source pure-Java OLAP engine which supports the MDX query language. In fact, since both are built on Java technology, they can be run together in the same J2EE application server for high performance (single JVM sharing the same memory, with no remote procedure calls) and convenient management (just one server).

But for getting started, you may learn more by setting up and running the two components separately. Here's how.

  • Set up LucidDB as described in LucidDbGettingStarted, and start the server listening on the default port.
  • Run sqllineClient and execute the following commands to prepare a schema and user for use by Mondrian:
create schema foodmart;
create user foodmart authorization 'Unused' default schema foodmart;
grant execute on specific procedure
applib.compute_statistics_for_schema to foodmart;
  • Download Mondrian as described in the first section of the installation instructions.
  • For section 2, Set up test data in a non-embedded database, use the following information to configure FoodMartLoader:
    • JDBC driver jar: luciddb/plugin/LucidDbClient.jar
    • JDBC driver class: com.lucidera.jdbc.LucidDbRmiDriver
    • -outputJdbcURL="jdbc:luciddb:rmi://localhost"
    • -outputJdbcUser="FOODMART"
  • Below is an example script for running FoodMartLoader against LucidDB on Linux (to be run from the directory where you unpacked Mondrian; you'll need to adjust the path to luciddb's installation for LucidDbClient.jar). For a faster and easier way to replicate FoodMart or any other Mondrian-fronted database into LucidDB, see LucidDbMondrianReplication.
export CP=lib/commons-dbcp.jar:lib/commons-collections.jar:lib/commons-pool.jar
export CP=$CP:lib/eigenbase-properties.jar:lib/eigenbase-resgen.jar:lib/eigenbase-xom.jar
export CP=$CP:lib/javacup.jar:lib/mondrian.jar
export CP=$CP:lib/log4j-1.2.9.jar
export CP=$CP:testsrc/main
export CP=$CP:classes
export CP=$CP:testclasses
export CP=$CP:/path/to/luciddb/plugin/LucidDbClient.jar
java -Xms500m -Xmx500m -cp $CP -Dlog4j.configuration=log4j.xml mondrian.test.loader.MondrianFoodMartLoader -tables -data -indexes -inputFile="demo/FoodMartCreateData.sql" -jdbcDrivers=com.lucidera.jdbc.LucidDbRmiDriver -outputJdbcURL="jdbc:luciddb:rmi://localhost" -outputJdbcUser=FOODMART
  • After running FoodMartLoader, run sqllineClient -n FOODMART to log in to LucidDB as the FOODMART user; execute this command to compute optimizer statistics on the loaded data:
call applib.compute_statistics_for_schema('FOODMART');
  • Follow the deployment instructions in section 3, Deploy and run the web application with a non-embedded database, making the necessary changes for the LucidDB JDBC driver.
  • You should now be able to execute MDX queries via a web browser, with Mondrian as a middleman executing SQL against LucidDB to fetch data. Check luciddb/trace/LucidDbTrace.log to see the SQL statements executed in response to your queries.

ETL

To find out how to replace FOODMART with your own data, read the LucidDbEtlTutorial.