You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by Earl Cahill <ca...@yahoo.com> on 2008/10/10 08:41:36 UTC

boolean DataAtom values

Howdy,

I have a couple filter-type classes that could take advantage of boolean DataAtoms.  I see signatures for byte, double, int, long and String, but nothing for boolean.

The classes are
	* IsBotHit - tries to determine if a hit came from a bot, like a search bot, but also something like lwp
	* IsPageView - if a hit isn't a bot hit, tries to determine if it is a page view, meaning an html hit or the like
In my development I just used 0 and 1 for true and false, but felt perhaps a touch strange doing it.  I can imagine that many such filter classes would like a boolean value.  Think would also need to be able to filter on values being true or false.

Perhaps this is already in the types branch which I haven't been using.

Thoughts?

Earl


      

Re: boolean DataAtom values

Posted by Alan Gates <ga...@yahoo-inc.com>.
At this point Boolean is not an externally supported type in the  
types branch.  It is used internally (for the return type of  
filters).  However, it cannot currently be used as the return type of  
a UDF, the type of the field in a row, etc.

I don't think there's any opposition to having it as a type, we just  
hadn't had any requests for it.  So if someone wants to take on  
adding it, I think we'd be open to it.

Alan.

On Oct 9, 2008, at 11:41 PM, Earl Cahill wrote:

> Howdy,
>
> I have a couple filter-type classes that could take advantage of  
> boolean DataAtoms.  I see signatures for byte, double, int, long  
> and String, but nothing for boolean.
>
> The classes are
> 	* IsBotHit - tries to determine if a hit came from a bot, like a  
> search bot, but also something like lwp
> 	* IsPageView - if a hit isn't a bot hit, tries to determine if it  
> is a page view, meaning an html hit or the like
> In my development I just used 0 and 1 for true and false, but felt  
> perhaps a touch strange doing it.  I can imagine that many such  
> filter classes would like a boolean value.  Think would also need  
> to be able to filter on values being true or false.
>
> Perhaps this is already in the types branch which I haven't been  
> using.
>
> Thoughts?
>
> Earl
>
>