Package com.alibaba.wasp.plan.parser

Examples of com.alibaba.wasp.plan.parser.UnsupportedException


  @Override
  public void checkFieldNotInPrimaryKeys(FTable table, String field)
      throws IOException {
    LinkedHashMap<String, Field> primaryKeys = table.getPrimaryKeys();
    if (inSet(primaryKeys, field)) {
      throw new UnsupportedException(field + " is primary key!");
    }
  }
View Full Code Here


      throws IOException {
    LinkedHashMap<String, Index> allIndexs = table.getIndex();
    if (allIndexs != null && allIndexs.size() > 0) {
      for (Index index : allIndexs.values()) {
        if (index.getIndexKeys().containsKey(field)) {
          throw new UnsupportedException("Column " + field + " in Index "
              + index.getIndexName());
        }
      }
    }
  }
View Full Code Here

      }
    }

    // Not supported no-index query!
    if (indexs == null) {
      throw new UnsupportedException("Don't get a Index!");
    } else if (indexs.size() > 1) {
      return optimizationIndex(indexs, fields);
    } else if (indexs.size() == 1) {
      return indexs.get(0);
    } else {
View Full Code Here

        count++;
      }
    }

    if (count != primaryKeys.size()) {
      throw new UnsupportedException("PrimaryKeys have " + primaryKeys.size()
          + " Fields, but only find " + count + " Fields");
    }

    LinkedHashMap<String, Field> columns = table.getColumns();
    for (Field field : columns.values()) {
      if (field.getKeyWord() == FieldKeyWord.REQUIRED) {
        if (!inSet(fields, field)) {
          throw new UnsupportedException("Field " + field.getName()
              + " is REQUIRED, but don't show up ");
        }
      }
    }
  }
View Full Code Here

  @Override
  public String getColumnFamily(String fTableName, String columnName)
      throws IOException {
    FTable table = reader.getSchema(fTableName);
    if (table == null) {
      throw new UnsupportedException(fTableName + " is not exists!");
    }
    Field column = table.getColumn(columnName);
    if (column != null) {
      return column.getFamily();
    }
    throw new UnsupportedException(fTableName + " don't have column '" + columnName
        + "'");
  }
View Full Code Here

   */
  @Override
  public Field getColumnInfo(FTable fTable, String columnName)
      throws IOException {
    if (fTable == null) {
      throw new UnsupportedException(" Table is not exists!");
    }
    Field column = fTable.getColumn(columnName);
    if (column != null) {
      return column;
    }
    throw new UnsupportedException(fTable.getTableName() + " don't have column '"
        + columnName + "'");
  }
View Full Code Here

  public void checkIndexExists(FTable table, String indexName)
      throws IOException {
    LinkedHashMap<String, Index> allIndexs = table.getIndex();
    if (allIndexs != null && allIndexs.size() > 0) {
      if (!isIndexExists(table, indexName)) {
        throw new UnsupportedException("Table " + table.getTableName()
            + " doesn't have this index '" + indexName + "'");
      }
    } else {
      throw new UnsupportedException("Table " + table.getTableName()
          + " doesn't have any index.");
    }
  }
View Full Code Here

   */
  @Override
  public void checkIndexNotExists(FTable table, String indexName)
      throws IOException {
    if (isIndexExists(table, indexName)) {
      throw new UnsupportedException("Table " + table.getTableName()
          + " has already a same name index.");
    }
  }
View Full Code Here

                .equals(iterToCheck.next().getValue().getName())) {
              allSame = false;
            }
          }
          if (allSame) {
            throw new UnsupportedException("Two index: " + index.getIndexName()
                + " and " + exist.getIndexName() + " have the same columns.");
          }
        }
      }
    }
View Full Code Here

    if (arePrimaryKeys(table, columns)) {
      return;
    } else {
      Index index = checkAndGetIndex(table, columns);
      if (index == null) {
        throw new UnsupportedException("Not a PrimaryKey or a Index");
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.alibaba.wasp.plan.parser.UnsupportedException

Copyright © 2018 www.massapicom. 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.