Examples of SQLExpr


Examples of com.alibaba.druid.sql.ast.SQLExpr

   */
  private void getShowTablesPlan(ParseContext context,
      WaspSqlShowTablesStatement sqlShowTablesStatement,
      MetaEventOperation metaEventOperation) throws IOException {
    ShowTablesPlan showTables = null;
    SQLExpr like = sqlShowTablesStatement.getLike();
    SQLExpr where = sqlShowTablesStatement.getWhere();
    if (like == null && where == null) {
      showTables = new ShowTablesPlan(ShowTablesPlan.ShowTablesType.ALL);
    } else if (like != null) {
      showTables = new ShowTablesPlan(ShowTablesPlan.ShowTablesType.LIKE);
      String likePattern = parseString(like);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

   */
  private void getShowCreateTablePlan(ParseContext context,
      WaspSqlShowCreateTableStatement sqlShowCreateTableStatement,
      MetaEventOperation metaEventOperation) throws IOException {
    ShowTablesPlan showTables = new ShowTablesPlan(ShowTablesPlan.ShowTablesType.CREATE);
    SQLExpr name = sqlShowCreateTableStatement.getName();
    String tablename = parseName(name);
    // check if table exists and get Table info
    metaEventOperation.checkAndGetTable(tablename, true);

    showTables.setTablename(tablename);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

    long lastAccessTime = createTime;
    String owner = "me";
    FTable table = new FTable(null, tableName, tableType, owner, createTime,
        lastAccessTime, columns, primaryKeys, primaryKeys.entrySet().iterator()
            .next().getValue());
    SQLExpr entityGroupKeySQLExpr = waspSqlCreateTableStatement
        .getEntityGroupKey();
    Field entityGroupKey = primaryKeys.get(parseName(entityGroupKeySQLExpr));
    if (entityGroupKey == null) {
      throw new UnsupportedException(entityGroupKeySQLExpr
          + " is ForeignKey, but don't in primaryKeys.");
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

   *
   */
  private void getDropIndexPlan(ParseContext context,
      SQLDropIndexStatement sqlDropIndexStatement,
      MetaEventOperation metaEventOperation) throws IOException {
    SQLExpr indexNameExpr = sqlDropIndexStatement.getIndexName();
    SQLExpr table = sqlDropIndexStatement.getTableName();
    String tableName = parseName(table);

    // check if table exists and get Table info
    FTable ftable = metaEventOperation.checkAndGetTable(tableName, true);

View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

    LOG.debug("UPDATE SQL From clause " + sqlDeleteStatement.getTableSource());
    // check if table exists and get Table info
    FTable table = metaEventOperation.checkAndGetTable(wtableName, false);

    // Parse The WHERE clause
    SQLExpr where = sqlDeleteStatement.getWhere();
    LOG.debug("UPDATE SQL where " + where);
    LinkedHashMap<String, Condition> eqConditions = new LinkedHashMap<String, Condition>();
    LinkedHashMap<String, Condition> ranges = new LinkedHashMap<String, Condition>();
    ParserUtils.parse(where, eqConditions, ranges);
    if (ranges.size() > 0) {
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

    LOG.debug("UPDATE SQL From clause " + sqlUpdateStatement.getTableSource());
    // check if table exists and get Table info
    FTable table = metaEventOperation.checkAndGetTable(fTableName, false);

    // Parse The WHERE clause
    SQLExpr where = sqlUpdateStatement.getWhere();
    LOG.debug("UPDATE SQL where " + where);

    LinkedHashMap<String, Condition> conditions = new LinkedHashMap<String, Condition>();
    LinkedHashMap<String, Condition> ranges = new LinkedHashMap<String, Condition>();
    ParserUtils.parse(where, conditions, ranges);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

          + sqlSelectQueryBlock.getSelectList());
      // check if table has this columns
      metaEventOperation.checkAndGetFields(table, selectItem);

      // Parse The WHERE clause
      SQLExpr where = sqlSelectQueryBlock.getWhere();
      LOG.debug("SELECT SQL:where " + where);
      QueryInfo actionInfo = parseWhereClause(table, metaEventOperation, where, sqlSelectQueryBlock.isForUpdate());
      LOG.debug("ActionInfo " + actionInfo.toString());

      // Parse The Limit clause
      SQLExpr rowCount = null;
      if (sqlSelectQueryBlock.getLimit() != null) {
        rowCount = sqlSelectQueryBlock.getLimit().getRowCount();
      }
      int limit = -1;
      if (rowCount != null) {
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

   */
  private LinkedHashSet<String> parseSelectClause(List<SQLSelectItem> select)
      throws UnsupportedException {
    LinkedHashSet<String> selectItem = new LinkedHashSet<String>(select.size());
    for (SQLSelectItem item : select) {
      SQLExpr expr = item.getExpr();
      if(expr instanceof SQLAggregateExpr) {

      }
      String columnName = parseColumn(expr);
      selectItem.add(columnName);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

    return selectItem;
  }

  private AggregateInfo parseAggregateClause(List<SQLSelectItem> select, FTable table) throws UnsupportedException {
    for (SQLSelectItem item : select) {
      SQLExpr expr = item.getExpr();
      if(expr instanceof SQLAggregateExpr) {
        SQLAggregateExpr aggregateExpr = (SQLAggregateExpr) expr;
        String method = aggregateExpr.getMethodName();
        String columnName = parseColumn(aggregateExpr.getArguments().get(0));
        LOG.debug(" SQLAggregatetItem column: " + columnName + " method: " + method);
View Full Code Here

Examples of com.alibaba.druid.sql.ast.SQLExpr

    if (lexer.token() == Token.LIMIT) {
      lexer.nextToken();

      Limit limit = new Limit();

      SQLExpr temp = this.expr();
      if (lexer.token() == (Token.COMMA)) {
        limit.setOffset(temp);
        lexer.nextToken();
        limit.setRowCount(this.expr());
      } else if (identifierEquals("OFFSET")) {
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.