001package gudusoft.gsqlparser.nodes;
002
003import gudusoft.gsqlparser.EFileFormat;
004import gudusoft.gsqlparser.TSourceToken;
005
006
007public class TFileFormatSqlNode extends TParseTreeNode {
008    private TObjectName fileFormatName;
009    private EFileFormat fileFormat;
010    private String dataCompression;
011
012    public String getDataCompression() {
013        return dataCompression;
014    }
015
016    public void setDataCompressionByToken(TSourceToken st){
017        if (st == null) return;
018        dataCompression = st.toString();
019    }
020
021    public EFileFormat getFileFormat() {
022        return fileFormat;
023    }
024
025    public void setFileFormatByToken(TSourceToken st){
026        if (st == null) return;
027        if (st.toString().equalsIgnoreCase("delimitedtext")){
028            fileFormat = EFileFormat.delimitedtext;
029        }else if (st.toString().equalsIgnoreCase("rcfile")){
030            fileFormat = EFileFormat.rcfile;
031        }else if (st.toString().equalsIgnoreCase("orc")){
032            fileFormat = EFileFormat.orc;
033        }else if (st.toString().equalsIgnoreCase("parquet")){
034            fileFormat = EFileFormat.parquet;
035        }else if (st.toString().equalsIgnoreCase("json")){
036            fileFormat = EFileFormat.json;
037        }
038    }
039
040    public TObjectName getFileFormatName() {
041        return fileFormatName;
042    }
043
044    public void init(Object arg1){
045        fileFormatName = (TObjectName)arg1;
046    }
047}