You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2009/08/09 09:28:39 UTC

[Hadoop Wiki] Trivial Update of "Hive/HiveJDBCInterface" by RaghothamMurthy

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by RaghothamMurthy:
http://wiki.apache.org/hadoop/Hive/HiveJDBCInterface

------------------------------------------------------------------------------
- The current JDBC interface for Hive only supports running queries and fetching results; none of the metadata calls are supported.
+ == Hive JDBC Interface ==
  
- To see how the JDBC interface can be used, see [wiki:Self:Hive/HiveClient#head-5b27b3a8f9f322945734f470d1ae58f8afeaa0b4 sample code].
+ The current JDBC interface for Hive only supports running queries and fetching results. Only a small subset of the metadata calls are supported.
  
+ To see how the JDBC interface can be used, see [wiki:Self:Hive/HiveClient#head-fd2d8ae9e17fdc3d9b7048d088b2c23a53a6857d sample code].
+ 
+ 
+ === Integration with Pentaho ===
+  1. Download pentaho report designer from the [http://sourceforge.net/project/showfiles.php?group_id=140317&package_id=192362 pentaho website]
+  1.#2 Overwrite report-designer.sh with the code provided below.
+    {{{
+ #!/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}}}
+  1.#3 Build and start the hive server with instructions from [wiki:Self:Hive/HiveServer HiveServer]
+  1.#4 compile and run the hive jdbc client code to load some data (I havent figured out how to do this in report designer yet). See [wiki:Self:Hive/HiveClient#head-fd2d8ae9e17fdc3d9b7048d088b2c23a53a6857d sample code] for loading the data.
+  1.#5 Run the report designer (note step 2)
+    {{{
+    $ sh reporter-designer.sh   }}}
+  1.#6 Select 'Report Design Wizard'
+  1.#7 select a template - say 'fall template' - next
+  1.#8 create a new data source - JDBC (custom), Generic database
+  1.#9 Provide hive jdbc parameters. Give the connection a name 'hive'.
+    {{{
+    URL: jdbc:hive://localhost:10000/default
+    Driver name: org.apache.hadoop.hive.jdbc.HiveDriver
+    Username and password are empty   }}}
+  1.#10 Click on 'Test'. The test should succeed
+  1.#11 Edit the query: select 'Sample Query', click edit query, click on the connection 'hive'. create a new query. Write a query on the table testHiveDriverTable: eg: select * from testHiveDriverTable. Click next.
+  1.#12 Layout Step: Add `PageOfPages` to Group Items By. Add key and value as Selected Items. Click next. And Finish.
+  1.#13 Change the Report header to 'hive-pentaho-report'. Change the type of the header to 'html'
+  1.#14 Run the report and generate pdf. You should get something like the report attached here.
+