在 PIG UDF 中调试 [英] Debugging in PIG UDF
问题描述
我是 Hadoop/PIG 的新手.我有一个基本问题.
I am new to Hadoop/PIG. I have a basic question.
我们在 PIG UDF 中有日志记录工具吗?我写了一个需要验证的 UDF我需要记录某些语句来检查流程.是否有可用的日志记录工具?如果是,Pig 日志在哪里?
Do we have a Logging facility in PIG UDF? I have written a UDF which I need to verify I need to log certain statements to check the flow. Is there a Logging facility available? If yes where are the Pig logs present?
推荐答案
假设您的 UDF 扩展了 EvalFunc
,您可以使用从 EvalFunc.getLogger()
.日志输出应该在 pig 执行的关联 Map/Reduce 任务中可见(如果作业在多个阶段执行,那么您必须通过它们来查找相关的日志条目).
Assuming your UDF extends EvalFunc
, you can use the Logger returned from EvalFunc.getLogger()
. The log output should be visible in the associated Map / Reduce task that pig executes (if the job executes in more than a single stage then you'll have to pick through them to find the associated log entries).
这篇关于在 PIG UDF 中调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!