Package com.alibaba.wasp.plan.parser

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


  @Override
  public void isLegalTableName(String tableName) throws IOException {
    try {
      FTable.isLegalTableName(tableName);
    } catch (Exception e) {
      throw new UnsupportedException("Unsupported TableName " + tableName, e);
    }
  }
View Full Code Here


        existedColumnNames.add(existedColumn.getName());
      }
    }
    for (Field newColumn : newColumns) {
      if (existedColumnNames.contains(newColumn.getName())) {
        throw new UnsupportedException("Duplicate column name "
            + newColumn.getName() + " in the table definition.");
      }
      existedColumnNames.add(newColumn.getName());
    }
  }
View Full Code Here

        existedColumnFamilys.add(existedColumn.getFamily());
      }
    }
    for (Field newColumn : newColumns) {
      if (!existedColumnFamilys.contains(newColumn.getFamily())) {
        throw new UnsupportedException("ColumnFamily '" + newColumn.getFamily()
            + "' not exists and do not support add columnfamily dynamic now.");
      }
    }
  }
View Full Code Here

  @Override
  public void isLegalFamilyName(String columnFamily) throws IOException {
    try {
      HColumnDescriptor.isLegalFamilyName(Bytes.toBytes(columnFamily));
    } catch (Exception e) {
      throw new UnsupportedException("Unsupported ColumnFamily name "
          + columnFamily, e);
    }
  }
View Full Code Here

        context.getSql(), WaspSqlParserUtils.WASP); // JdbcUtils.MYSQL
                                                    // JdbcUtils.HBASE
    // WaspSqlParserUtils.WASP
    List<SQLStatement> stmtList = parser.parseStatementList();
    if (stmtList == null) {
      throw new UnsupportedException("Non SQLStatement");
    }
    if (stmtList.size() > 1) {
      throw new UnsupportedException("Multi SQLStatement Unsupported"
          + ", there is " + stmtList.size() + " SQLStatement");
    }
    // StmtList could be a list,but we only use an element.
    context.setStmt(stmtList.get(0));
  }
View Full Code Here

      SQLExprTableSource fromExpr = (SQLExprTableSource) from;
      SQLExpr expr = fromExpr.getExpr(); // SQLIdentifierExpr
      return parseName(expr);
    } else if (from instanceof SQLJoinTableSource) {
      // TODO impl join clause
      throw new UnsupportedException("Join clause Unsupported");
    } else if (from instanceof SQLSubqueryTableSource) {
      throw new UnsupportedException("Subquery clause Unsupported");
    } else {
      throw new UnsupportedException("Unsupported");
    }
  }
View Full Code Here

  public static String parseName(SQLExpr name) throws UnsupportedException {
    if (name instanceof SQLIdentifierExpr) {
      SQLIdentifierExpr id = (SQLIdentifierExpr) name;
      return id.getName();
    } else {
      throw new UnsupportedException(
          "Non SQLIdentifierExpr Unsupported, this is " + name);
    }
  }
View Full Code Here

  public static String parseString(SQLExpr value) throws UnsupportedException {
    if (value instanceof SQLCharExpr) {
      SQLCharExpr charexpr = (SQLCharExpr) value;
      return ((SQLCharExpr) charexpr).getText();
    } else {
      throw new UnsupportedException(
          "Non SQLIdentifierExpr Unsupported, this is " + value);
    }
  }
View Full Code Here

  public static int convertToInt(SQLExpr expr) throws UnsupportedException {
    if (expr instanceof SQLIntegerExpr) {// int, long
      Number number = ((SQLIntegerExpr) expr).getNumber();
      return number.intValue();
    } else {
      throw new UnsupportedException("Input is not int or long, it is " + expr);
    }
  }
View Full Code Here

        return; // OK
      } else if (value instanceof SQLMethodInvokeExpr) { // Function
        return; // OK
      }
    }
    throw new UnsupportedException("Unsupported DataType " + type
        + ", input is " + value);
  }
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.