001package gudusoft.gsqlparser.stmt.hive;
002/*
003 * Date: 13-7-29
004 */
005
006import gudusoft.gsqlparser.EDbVendor;
007import gudusoft.gsqlparser.ESqlStatementType;
008import gudusoft.gsqlparser.TCustomSqlStatement;
009import gudusoft.gsqlparser.nodes.TObjectName;
010import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
011import gudusoft.gsqlparser.nodes.hive.THiveDropFunctionSqlNode;
012
013public class THiveDropFunction extends TCustomSqlStatement {
014
015    private TObjectName functionName;
016
017    public THiveDropFunction(EDbVendor dbvendor) {
018        super(dbvendor);
019        sqlstatementtype = ESqlStatementType.ssthiveDropFunciton;
020    }
021
022    public TObjectName getFunctionName() {
023        return functionName;
024    }
025
026    public int doParseStatement(TCustomSqlStatement psql) {
027        if (rootNode == null) return -1;
028        super.doParseStatement(psql);
029        THiveDropFunctionSqlNode node = (THiveDropFunctionSqlNode)rootNode;
030        functionName = node.getFunctionName();
031
032
033        return 0;
034    }
035
036    public void accept(TParseTreeVisitor v){
037        v.preVisit(this);
038        v.postVisit(this);
039    }
040
041    public void acceptChildren(TParseTreeVisitor v){
042        v.preVisit(this);
043        v.postVisit(this);
044    }
045
046    public void setFunctionName(TObjectName functionName) {
047        this.functionName = functionName;
048    }
049}