Invoke Pig Latin script from other Pig script

前端 未结 2 1140
清歌不尽
清歌不尽 2021-01-20 01:30

I have a question about PIG Latin. Is there any way how to invoke some pig script from the other pig script?

I know it is possible to run user defined functions (UDF

相关标签:
2条回答
  • 2021-01-20 01:59

    You can use Macros for such things: http://pig.apache.org/docs/r0.11.1/cont.html#macros

    0 讨论(0)
  • 2021-01-20 02:24

    Pig has two commands, RUN and EXEC. They differ in that RUN will execute the Pig script and leave its aliases and properties available for subsequent usage, while EXEC simply executes the script and returns with the calling environment unaltered (but with any new files created on HDFS available).

    For example, I have a collection of macros, jars, and properties that I want to set at the beginning of every single script I write. Rather than type them every time, I put that into a Pig script and call RUN /my/script.pig at the beginning of my scripts.

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