Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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 _iter91 in Cols)
                    {
                        _iter91.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 _iter92 in BucketCols)
                    {
                        oprot.WriteString(_iter92);
                    }
                    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 _iter93 in SortCols)
                    {
                        _iter93.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 _iter94 in Parameters.Keys)
                    {
                        oprot.WriteString(_iter94);
                        oprot.WriteString(Parameters[_iter94]);
                    }
                    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();
        }
Ejemplo n.º 3
0
        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 _list78 = iprot.ReadListBegin();
                            for (int _i79 = 0; _i79 < _list78.Count; ++_i79)
                            {
                                FieldSchema _elem80 = new FieldSchema();
                                _elem80 = new FieldSchema();
                                _elem80.Read(iprot);
                                Cols.Add(_elem80);
                            }
                            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 _list81 = iprot.ReadListBegin();
                            for (int _i82 = 0; _i82 < _list81.Count; ++_i82)
                            {
                                string _elem83 = null;
                                _elem83 = iprot.ReadString();
                                BucketCols.Add(_elem83);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 9:
                    if (field.Type == TType.List)
                    {
                        {
                            SortCols = new List <Order>();
                            TList _list84 = iprot.ReadListBegin();
                            for (int _i85 = 0; _i85 < _list84.Count; ++_i85)
                            {
                                Order _elem86 = new Order();
                                _elem86 = new Order();
                                _elem86.Read(iprot);
                                SortCols.Add(_elem86);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 10:
                    if (field.Type == TType.Map)
                    {
                        {
                            Parameters = new Dictionary <string, string>();
                            TMap _map87 = iprot.ReadMapBegin();
                            for (int _i88 = 0; _i88 < _map87.Count; ++_i88)
                            {
                                string _key89;
                                string _val90;
                                _key89             = iprot.ReadString();
                                _val90             = iprot.ReadString();
                                Parameters[_key89] = _val90;
                            }
                            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();
        }