...
- Download pentaho report designer from the pentaho website.
Overwrite report-designer.sh with the code provided below.
Code Block #!/bin/sh HADOOP_CORE={{ls $HADOOP_HOME/hadoop-*-core.jar}} CLASSPATH=.:$HADOOP_CORE:$HIVE_HOME/conf for i in ${HIVE_HOME}/lib/*.jar ; do CLASSPATH=$CLASSPATH:$i done CLASSPATH=$CLASSPATH:launcher.jar echo java -XX:MaxPermSize=512m -cp $CLASSPATH -jar launcher.jar java -XX:MaxPermSize=512m -cp $CLASSPATH org.pentaho.commons.launcher.Launcher
- Build and start the hive server with instructions from HiveServer.
- Compile and run the hive jdbc Hive JDBC client code to load some data (I haven't figured out how to do this in report designer yet). See sample code for loading the data.
Run the report designer (note step 2).
Code Block $ sh reporter-designer.sh
- Select 'Report Design Wizard'.
- select Select a template - say 'fall template' - next.
- create Create a new data source - JDBC (custom), Generic database.
Provide hive jdbc Hive JDBC parameters. Give the connection a name 'hive'.
Code Block URL: jdbc:hive://localhost:10000/default Driver name: org.apache.hadoop.hive.jdbc.HiveDriver Username and password are empty
- Click on 'Test'. The test should succeed.
- Edit the query: select 'Sample Query', click edit query, click on the connection 'hive'. create Create a new query. Write a query on the table testHiveDriverTable: eg: , for example, select * from testHiveDriverTable. Click next.
- Layout Step: Add
PageOfPages
to Group Items By. Add key and value as Selected Items. Click next. And Finish. - Change the Report header to 'hive-pentaho-report'. Change the type of the header to 'html'.
- Run the report and generate pdf. You should get something like the report attached here.
...
- Download, install and start the SQuirrel SQL Client from the SQuirrel SQL website.
- Select 'Drivers -> New Driver...' to register the Hive JDBC driver.
Enter the driver name and example URL:
Code Block language text Name: Hive Example URL: jdbc:hive://localhost:10000/default
Select 'Extra Class Path -> Add' to add the following jars from your local Hive and Hadoop distribution. You will need to build Hive from the trunk after the commit of HIVE-679.
Code Block HIVE_HOME/build/dist/lib/*.jar HADOOP_HOME/hadoop-*-core.jar
Select 'List Drivers'. This will cause SQuirrel to parse your jars for JDBC drivers and might take a few seconds. From the 'Class Name' input box select the Hive driver:
Code Block org.apache.hadoop.hive.jdbc.HiveDriver
- Click 'OK' to complete the driver registration.
- Select 'Aliases -> Add Alias...' to create a connection alias to your Hive server.
- Give the connection alias a name in the 'Name' input box.
- Select the Hive driver from the 'Driver' drop-down.
- Modify the example URL as needed to point to your Hive server.
- Leave 'User Name' and 'Password' blank and click 'OK' to save the connection alias.
- To connect to the Hive server, double-click the Hive alias and click 'Connect'.
...