如何在调试模式下运行配置单元 [英] how to run hive in debug mode

查看:79
本文介绍了如何在调试模式下运行配置单元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以cloudera网站为例,编写了一个自定义SerDe来解析文件

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/

这似乎是一个很好的例子,但是当我使用自定义Serde创建表时

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

推荐答案

您最好通过以下方式将记录器模式切换到DEBUG来启动配置单元外壳,希望在那里可以找到有用的东西.

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

这篇关于如何在调试模式下运行配置单元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆