Debugging in PIG UDF

前端 未结 2 488
失恋的感觉
失恋的感觉 2021-02-06 09:07

I am new to Hadoop/PIG. I have a basic question.

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

相关标签:
2条回答
  • 2021-02-06 10:08

    perhaps obvious, but I advise debugging your UDF in local mode before deploying on a cluster/pseudocluster. This way, you can debug it right inside your IDE (eclipse in my case) which is easier than log-debugging.

    0 讨论(0)
  • 2021-02-06 10:13

    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).

    0 讨论(0)
提交回复
热议问题