Hi all.

I'm trying to write a simple filter function (to be used with the FILTER 
operator) in python, but I don't seem to find the right way to specify its 
schema. I'm using pig 0.9.2.

The filter's code is (trivially):
        def trivial_filter(s):
                return True
What's the right way of annotating it so that pig understands it returns a 
boolean?

I've tried with:
- @outputSchema("b:boolean") but this causes :
ERROR 1200: <line 1, column 2>  Syntax error, unexpected symbol at or near 
'boolean
- @outputSchema("b:int") is also rejected (as expected):
ERROR 1058: 
<file pdns-long-nxdomains.pig, line 9, column 17> Filter's condition must 
evaluate to boolean. Found: int

Thanks,
Marco


Reply via email to