public override string ToString() { StringBuilder sb = new StringBuilder("StorageDescriptor("); sb.Append("Cols: "); sb.Append(Cols); sb.Append(",Location: "); sb.Append(Location); sb.Append(",InputFormat: "); sb.Append(InputFormat); sb.Append(",OutputFormat: "); sb.Append(OutputFormat); sb.Append(",Compressed: "); sb.Append(Compressed); sb.Append(",NumBuckets: "); sb.Append(NumBuckets); sb.Append(",SerdeInfo: "); sb.Append(SerdeInfo == null ? "<null>" : SerdeInfo.ToString()); sb.Append(",BucketCols: "); sb.Append(BucketCols); sb.Append(",SortCols: "); sb.Append(SortCols); sb.Append(",Parameters: "); sb.Append(Parameters); sb.Append(",SkewedInfo: "); sb.Append(SkewedInfo == null ? "<null>" : SkewedInfo.ToString()); sb.Append(",StoredAsSubDirectories: "); sb.Append(StoredAsSubDirectories); sb.Append(")"); return(sb.ToString()); }
public void Write(TProtocol oprot) { TStruct struc = new TStruct("StorageDescriptor"); oprot.WriteStructBegin(struc); TField field = new TField(); if (Cols != null && __isset.cols) { field.Name = "cols"; field.Type = TType.List; field.ID = 1; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, Cols.Count)); foreach (FieldSchema _iter83 in Cols) { _iter83.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (Location != null && __isset.location) { field.Name = "location"; field.Type = TType.String; field.ID = 2; oprot.WriteFieldBegin(field); oprot.WriteString(Location); oprot.WriteFieldEnd(); } if (InputFormat != null && __isset.inputFormat) { field.Name = "inputFormat"; field.Type = TType.String; field.ID = 3; oprot.WriteFieldBegin(field); oprot.WriteString(InputFormat); oprot.WriteFieldEnd(); } if (OutputFormat != null && __isset.outputFormat) { field.Name = "outputFormat"; field.Type = TType.String; field.ID = 4; oprot.WriteFieldBegin(field); oprot.WriteString(OutputFormat); oprot.WriteFieldEnd(); } if (__isset.compressed) { field.Name = "compressed"; field.Type = TType.Bool; field.ID = 5; oprot.WriteFieldBegin(field); oprot.WriteBool(Compressed); oprot.WriteFieldEnd(); } if (__isset.numBuckets) { field.Name = "numBuckets"; field.Type = TType.I32; field.ID = 6; oprot.WriteFieldBegin(field); oprot.WriteI32(NumBuckets); oprot.WriteFieldEnd(); } if (SerdeInfo != null && __isset.serdeInfo) { field.Name = "serdeInfo"; field.Type = TType.Struct; field.ID = 7; oprot.WriteFieldBegin(field); SerdeInfo.Write(oprot); oprot.WriteFieldEnd(); } if (BucketCols != null && __isset.bucketCols) { field.Name = "bucketCols"; field.Type = TType.List; field.ID = 8; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.String, BucketCols.Count)); foreach (string _iter84 in BucketCols) { oprot.WriteString(_iter84); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (SortCols != null && __isset.sortCols) { field.Name = "sortCols"; field.Type = TType.List; field.ID = 9; oprot.WriteFieldBegin(field); { oprot.WriteListBegin(new TList(TType.Struct, SortCols.Count)); foreach (Order _iter85 in SortCols) { _iter85.Write(oprot); } oprot.WriteListEnd(); } oprot.WriteFieldEnd(); } if (Parameters != null && __isset.parameters) { field.Name = "parameters"; field.Type = TType.Map; field.ID = 10; oprot.WriteFieldBegin(field); { oprot.WriteMapBegin(new TMap(TType.String, TType.String, Parameters.Count)); foreach (string _iter86 in Parameters.Keys) { oprot.WriteString(_iter86); oprot.WriteString(Parameters[_iter86]); } oprot.WriteMapEnd(); } oprot.WriteFieldEnd(); } if (SkewedInfo != null && __isset.skewedInfo) { field.Name = "skewedInfo"; field.Type = TType.Struct; field.ID = 11; oprot.WriteFieldBegin(field); SkewedInfo.Write(oprot); oprot.WriteFieldEnd(); } if (__isset.storedAsSubDirectories) { field.Name = "storedAsSubDirectories"; field.Type = TType.Bool; field.ID = 12; oprot.WriteFieldBegin(field); oprot.WriteBool(StoredAsSubDirectories); oprot.WriteFieldEnd(); } oprot.WriteFieldStop(); oprot.WriteStructEnd(); }
public void Read(TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.List) { { Cols = new List <FieldSchema>(); TList _list70 = iprot.ReadListBegin(); for (int _i71 = 0; _i71 < _list70.Count; ++_i71) { FieldSchema _elem72 = new FieldSchema(); _elem72 = new FieldSchema(); _elem72.Read(iprot); Cols.Add(_elem72); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.String) { Location = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.String) { InputFormat = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 4: if (field.Type == TType.String) { OutputFormat = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 5: if (field.Type == TType.Bool) { Compressed = iprot.ReadBool(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 6: if (field.Type == TType.I32) { NumBuckets = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 7: if (field.Type == TType.Struct) { SerdeInfo = new SerDeInfo(); SerdeInfo.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 8: if (field.Type == TType.List) { { BucketCols = new List <string>(); TList _list73 = iprot.ReadListBegin(); for (int _i74 = 0; _i74 < _list73.Count; ++_i74) { string _elem75 = null; _elem75 = iprot.ReadString(); BucketCols.Add(_elem75); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 9: if (field.Type == TType.List) { { SortCols = new List <Order>(); TList _list76 = iprot.ReadListBegin(); for (int _i77 = 0; _i77 < _list76.Count; ++_i77) { Order _elem78 = new Order(); _elem78 = new Order(); _elem78.Read(iprot); SortCols.Add(_elem78); } iprot.ReadListEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 10: if (field.Type == TType.Map) { { Parameters = new Dictionary <string, string>(); TMap _map79 = iprot.ReadMapBegin(); for (int _i80 = 0; _i80 < _map79.Count; ++_i80) { string _key81; string _val82; _key81 = iprot.ReadString(); _val82 = iprot.ReadString(); Parameters[_key81] = _val82; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 11: if (field.Type == TType.Struct) { SkewedInfo = new SkewedInfo(); SkewedInfo.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 12: if (field.Type == TType.Bool) { StoredAsSubDirectories = iprot.ReadBool(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }