pig-user  

Hello + Type Massage Question

Paul O'Leary
Tue, 23 Sep 2008 13:21:54 -0700

Hi All,

Finally have the opportunity to use Pig in my day job.  Things are going
well; doing some pretty real stuff!

Quick type massage question, a minor issue really.

I have an expression that looks like this:

(TOTAL_PYMT_POSI_AMT EQ '' ? 0 : TOTAL_PYMT_POSI_AMT) -
(TOTAL_PYMT_NEG_AMT EQ '' ? 0 : TOTAL_PYMT_NEG_AMT) as TOTAL_PYMT_AMT

Pig seems to implicitly cast the types to float/double so the resulting
data field - when dumped - has a decimal, which I don't want.

Is there a way for me to cast the result of the calculation to an
integer, which is what I *do* want?

I noticed the syntax TOTAL_PYMT_AMT:int somewhere but that doesn't seem
to work...

Thanks in advance,
PaulO.