Пример #1
0
  @Override
  public boolean visit(SQLTruncateStatement x) {
    setMode(x, Mode.Delete);

    setAliasMap();

    String originalTable = getCurrentTable();

    for (SQLExprTableSource tableSource : x.getTableSources()) {
      SQLName name = (SQLName) tableSource.getExpr();

      String ident = name.toString();
      setCurrentTable(ident);
      x.putAttribute("_old_local_", originalTable);

      TableStat stat = getTableStat(ident);
      stat.incrementDeleteCount();

      Map<String, String> aliasMap = getAliasMap();
      if (aliasMap != null) {
        aliasMap.put(ident, ident);
      }
    }

    return false;
  }