Is it possible to exexute a shell script command from my unix directory in pig file system?
Here's how you can run a shell command from within your Pig script:
--declare a shell command
%declare command `shell_command`
file = LOAD 'file.txt' AS (colA:chararray, colB:int) ;
file_processed = FOREACH file GENERATE colA, colB, (command) AS colC ;
The result of the shell_command execution would be available in command which is later substituted in the generate step.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With