Examples of WaspSqlAlterTableChangeColumn


Examples of com.alibaba.wasp.plan.parser.druid.dialect.WaspSqlAlterTableChangeColumn

    List<SQLAlterTableItem> items = sqlAlterTableStatement.getItems();
    for (SQLAlterTableItem item : items) {
      if (item instanceof WaspSqlAlterTableChangeColumn) {
        // Alter Table Change Column
        WaspSqlAlterTableChangeColumn changeColumn = (WaspSqlAlterTableChangeColumn) item;

        SQLName columnName = changeColumn.getColumnName();
        LinkedHashMap<String, Field> ftableColumns = newTable.getColumns();
        String oldColumnName = parseName(columnName);
        // Table have this column and this column is not primary key
        metaEventOperation.checkFieldExists(oldTable, oldColumnName);
        metaEventOperation.checkFieldNotInPrimaryKeys(oldTable, oldColumnName);
        // Check column not in a index
        metaEventOperation.checkColumnNotInIndex(oldTable, oldColumnName);

        // Which column(index) to change
        Field field = ftableColumns.get(oldColumnName); // Change this Field
        SQLColumnDefinition newColumnDefinition = changeColumn
            .getNewColumnDefinition();
        // ColumnFamily specify do not supported.
        if (newColumnDefinition instanceof WaspSqlColumnDefinition) {
          WaspSqlColumnDefinition waspSqlColumnDefinition =
              (WaspSqlColumnDefinition) newColumnDefinition;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.