I think about that. But in order to generate a more useful error 
message, I need the column name, and I cannot get it without passing in 
the column. I think in the future, we probably will need more 
information from the column class to generate detail error messages. 
That's why I pass in the whole column.

On 03/06/2013 01:03 PM, James Taylor wrote:
>
> In src/main/java/com/salesforce/phoenix/compile/UpsertCompiler.java:
>
> >                      throw new TypeMismatchException(literalExpression.getDataType(), column.getDataType(), "expression: " + literalExpression.toString() + " in column " + column);
> >                  }
> > -                byte[] byteValue = column.getDataType().coerceBytes(literalExpression.getBytes(), literalExpression.getValue(), literalExpression.getDataType());
> > +                byte[] byteValue = column.getDataType().coerceBytes(literalExpression.getBytes(), literalExpression.getValue(), literalExpression.getDataType(),
> > +                        literalExpression.getMaxLength(), literalExpression.getScale(), column);
>
> Can we pass the column.getMaxLength() and column.getScale() here 
> instead of column? I don't want PDataType to depend on schema stuff.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/forcedotcom/phoenix/pull/79/files#r3269437>.
>