You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Alex Wang <wa...@gmail.com> on 2010/10/19 00:22:17 UTC

Pig streaming with Bash Shell?

Hi,

Does anyone know if Bash shell works with Pig streaming the same way as
Python? I've been struggling with it without success.

Here is the bash code (filter.sh)

#!/usr/bin/env bash
command /dev/stdin -arguments > /dev/stdout
exit 0

And in the pig script, I did

DEFINE filter `filter.sh`
INPUT (stdin using PigStreaming(','))
OUTPUT (stdout using PigStreaming(','))
SHIP ('filter.sh');

outdata = STREAM indata THROUGH filter;


I can't figure out what's wrong with the code above. But outdata is simply
an empty tuple. Can anyone help? Thanks!