There's only one case where ColumnAlreadyExistsException is thrown and 
this is it. What's the other time you're using the 
PhoenixExceptionCodeEnum.COLUMN_EXIST_IN_DEF?

On 02/04/2013 07:28 PM, Tony Huang wrote:
>
> In src/main/java/com/salesforce/phoenix/schema/MetaDataClient.java:
>
> > @@ -496,7 +497,8 @@ public MutationState addColumn(AddColumnStatement statement) throws SQLException
> >                      if (code == MutationCode.COLUMN_ALREADY_EXISTS) {
> >                          connection.addTable(schemaName, result.getTable());
> >                          if (!statement.ifNotExists()) {
> > -                            throw new ColumnAlreadyExistsException(schemaName, tableName, SchemaUtil.findExistingColumn(result.getTable(), columns));
> > +                            throw new ColumnAlreadyExistsException(schemaName, tableName, SchemaUtil.findExistingColumn(result.getTable(), columns)
> > +                                    , PhoenixExceptionCodeEnum.COLUMN_EXIST_IN_DEF.getSQLState());
>
> For this, I believe the exception code has slight difference. The 
> normally ColumnAlreadyExistsException has a more generic exception 
> situation. However, this MedaDataClient seems more focus on the data 
> definition stage, and I can find another SQLState that is more 
> specific for that situation.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/forcedotcom/phoenix/pull/35/files#r2887581>.
>