plugins/tech/cassandra/src/main/java/org/apache/hop/databases/cassandra/datastax/DriverKeyspace.java
@Override
  public void updateTableCQL3(
      String tableName, IRowMeta rowMeta, List<Integer> keyIndexes, ILogChannel log)
      throws Exception {
    Session session = getSession();
    ITableMetaData table = getTableMetaData(tableName);
    for (IValueMeta valueMeta : rowMeta.getValueMetaList()) {
      if (!table.columnExistsInSchema(valueMeta.getName())) {
        session.execute(
            SchemaBuilder.alterTable(tableName)
                .alterColumn(valueMeta.getName())
                .type(CassandraUtils.getCassandraDataTypeFromValueMeta(valueMeta)));
      }
    }
  }
/** Actually an ALTER to add columns, not UPDATE. Purpose of keyIndexes yet to be determined */
Actually an ALTER to add columns, not UPDATE. Purpose of keyIndexes yet to be determined
Actually an ALTER to add columns not UPDATE . Purpose of keyIndexes yet to be determined
@Override
  public void updateTableCQL3(
      String tableName, IRowMeta rowMeta, List<Integer> keyIndexes, ILogChannel log)
      throws Exception {
    Session session = getSession();
    ITableMetaData table = getTableMetaData(tableName);
    for (IValueMeta valueMeta : rowMeta.getValueMetaList()) {
      if (!table.columnExistsInSchema(valueMeta.getName())) {
        session.execute(
            SchemaBuilder.alterTable(tableName)
                .alterColumn(valueMeta.getName())
                .type(CassandraUtils.getCassandraDataTypeFromValueMeta(valueMeta)));
      }
    }
  }
@ Override public void updateTableCQL3 ( String tableName , IRowMeta rowMeta , List < Integer > keyIndexes , ILogChannel log ) throws Exception { Session session = getSession ( ) ; ITableMetaData table = getTableMetaData ( tableName ) ; for ( IValueMeta valueMeta : rowMeta . getValueMetaList ( ) ) { if ( ! table . columnExistsInSchema ( valueMeta . getName ( ) ) ) { session . execute ( SchemaBuilder . alterTable ( tableName ) . alterColumn ( valueMeta . getName ( ) ) . type ( CassandraUtils . getCassandraDataTypeFromValueMeta ( valueMeta ) ) ) ; } } }
Actually an ALTER to add columns, not UPDATE.
Actually an ALTER to add columns not UPDATE .