Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Apache Hive Cookbook

You're reading from   Apache Hive Cookbook

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher Packt
ISBN-13 9781782161080
Length 268 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Preface 1. Developing Hive FREE CHAPTER 2. Services in Hive 3. Understanding the Hive Data Model 4. Hive Data Definition Language 5. Hive Data Manipulation Language 6. Hive Extensibility Features 7. Joins and Join Optimization 8. Statistics in Hive 9. Functions in Hive 10. Hive Tuning 11. Hive Security 12. Hive Integration with Other Frameworks Index

Debugging Hive

Here, we will take a quick look at the command-line debugging option in Hive.

Getting ready

Hive code could be debugged by assigning a port to Hive and adding socket details to Hive JVM. To add debugging configuration to Hive, execute the following properties on an OS terminal or add it to bash_profile of the user:

export HIVE_DEBUG_PORT=8000
export HIVE_DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=${HIVE_DEBUG_PORT},server=y,suspend=y"

How to do it...

Once a debug port is attached to Hive and Hive server suspension is enabled at startup, the following steps will help you debug Hive queries:

  1. After defining previously mentioned properties, run the Hive CLI in debug mode:
    hive --debug
    
  2. If you have written up your own Test class and want to execute unit test cases written in that class, then you need to execute the following command specifying the class name you want to execute:
    mvn test -Dtest=ClassName
    
You have been reading a chapter from
Apache Hive Cookbook
Published in: Apr 2016
Publisher: Packt
ISBN-13: 9781782161080
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime