Like this (ptr is only set as a result of calling 
getExpression().evaluate(tuple, ptr) and it returning true):

if (!getExpression().evaluate(tuple, ptr)) {
     return false;
} else if (ptr.getLength() == 0) {
     return true;
}



On 02/27/2013 10:45 AM, Eli Levine wrote:
>
> In 
> src/main/java/com/salesforce/phoenix/expression/function/ToNumberFunction.java:
>
> > + * @author elevine
> > + * @since 0.1
> > + */
> > +@BuiltInFunction(name=ToNumberFunction.NAME, nodeClass=ToNumberParseNode.class, args= {@Argument(allowedTypes={PDataType.VARCHAR})} )
> > +public class ToNumberFunction extends ScalarFunction {
> > +    public static final String NAME = "TO_NUMBER";
> > +
> > +    public ToNumberFunction() {}
> > +
> > +    public ToNumberFunction(List<Expression> children) throws SQLException {
> > +        super(children.subList(0, 1));
> > +    }
> > +
> > +    @Override
> > +    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
> > +        if (!getExpression().evaluate(tuple, ptr) || ptr.getLength() == 0) {
>
> to clarify, you want the following instead of the existing |if| statement?
>
> if  (ptr.getLength()  ==  0)  {
>      return  true;
> }
> else  if  (!getExpression().evaluate(tuple,  ptr))  {
>      return  false;
> }
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/forcedotcom/phoenix/pull/73/files#r3175675>.
>