private void updateExistingColumnFamily ( TableInfo tableInfo , KsDef ksDef , InvalidRequestException irex ) throws Exception { StringBuilder builder = new StringBuilder ( "^Cannot add already existing (?:column family|table) .*$" ) ; if ( irex . getWhy ( ) != null && irex . getWhy ( ) . matches ( builder . toString ( ) ) ) { SchemaOperationType operationType = SchemaOperationType . getInstance ( operation ) ; switch ( operationType ) { case create : handleCreate ( tableInfo , ksDef ) ; break ; case createdrop : handleCreate ( tableInfo , ksDef ) ; break ; case update : if ( isCql3Enabled ( tableInfo ) ) { for ( ColumnInfo column : tableInfo . getColumnMetadatas ( ) ) { addColumnToTable ( tableInfo , column ) ; } createIndexUsingCql ( tableInfo ) ; } else { updateTable ( ksDef , tableInfo ) ; } break ; default : break ; } } else { log . error ( "Error occurred while creating table {}, Caused by: {}." , tableInfo . getTableName ( ) , irex ) ; throw new SchemaGenerationException ( "Error occurred while creating table " + tableInfo . getTableName ( ) , irex , "Cassandra" , databaseName ) ; } }
Update existing column family .