Exemple #1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_version    = false;
                bool   isset_schema     = false;
                bool   isset_num_rows   = false;
                bool   isset_row_groups = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.I32)
                        {
                            Version       = iprot.ReadI32();
                            isset_version = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Schema = new List <SchemaElement>();
                                TList _list24 = iprot.ReadListBegin();
                                for (int _i25 = 0; _i25 < _list24.Count; ++_i25)
                                {
                                    SchemaElement _elem26;
                                    _elem26 = new SchemaElement();
                                    _elem26.Read(iprot);
                                    Schema.Add(_elem26);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_schema = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Num_rows       = iprot.ReadI64();
                            isset_num_rows = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                Row_groups = new List <RowGroup>();
                                TList _list27 = iprot.ReadListBegin();
                                for (int _i28 = 0; _i28 < _list27.Count; ++_i28)
                                {
                                    RowGroup _elem29;
                                    _elem29 = new RowGroup();
                                    _elem29.Read(iprot);
                                    Row_groups.Add(_elem29);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_row_groups = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Key_value_metadata = new List <KeyValue>();
                                TList _list30 = iprot.ReadListBegin();
                                for (int _i31 = 0; _i31 < _list30.Count; ++_i31)
                                {
                                    KeyValue _elem32;
                                    _elem32 = new KeyValue();
                                    _elem32.Read(iprot);
                                    Key_value_metadata.Add(_elem32);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Created_by = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_version)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_schema)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_num_rows)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_row_groups)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_version    = false;
                bool   isset_schema     = false;
                bool   isset_num_rows   = false;
                bool   isset_row_groups = false;
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.I32)
                        {
                            Version       = iprot.ReadI32();
                            isset_version = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Schema = new List <SchemaElement>();
                                TList _list48 = iprot.ReadListBegin();
                                for (int _i49 = 0; _i49 < _list48.Count; ++_i49)
                                {
                                    SchemaElement _elem50;
                                    _elem50 = new SchemaElement();
                                    _elem50.Read(iprot);
                                    Schema.Add(_elem50);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_schema = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Num_rows       = iprot.ReadI64();
                            isset_num_rows = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                Row_groups = new List <RowGroup>();
                                TList _list51 = iprot.ReadListBegin();
                                for (int _i52 = 0; _i52 < _list51.Count; ++_i52)
                                {
                                    RowGroup _elem53;
                                    _elem53 = new RowGroup();
                                    _elem53.Read(iprot);
                                    Row_groups.Add(_elem53);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_row_groups = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Key_value_metadata = new List <KeyValue>();
                                TList _list54 = iprot.ReadListBegin();
                                for (int _i55 = 0; _i55 < _list54.Count; ++_i55)
                                {
                                    KeyValue _elem56;
                                    _elem56 = new KeyValue();
                                    _elem56.Read(iprot);
                                    Key_value_metadata.Add(_elem56);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Created_by = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                Column_orders = new List <ColumnOrder>();
                                TList _list57 = iprot.ReadListBegin();
                                for (int _i58 = 0; _i58 < _list57.Count; ++_i58)
                                {
                                    ColumnOrder _elem59;
                                    _elem59 = new ColumnOrder();
                                    _elem59.Read(iprot);
                                    Column_orders.Add(_elem59);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.Struct)
                        {
                            Encryption_algorithm = new EncryptionAlgorithm();
                            Encryption_algorithm.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.String)
                        {
                            Footer_signing_key_metadata = iprot.ReadBinary();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_version)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_schema)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_num_rows)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_row_groups)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }