001package gudusoft.gsqlparser.nodes.hive;
002/*
003 * Date: 13-8-7
004 */
005
006import gudusoft.gsqlparser.TSourceToken;
007import gudusoft.gsqlparser.nodes.TAliasClause;
008import gudusoft.gsqlparser.nodes.TExpressionList;
009import gudusoft.gsqlparser.nodes.TParseTreeNode;
010import gudusoft.gsqlparser.nodes.TParseTreeVisitor;
011
012public class THiveTransformClause extends TParseTreeNode {
013
014    public enum ETransformType {ettSelect,ettMap,ettReduce};
015
016    private ETransformType transformType;
017
018    public void setTransformType(ETransformType transformType) {
019        this.transformType = transformType;
020    }
021
022    public ETransformType getTransformType() {
023
024        return transformType;
025    }
026
027    private TExpressionList expressionList;
028    private TSourceToken usingString;
029
030   private THiveRowFormat inRowFormat;
031   private THiveRowFormat outRowFormat;
032   private THiveRecordWriter inRecordWriter;
033   private THiveRecordReader outRecordReader;
034   private TAliasClause aliasClause;
035
036    public TAliasClause getAliasClause() {
037        return aliasClause;
038    }
039
040    public TExpressionList getExpressionList() {
041        return expressionList;
042    }
043
044    public TSourceToken getUsingString() {
045        return usingString;
046    }
047
048    public THiveRecordWriter getInRecordWriter() {
049        return inRecordWriter;
050    }
051
052    public THiveRowFormat getInRowFormat() {
053        return inRowFormat;
054    }
055
056    public THiveRecordReader getOutRecordReader() {
057        return outRecordReader;
058    }
059
060    public THiveRowFormat getOutRowFormat() {
061        return outRowFormat;
062    }
063
064    public void init(Object arg1,Object arg2,Object arg3,Object arg4,Object arg5,Object arg6){
065        expressionList = (TExpressionList)arg1;
066        inRowFormat =  (THiveRowFormat)arg2;
067        inRecordWriter = (THiveRecordWriter)arg3;
068        usingString = (TSourceToken)arg4;
069        //aliasClause = (TAliasClause)arg5;
070
071        outRowFormat = (THiveRowFormat)arg5;
072        outRecordReader = (THiveRecordReader)arg6;
073    }
074
075    public void setAliasClause(TAliasClause aliasClause1) {
076        this.aliasClause = aliasClause1;
077    }
078
079    public void accept(TParseTreeVisitor v){
080        v.preVisit(this);
081        v.postVisit(this);
082    }
083
084    public void acceptChildren(TParseTreeVisitor v){
085        v.preVisit(this);
086        v.postVisit(this);
087    }
088
089    public void setExpressionList(TExpressionList expressionList) {
090        this.expressionList = expressionList;
091    }
092
093    public void setInRowFormat(THiveRowFormat inRowFormat) {
094        this.inRowFormat = inRowFormat;
095    }
096
097    public void setOutRowFormat(THiveRowFormat outRowFormat) {
098        this.outRowFormat = outRowFormat;
099    }
100
101    public void setInRecordWriter(THiveRecordWriter inRecordWriter) {
102        this.inRecordWriter = inRecordWriter;
103    }
104
105    public void setOutRecordReader(THiveRecordReader outRecordReader) {
106        this.outRecordReader = outRecordReader;
107    }
108}