001package gudusoft.gsqlparser.nodes;
002/*
003 * Date: 13-8-9
004 */
005
006import gudusoft.gsqlparser.EAlterIndexOption;
007import gudusoft.gsqlparser.EDbObjectType;
008import gudusoft.gsqlparser.nodes.hive.THiveKeyValueProperty;
009
010public class TAlterIndexSqlNode extends TParseTreeNode {
011
012    private TObjectName indexName;
013    private TObjectName onIndexName;
014    private EAlterIndexOption alterIndexOption;
015    private TPTNodeList <THiveKeyValueProperty> indexProperties;
016    private TPartitionExtensionClause partitionSpec;
017
018    public TObjectName getOnIndexName() {
019        return onIndexName;
020    }
021
022    public EAlterIndexOption getAlterIndexOption() {
023        return alterIndexOption;
024    }
025
026    public TPTNodeList<THiveKeyValueProperty> getIndexProperties() {
027        return indexProperties;
028    }
029
030    public TPartitionExtensionClause getPartitionSpec() {
031        return partitionSpec;
032    }
033
034    public TObjectName getIndexName() {
035        return indexName;
036    }
037
038    public void init(Object arg1){
039        indexName = (TObjectName)arg1;
040    }
041
042    public void init(Object arg1,Object arg2){
043        alterIndexOption = (EAlterIndexOption)arg1;
044        indexName = (TObjectName)arg2;
045        indexName.setDbObjectTypeDirectly(EDbObjectType.index);
046    }
047
048    public void init(Object arg1,Object arg2,Object arg3){
049        init(arg1,arg2);
050        onIndexName = (TObjectName)arg3;
051    }
052
053    public void init(Object arg1,Object arg2,Object arg3,Object arg4){
054        init(arg1,arg2,arg3);
055        switch (alterIndexOption){
056            case setProperties:
057                indexProperties = (TPTNodeList)arg4;
058                break;
059            case rebuild:
060                partitionSpec = (TPartitionExtensionClause)arg4;
061                break;
062        }
063    }
064
065    public void init(Object arg1,Object arg2,Object arg3,Object arg4,Object arg5){
066        init(arg1,arg2,arg3,arg4);
067        partitionSpec = (TPartitionExtensionClause)arg5;
068
069    }
070
071    public void setIndexName(TObjectName indexName) {
072        this.indexName = indexName;
073    }
074
075    public void setOnIndexName(TObjectName onIndexName) {
076        this.onIndexName = onIndexName;
077    }
078
079    public void setAlterIndexOption(EAlterIndexOption alterIndexOption) {
080        this.alterIndexOption = alterIndexOption;
081    }
082
083    public void setIndexProperties(TPTNodeList<THiveKeyValueProperty> indexProperties) {
084        this.indexProperties = indexProperties;
085    }
086
087    public void setPartitionSpec(TPartitionExtensionClause partitionSpec) {
088        this.partitionSpec = partitionSpec;
089    }
090}