[pig] encountered errors at the first time

1. Error Handling : -stop_on_failure

Ooops! Some job has failed! Specify -stop_on_failure if you want Pig to stop immediately on failure.


[This option is recommended by performance and Efficiency in http://pig.apache.org/docs/r0.9.1/perf.html ]

With multi-query execution Pig processes an entire script or a batch of statements at once. By default Pig tries to run all the jobs that result from that, regardless of whether some jobs fail during execution. To check which jobs have succeeded or failed use one of these options.

First, Pig logs all successful and failed store commands. Store commands are identified by output path. At the end of execution a summary line indicates success, partial failure or failure of all store commands.

Second, Pig returns different code upon completion for these scenarios:

  • Return code 0: All jobs succeeded

  • Return code 1: Used for retrievable errors

  • Return code 2: All jobs have failed

  • Return code 3: Some jobs have failed

In some cases it might be desirable to fail the entire script upon detecting the first failed job. This can be achieved with the "-F" or "-stop_on_failure" command line flag. If used, Pig will stop execution when the first failed job is detected and discontinue further processing. This also means that file commands that come after a failed store in the script will not be executed (this can be used to create "done" files).

This is how the flag is used:

$ pig -F myscript.pig
or
$ pig -stop_on_failure myscript.pig

2. UnknownHostException

Failed Jobs:
JobId   Alias   Feature Message Outputs
N/A     A,B     MAP_ONLY        Message: java.net.UnknownHostException: sonora.peking.corp.com: sonora.peking.corp.com

Caused by: java.net.UnknownHostException: sonora.peking.corp.com

Solution:

add the hostname: sonora.peking.corp.com to your host's configuration file: /etc/hosts

127.0.0.1 localhost  sonora.peking.corp.com


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值