001package gudusoft.gsqlparser.nodes;
002
003import java.util.ArrayList;
004
005public class TDropFunctionSqlNode extends TParseTreeNode {
006
007    public ArrayList<TFunctionHeader> getFunctions() {
008        return functions;
009    }
010
011    private ArrayList<TFunctionHeader> functions;
012    private TObjectName functionName;
013
014    public TObjectName getFunctionName() {
015        return functionName;
016    }
017
018    private TObjectNameList functionNameList = null;
019    public TObjectNameList getFunctionNameList() {
020        return functionNameList;
021    }
022
023    // StarRocks-specific: DROP [GLOBAL] FUNCTION name(arg_types)
024    private boolean starrocksGlobal = false;
025    private TPTNodeList starrocksArgTypes = null;
026
027    public boolean isStarrocksGlobal() {
028        return starrocksGlobal;
029    }
030
031    public void setStarrocksGlobal(boolean starrocksGlobal) {
032        this.starrocksGlobal = starrocksGlobal;
033    }
034
035    public TPTNodeList getStarrocksArgTypes() {
036        return starrocksArgTypes;
037    }
038
039    public void setStarrocksArgTypes(TParseTreeNode argTypes) {
040        if (argTypes instanceof TPTNodeList) {
041            this.starrocksArgTypes = (TPTNodeList) argTypes;
042        }
043    }
044
045    public void init(Object arg1)
046    {
047        if (arg1 instanceof TObjectNameList){
048            functionNameList = (TObjectNameList)arg1;
049        }else if (arg1 instanceof TObjectName){
050            functionName = (TObjectName)arg1;
051        }else{ // postgresql drop function
052            functions = (ArrayList<TFunctionHeader>)arg1;
053        }
054    }
055}