mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
refactor sql parser about the desc and explain parts of the code
This commit is contained in:
@@ -15,14 +15,24 @@
|
||||
*/
|
||||
package com.alibaba.druid.sql.ast.statement;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.SQLStatementImpl;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SQLDescribeStatement extends SQLStatementImpl {
|
||||
|
||||
protected SQLName object;
|
||||
|
||||
protected SQLName column;
|
||||
|
||||
// for odps
|
||||
protected SQLObjectType objectType;
|
||||
protected List<SQLExpr> partition = new ArrayList<SQLExpr>();
|
||||
|
||||
public SQLName getObject() {
|
||||
return object;
|
||||
}
|
||||
@@ -30,9 +40,40 @@ public class SQLDescribeStatement extends SQLStatementImpl {
|
||||
public void setObject(SQLName object) {
|
||||
this.object = object;
|
||||
}
|
||||
|
||||
|
||||
public SQLName getColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public void setColumn(SQLName column) {
|
||||
if (column != null) {
|
||||
column.setParent(this);
|
||||
}
|
||||
this.column = column;
|
||||
}
|
||||
|
||||
public List<SQLExpr> getPartition() {
|
||||
return partition;
|
||||
}
|
||||
|
||||
public void setPartition(List<SQLExpr> partition) {
|
||||
this.partition = partition;
|
||||
}
|
||||
|
||||
public SQLObjectType getObjectType() {
|
||||
return objectType;
|
||||
}
|
||||
|
||||
public void setObjectType(SQLObjectType objectType) {
|
||||
this.objectType = objectType;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
throw new UnsupportedOperationException(this.getClass().getName());
|
||||
if (visitor.visit(this)) {
|
||||
acceptChild(visitor, object);
|
||||
acceptChild(visitor, column);
|
||||
}
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user