Yes, that's right. Let's keep the getDataType() as you have it, always 
returning PDataType.DECIMAL

On 02/27/2013 10:47 AM, Eli Levine wrote:
>
> In 
> src/main/java/com/salesforce/phoenix/expression/function/ToNumberFunction.java:
>
> > +    @Override
> > +    public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr) {
> > +        if (!getExpression().evaluate(tuple, ptr) || ptr.getLength() == 0) {
> > +            return false;
> > +        }
> > +        PDataType type = getExpression().getDataType();
> > +        String stringValue = (String)type.toObject(ptr);
> > +        BigDecimal decimalValue = (BigDecimal) getDataType().toObject(stringValue);
> > +        byte[] byteValue = getDataType().toBytes(decimalValue);
> > +        ptr.set(byteValue);
> > +        return true;
> > +    }
> > +
> > +    @Override
> > +    public PDataType getDataType() {
> > +        return PDataType.DECIMAL;
>
> Postgres returns NUMERIC data type from TO_NUMBER, which supports 
> precision: 
> http://www.postgresql.org/docs/9.1/static/datatype-numeric.html My 
> assumption is that it maps to the DECIMAL Phoenix data type. What is 
> your recommendation?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/forcedotcom/phoenix/pull/73/files#r3175737>.
>