Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run hive in debug mode

Tags:

java

hadoop

hive

i took example from cloudera website to write a custom SerDe for parsing a file

http://blog.cloudera.com/blog/2012/12/how-to-use-a-serde-in-apache-hive/

it seems a good example but when i create table with custom serde

ADD JAR <path-to-hive-serdes-jar>;

CREATE EXTERNAL TABLE tweets (
  id BIGINT,
  created_at STRING,
  source STRING,
  favorited BOOLEAN,
  retweeted_status STRUCT<
    text:STRING,
    user:STRUCT<screen_name:STRING,name:STRING>,
    retweet_count:INT>,
  entities STRUCT<
    urls:ARRAY<STRUCT<expanded_url:STRING>>,
    user_mentions:ARRAY<STRUCT<screen_name:STRING,name:STRING>>,
    hashtags:ARRAY<STRUCT<text:STRING>>>,
  text STRING,
  user STRUCT<
    screen_name:STRING,
    name:STRING,
    friends_count:INT,
    followers_count:INT,
    statuses_count:INT,
    verified:BOOLEAN,
    utc_offset:INT,
    time_zone:STRING>,
  in_reply_to_screen_name STRING
) 
PARTITIONED BY (datehour INT)
ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe'
LOCATION '/user/flume/tweets';

it executed perfectly fine but when i do

select * from tweets;

i am getting nothing so thats why i wanted to know if i can run hive in debug mode to see where it is getting failed

like image 397
sachingupta Avatar asked Jan 09 '15 05:01

sachingupta


2 Answers

You better start hive shell by switching logger mode to DEBUG as follows, I hope you could find something useful from there.

hive --hiveconf hive.root.logger=DEBUG,console
like image 100
SachinJ Avatar answered Oct 27 '22 08:10

SachinJ


Hive code can be debugged.This link may help you : https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide#DeveloperGuide-DebuggingHiveCode

like image 29
Raju Shikha Avatar answered Oct 27 '22 07:10

Raju Shikha