IndexStatementRewriter creates a CAST parse node when rewriting the query
to use indexed columns. Without this check present we end up creating a
RoundExpression instead of a simple coerce expression.
On Dec 10, 2013 6:11 PM, "James Taylor" <notifications@github.com> wrote:

> In src/main/java/com/salesforce/phoenix/compile/ExpressionCompiler.java:
>
> >          }
> > -        if (dataType!= null && targetDataType != null && !dataType.isCoercibleTo(targetDataType)) {
> > -            // TODO: remove soon. Allow cast for indexes, as we know what we're doing :-)
> > +
> > +        Expression expr = childExpr;
> > +        if(fromDataType != null) {
> >              if (context.getResolver().getTables().get(0).getTable().getType() != PTableType.INDEX) {
>
> Do we still need this check?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/forcedotcom/phoenix/pull/623/files#r8255670>
> .
>