use of com.alibaba.druid.sql.ast.SQLSubPartitionByList in project druid by alibaba.
the class OracleCreateTableParser method subPartitionBy.
protected SQLSubPartitionBy subPartitionBy() {
lexer.nextToken();
accept(Token.BY);
if (identifierEquals("HASH")) {
lexer.nextToken();
accept(Token.LPAREN);
SQLSubPartitionByHash byHash = new SQLSubPartitionByHash();
SQLExpr expr = this.exprParser.expr();
byHash.setExpr(expr);
accept(Token.RPAREN);
return byHash;
} else if (identifierEquals("LIST")) {
lexer.nextToken();
accept(Token.LPAREN);
SQLSubPartitionByList byList = new SQLSubPartitionByList();
SQLName column = this.exprParser.name();
byList.setColumn(column);
accept(Token.RPAREN);
if (identifierEquals("SUBPARTITION")) {
lexer.nextToken();
acceptIdentifier("TEMPLATE");
accept(Token.LPAREN);
for (; ; ) {
SQLSubPartition subPartition = parseSubPartition();
subPartition.setParent(byList);
byList.getSubPartitionTemplate().add(subPartition);
if (lexer.token() == Token.COMMA) {
lexer.nextToken();
continue;
}
break;
}
accept(Token.RPAREN);
}
return byList;
}
throw new ParserException("TODO : " + lexer.token() + " " + lexer.stringVal());
}
Aggregations