Dear Wiki user,

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

The "Hive/DeveloperGuide" page has been changed by RussellMelick.
The comment on this change is: More information about debugging unit tests with 
eclipse.
http://wiki.apache.org/hadoop/Hive/DeveloperGuide?action=diff&rev1=27&rev2=28

--------------------------------------------------

  Debugging Hive
  
  === Debugging Hive code ===
- Hive code includes both client-side code (e.g., compiler, semantic analyzer, 
and optimizer of HiveQL) and server-side code (e.g., operator/task/SerDe 
implementations). The client-side code are running on your local machine so you 
can easily debug it using Eclipse the same way as you debug a regular local 
Java code.  The server-side code is distributed and running on the Hadoop 
cluster, so debugging server-side Hive code is a little bit complicated. In 
addition to printing to log files using log4j, you can also attach the debugger 
to a different JVM under unit test (single machine mode). Below are the steps 
on how to debug on server-side code.
+ Hive code includes both client-side code (e.g., compiler, semantic analyzer, 
and optimizer of HiveQL) and server-side code (e.g., operator/task/SerDe 
implementations). The client-side code are running on your local machine so you 
can easily debug it using Eclipse the same way as you debug a regular local 
Java code.  Here are the steps to debug code within a unit test.
+  * make sure that you have run {{{ant model-jar}}} in hive/metastore and 
{{{ant gen-test}}} in hive/ql since the last time you ran {{{ant clean}}}
+  * To run all of the unit tests for the Cli, open up TestCliDriver.java
+   * click Run->Debug Configurations , select TestCliDriver, and click Debug
+  * To run a single test within TestCliDriver.java
+   * Begin running the whole TestCli suite as before
+   * Once it finishes the setup and starts executing the JUnit tests, stop the 
test execution
+   * Find the desired test in the JUnit pane
+   * Right click on that test and select Debug
+ 
+ The server-side code is distributed and running on the Hadoop cluster, so 
debugging server-side Hive code is a little bit complicated. In addition to 
printing to log files using log4j, you can also attach the debugger to a 
different JVM under unit test (single machine mode). Below are the steps on how 
to debug on server-side code.
  
   * Compile Hive code with javac.debug=on. Under Hive checkout directory.
   {{{

Reply via email to