public boolean visit(SQLCreateTriggerStatement x) { SQLExprTableSource on = x.getOn(); on.accept(this); return false; }
@Override public boolean visit(SQLAlterTableExchangePartition x) { SQLExprTableSource table = x.getTable(); if (table != null) { table.accept(this); } return false; }
@Override public boolean visit(OdpsShowPartitionsStmt x) { print0(ucase ? "SHOW PARTITIONS " : "show partitions "); x.getTableSource().accept(this); return false; }
public boolean visit(MySqlCreateTableStatement x) { resolve(this, x); SQLExprTableSource like = x.getLike(); if (like != null) { like.accept(this); } return false; }
@Override public boolean visit(SQLAlterTableRename x) { print0(ucase ? "RENAME TO " : "rename to "); x.getTo().accept(this); return false; }
@Override public boolean visit(OdpsShowStatisticStmt x) { print0(ucase ? "SHOW STATISTIC " : "show statistic "); x.getTableSource().accept(this); return false; }
@Override protected void accept0(SQLASTVisitor visitor) { if (visitor.visit(this)) { if (into != null) { into.accept(visitor); } if (select != null) { select.accept(visitor); } } visitor.endVisit(this); } }
@Override public boolean visit(OdpsRemoveStatisticStatement x) { print0(ucase ? "REMOVE STATISTIC " : "remove statistic "); x.getTable().accept(this); print(' '); x.getStatisticClause().accept(this); return false; }
@Override public boolean visit(OdpsAddStatisticStatement x) { print0(ucase ? "ADD STATISTIC " : "add statistic "); x.getTable().accept(this); print(' '); x.getStatisticClause().accept(this); return false; }
@Override public boolean visit(OdpsAnalyzeTableStatement x) { print0(ucase ? "ANALYZE TABLE " : "analyze table "); x.getTable().accept(this); if (x.getPartition().size() > 0) { print0(ucase ? " PARTITION (" : " partition ("); printAndAccept(x.getPartition(), ", "); print(')'); } print0(ucase ? " COMPUTE STATISTICS" : " compute statistics"); return false; }
public boolean visit(SQLDumpStatement x) { if (repository != null && x.getParent() == null) { repository.resolve(x); } final SQLExprTableSource into = x.getInto(); if (into != null) { into.accept(this); } final SQLSelect select = x.getSelect(); if (select != null) { select.accept(this); } return false; } }
@Override public boolean visit(MySqlLockTableStatement.Item x) { x.getTableSource().accept(this); if (x.getLockType() != null) { print(' '); print0(x.getLockType().name); } if (x.getHints() != null && x.getHints().size() > 0) { print(' '); printAndAccept(x.getHints(), " "); } return false; }
@Override public boolean visit(SQLAlterTableExchangePartition x) { print0(ucase ? "EXCHANGE PARTITION " : "exchange partition "); x.getPartition().accept(this); print0(ucase ? " WITH TABLE " : " with table "); x.getTable().accept(this); Boolean validation = x.getValidation(); if (validation != null) { if (validation) { print0(ucase ? " WITH VALIDATION" : " with validation"); } else { print0(ucase ? " WITHOUT VALIDATION" : " without validation"); } } return false; }
@Override public boolean visit(SQLCommentStatement x) { print0(ucase ? "COMMENT ON " : "comment on "); if (x.getType() != null) { print0(x.getType().name()); print(' '); } x.getOn().accept(this); print0(ucase ? " IS " : " is "); x.getComment().accept(this); return false; }
@Override public boolean visit(OdpsReadStatement x) { print0(ucase ? "READ " : "read "); x.getTable().accept(this); if (x.getColumns().size() > 0) { print0(" ("); printAndAccept(x.getColumns(), ", "); print(')'); } if (x.getPartition().size() > 0) { print0(ucase ? " PARTITION (" : " partition ("); printAndAccept(x.getPartition(), ", "); print(')'); } if (x.getRowCount() != null) { print(' '); x.getRowCount().accept(this); } return false; }
@Override public boolean visit(SQLDumpStatement x) { List<SQLCommentHint> headHints = x.getHeadHintsDirect(); if (headHints != null) { for (SQLCommentHint hint : headHints) { hint.accept(this); println(); } } print0(ucase ? "DUMP DATA " : "dump data "); if (x.isOverwrite()) { print0(ucase ? "OVERWRITE " : "overwrite "); } SQLExprTableSource into = x.getInto(); if (into != null) { into.accept(this); } x.getSelect().accept(this); return false; }
@Override public boolean visit(OracleLockTableStatement x) { print0(ucase ? "LOCK TABLE " : "lock table "); x.getTable().accept(this); print0(ucase ? " IN " : " in "); print0(x.getLockMode().toString()); print0(ucase ? " MODE " : " mode "); if (x.isNoWait()) { print0(ucase ? "NOWAIT" : "nowait"); } else if (x.getWait() != null) { print0(ucase ? "WAIT " : "wait "); x.getWait().accept(this); } return false; }
@Override public boolean visit(OracleLockTableStatement x) { print0(ucase ? "LOCK TABLE " : "lock table "); x.getTable().accept(this); print0(ucase ? " IN " : " in "); print0(x.getLockMode().toString()); print0(ucase ? " MODE " : " mode "); if (x.isNoWait()) { print0(ucase ? "NOWAIT" : "nowait"); } else if (x.getWait() != null) { print0(ucase ? "WAIT " : "wait "); x.getWait().accept(this); } return false; }
public boolean visit(SQLCreateTableStatement x) { if (repository != null && x.getParent() == null) { repository.resolve(x); } for (SQLTableElement e : x.getTableElementList()) { e.setParent(x); } TableStat stat = getTableStat(x.getName()); stat.incrementCreateCount(); accept(x.getTableElementList()); if (x.getInherits() != null) { x.getInherits().accept(this); } if (x.getSelect() != null) { x.getSelect().accept(this); } return false; }
@Override public boolean visit(SQLCommentStatement x) { SQLCommentStatement.Type type = x.getType(); SQLExprTableSource on = x.getOn(); if (type == SQLCommentStatement.Type.TABLE) { print0(ucase ? "ALTER TABLE " : "alter table "); on.accept(this); print0(ucase ? " COMMENT = " : " comment = "); x.getComment().accept(this); } else { SQLPropertyExpr propertyExpr = (SQLPropertyExpr) on.getExpr(); SQLExpr table = propertyExpr.getOwner(); String column = propertyExpr.getName(); print0(ucase ? "ALTER TABLE " : "alter table "); printTableSourceExpr(table); print0(ucase ? " MODIFY COLUMN " : " modify column "); print(column); print0(ucase ? " COMMENT " : " comment "); x.getComment().accept(this); } return false; }