// Autogenerated by Thrift Compiler (0.12.0)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING

package hive_metastore

import (
	"bytes"
	"context"
	"reflect"
	"database/sql/driver"
	"errors"
	"fmt"
	"github.com/apache/thrift/lib/go/thrift"
	"github.com/bippio/go-impala/services/fb303"

)

// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = context.Background
var _ = reflect.DeepEqual
var _ = bytes.Equal

var _ = fb303.GoUnusedProtection__
type HiveObjectType int64
const (
  HiveObjectType_GLOBAL HiveObjectType = 1
  HiveObjectType_DATABASE HiveObjectType = 2
  HiveObjectType_TABLE HiveObjectType = 3
  HiveObjectType_PARTITION HiveObjectType = 4
  HiveObjectType_COLUMN HiveObjectType = 5
)

func (p HiveObjectType) String() string {
  switch p {
  case HiveObjectType_GLOBAL: return "GLOBAL"
  case HiveObjectType_DATABASE: return "DATABASE"
  case HiveObjectType_TABLE: return "TABLE"
  case HiveObjectType_PARTITION: return "PARTITION"
  case HiveObjectType_COLUMN: return "COLUMN"
  }
  return "<UNSET>"
}

func HiveObjectTypeFromString(s string) (HiveObjectType, error) {
  switch s {
  case "GLOBAL": return HiveObjectType_GLOBAL, nil 
  case "DATABASE": return HiveObjectType_DATABASE, nil 
  case "TABLE": return HiveObjectType_TABLE, nil 
  case "PARTITION": return HiveObjectType_PARTITION, nil 
  case "COLUMN": return HiveObjectType_COLUMN, nil 
  }
  return HiveObjectType(0), fmt.Errorf("not a valid HiveObjectType string")
}


func HiveObjectTypePtr(v HiveObjectType) *HiveObjectType { return &v }

func (p HiveObjectType) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *HiveObjectType) UnmarshalText(text []byte) error {
q, err := HiveObjectTypeFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *HiveObjectType) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = HiveObjectType(v)
return nil
}

func (p * HiveObjectType) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
type PrincipalType int64
const (
  PrincipalType_USER PrincipalType = 1
  PrincipalType_ROLE PrincipalType = 2
  PrincipalType_GROUP PrincipalType = 3
)

func (p PrincipalType) String() string {
  switch p {
  case PrincipalType_USER: return "USER"
  case PrincipalType_ROLE: return "ROLE"
  case PrincipalType_GROUP: return "GROUP"
  }
  return "<UNSET>"
}

func PrincipalTypeFromString(s string) (PrincipalType, error) {
  switch s {
  case "USER": return PrincipalType_USER, nil 
  case "ROLE": return PrincipalType_ROLE, nil 
  case "GROUP": return PrincipalType_GROUP, nil 
  }
  return PrincipalType(0), fmt.Errorf("not a valid PrincipalType string")
}


func PrincipalTypePtr(v PrincipalType) *PrincipalType { return &v }

func (p PrincipalType) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}

func (p *PrincipalType) UnmarshalText(text []byte) error {
q, err := PrincipalTypeFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}

func (p *PrincipalType) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = PrincipalType(v)
return nil
}

func (p * PrincipalType) Value() (driver.Value, error) {
  if p == nil {
    return nil, nil
  }
return int64(*p), nil
}
// Attributes:
//  - Version
//  - Comments
type Version struct {
  Version string `thrift:"version,1" db:"version" json:"version"`
  Comments string `thrift:"comments,2" db:"comments" json:"comments"`
}

func NewVersion() *Version {
  return &Version{}
}


func (p *Version) GetVersion() string {
  return p.Version
}

func (p *Version) GetComments() string {
  return p.Comments
}
func (p *Version) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Version)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Version = v
}
  return nil
}

func (p *Version)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Comments = v
}
  return nil
}

func (p *Version) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Version"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Version) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("version", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) }
  if err := oprot.WriteString(string(p.Version)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) }
  return err
}

func (p *Version) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("comments", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:comments: ", p), err) }
  if err := oprot.WriteString(string(p.Comments)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.comments (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:comments: ", p), err) }
  return err
}

func (p *Version) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Version(%+v)", *p)
}

// Attributes:
//  - Name
//  - Type
//  - Comment
type FieldSchema struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  Type string `thrift:"type,2" db:"type" json:"type"`
  Comment string `thrift:"comment,3" db:"comment" json:"comment"`
}

func NewFieldSchema() *FieldSchema {
  return &FieldSchema{}
}


func (p *FieldSchema) GetName() string {
  return p.Name
}

func (p *FieldSchema) GetType() string {
  return p.Type
}

func (p *FieldSchema) GetComment() string {
  return p.Comment
}
func (p *FieldSchema) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *FieldSchema)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *FieldSchema)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Type = v
}
  return nil
}

func (p *FieldSchema)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Comment = v
}
  return nil
}

func (p *FieldSchema) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("FieldSchema"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *FieldSchema) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *FieldSchema) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("type", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) }
  if err := oprot.WriteString(string(p.Type)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) }
  return err
}

func (p *FieldSchema) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("comment", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:comment: ", p), err) }
  if err := oprot.WriteString(string(p.Comment)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.comment (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:comment: ", p), err) }
  return err
}

func (p *FieldSchema) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("FieldSchema(%+v)", *p)
}

// Attributes:
//  - Name
//  - Type1
//  - Type2
//  - Fields
type Type struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  Type1 *string `thrift:"type1,2" db:"type1" json:"type1,omitempty"`
  Type2 *string `thrift:"type2,3" db:"type2" json:"type2,omitempty"`
  Fields []*FieldSchema `thrift:"fields,4" db:"fields" json:"fields,omitempty"`
}

func NewType() *Type {
  return &Type{}
}


func (p *Type) GetName() string {
  return p.Name
}
var Type_Type1_DEFAULT string
func (p *Type) GetType1() string {
  if !p.IsSetType1() {
    return Type_Type1_DEFAULT
  }
return *p.Type1
}
var Type_Type2_DEFAULT string
func (p *Type) GetType2() string {
  if !p.IsSetType2() {
    return Type_Type2_DEFAULT
  }
return *p.Type2
}
var Type_Fields_DEFAULT []*FieldSchema

func (p *Type) GetFields() []*FieldSchema {
  return p.Fields
}
func (p *Type) IsSetType1() bool {
  return p.Type1 != nil
}

func (p *Type) IsSetType2() bool {
  return p.Type2 != nil
}

func (p *Type) IsSetFields() bool {
  return p.Fields != nil
}

func (p *Type) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Type)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *Type)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Type1 = &v
}
  return nil
}

func (p *Type)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Type2 = &v
}
  return nil
}

func (p *Type)  ReadField4(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.Fields =  tSlice
  for i := 0; i < size; i ++ {
    _elem0 := &FieldSchema{}
    if err := _elem0.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err)
    }
    p.Fields = append(p.Fields, _elem0)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *Type) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Type"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Type) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *Type) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetType1() {
    if err := oprot.WriteFieldBegin("type1", thrift.STRING, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type1: ", p), err) }
    if err := oprot.WriteString(string(*p.Type1)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.type1 (2) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type1: ", p), err) }
  }
  return err
}

func (p *Type) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetType2() {
    if err := oprot.WriteFieldBegin("type2", thrift.STRING, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type2: ", p), err) }
    if err := oprot.WriteString(string(*p.Type2)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.type2 (3) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type2: ", p), err) }
  }
  return err
}

func (p *Type) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetFields() {
    if err := oprot.WriteFieldBegin("fields", thrift.LIST, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fields)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Fields {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) }
  }
  return err
}

func (p *Type) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Type(%+v)", *p)
}

// Attributes:
//  - ObjectType
//  - DbName
//  - ObjectName
//  - PartValues
//  - ColumnName
type HiveObjectRef struct {
  ObjectType HiveObjectType `thrift:"objectType,1" db:"objectType" json:"objectType"`
  DbName string `thrift:"dbName,2" db:"dbName" json:"dbName"`
  ObjectName string `thrift:"objectName,3" db:"objectName" json:"objectName"`
  PartValues []string `thrift:"partValues,4" db:"partValues" json:"partValues"`
  ColumnName string `thrift:"columnName,5" db:"columnName" json:"columnName"`
}

func NewHiveObjectRef() *HiveObjectRef {
  return &HiveObjectRef{}
}


func (p *HiveObjectRef) GetObjectType() HiveObjectType {
  return p.ObjectType
}

func (p *HiveObjectRef) GetDbName() string {
  return p.DbName
}

func (p *HiveObjectRef) GetObjectName() string {
  return p.ObjectName
}

func (p *HiveObjectRef) GetPartValues() []string {
  return p.PartValues
}

func (p *HiveObjectRef) GetColumnName() string {
  return p.ColumnName
}
func (p *HiveObjectRef) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *HiveObjectRef)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  temp := HiveObjectType(v)
  p.ObjectType = temp
}
  return nil
}

func (p *HiveObjectRef)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *HiveObjectRef)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.ObjectName = v
}
  return nil
}

func (p *HiveObjectRef)  ReadField4(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartValues =  tSlice
  for i := 0; i < size; i ++ {
var _elem1 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem1 = v
}
    p.PartValues = append(p.PartValues, _elem1)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *HiveObjectRef)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.ColumnName = v
}
  return nil
}

func (p *HiveObjectRef) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("HiveObjectRef"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *HiveObjectRef) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("objectType", thrift.I32, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectType: ", p), err) }
  if err := oprot.WriteI32(int32(p.ObjectType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.objectType (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectType: ", p), err) }
  return err
}

func (p *HiveObjectRef) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbName", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dbName: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbName (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dbName: ", p), err) }
  return err
}

func (p *HiveObjectRef) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("objectName", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:objectName: ", p), err) }
  if err := oprot.WriteString(string(p.ObjectName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.objectName (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:objectName: ", p), err) }
  return err
}

func (p *HiveObjectRef) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("partValues", thrift.LIST, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:partValues: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartValues)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartValues {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:partValues: ", p), err) }
  return err
}

func (p *HiveObjectRef) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("columnName", thrift.STRING, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) }
  if err := oprot.WriteString(string(p.ColumnName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) }
  return err
}

func (p *HiveObjectRef) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("HiveObjectRef(%+v)", *p)
}

// Attributes:
//  - Privilege
//  - CreateTime
//  - Grantor
//  - GrantorType
//  - GrantOption
type PrivilegeGrantInfo struct {
  Privilege string `thrift:"privilege,1" db:"privilege" json:"privilege"`
  CreateTime int32 `thrift:"createTime,2" db:"createTime" json:"createTime"`
  Grantor string `thrift:"grantor,3" db:"grantor" json:"grantor"`
  GrantorType PrincipalType `thrift:"grantorType,4" db:"grantorType" json:"grantorType"`
  GrantOption bool `thrift:"grantOption,5" db:"grantOption" json:"grantOption"`
}

func NewPrivilegeGrantInfo() *PrivilegeGrantInfo {
  return &PrivilegeGrantInfo{}
}


func (p *PrivilegeGrantInfo) GetPrivilege() string {
  return p.Privilege
}

func (p *PrivilegeGrantInfo) GetCreateTime() int32 {
  return p.CreateTime
}

func (p *PrivilegeGrantInfo) GetGrantor() string {
  return p.Grantor
}

func (p *PrivilegeGrantInfo) GetGrantorType() PrincipalType {
  return p.GrantorType
}

func (p *PrivilegeGrantInfo) GetGrantOption() bool {
  return p.GrantOption
}
func (p *PrivilegeGrantInfo) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *PrivilegeGrantInfo)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Privilege = v
}
  return nil
}

func (p *PrivilegeGrantInfo)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.CreateTime = v
}
  return nil
}

func (p *PrivilegeGrantInfo)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Grantor = v
}
  return nil
}

func (p *PrivilegeGrantInfo)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  temp := PrincipalType(v)
  p.GrantorType = temp
}
  return nil
}

func (p *PrivilegeGrantInfo)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.GrantOption = v
}
  return nil
}

func (p *PrivilegeGrantInfo) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("PrivilegeGrantInfo"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *PrivilegeGrantInfo) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("privilege", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:privilege: ", p), err) }
  if err := oprot.WriteString(string(p.Privilege)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.privilege (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:privilege: ", p), err) }
  return err
}

func (p *PrivilegeGrantInfo) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("createTime", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:createTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.CreateTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.createTime (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:createTime: ", p), err) }
  return err
}

func (p *PrivilegeGrantInfo) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantor", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:grantor: ", p), err) }
  if err := oprot.WriteString(string(p.Grantor)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grantor (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:grantor: ", p), err) }
  return err
}

func (p *PrivilegeGrantInfo) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantorType", thrift.I32, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:grantorType: ", p), err) }
  if err := oprot.WriteI32(int32(p.GrantorType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grantorType (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:grantorType: ", p), err) }
  return err
}

func (p *PrivilegeGrantInfo) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantOption", thrift.BOOL, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:grantOption: ", p), err) }
  if err := oprot.WriteBool(bool(p.GrantOption)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grantOption (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:grantOption: ", p), err) }
  return err
}

func (p *PrivilegeGrantInfo) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("PrivilegeGrantInfo(%+v)", *p)
}

// Attributes:
//  - HiveObject
//  - PrincipalName
//  - PrincipalType
//  - GrantInfo
type HiveObjectPrivilege struct {
  HiveObject *HiveObjectRef `thrift:"hiveObject,1" db:"hiveObject" json:"hiveObject"`
  PrincipalName string `thrift:"principalName,2" db:"principalName" json:"principalName"`
  PrincipalType PrincipalType `thrift:"principalType,3" db:"principalType" json:"principalType"`
  GrantInfo *PrivilegeGrantInfo `thrift:"grantInfo,4" db:"grantInfo" json:"grantInfo"`
}

func NewHiveObjectPrivilege() *HiveObjectPrivilege {
  return &HiveObjectPrivilege{}
}

var HiveObjectPrivilege_HiveObject_DEFAULT *HiveObjectRef
func (p *HiveObjectPrivilege) GetHiveObject() *HiveObjectRef {
  if !p.IsSetHiveObject() {
    return HiveObjectPrivilege_HiveObject_DEFAULT
  }
return p.HiveObject
}

func (p *HiveObjectPrivilege) GetPrincipalName() string {
  return p.PrincipalName
}

func (p *HiveObjectPrivilege) GetPrincipalType() PrincipalType {
  return p.PrincipalType
}
var HiveObjectPrivilege_GrantInfo_DEFAULT *PrivilegeGrantInfo
func (p *HiveObjectPrivilege) GetGrantInfo() *PrivilegeGrantInfo {
  if !p.IsSetGrantInfo() {
    return HiveObjectPrivilege_GrantInfo_DEFAULT
  }
return p.GrantInfo
}
func (p *HiveObjectPrivilege) IsSetHiveObject() bool {
  return p.HiveObject != nil
}

func (p *HiveObjectPrivilege) IsSetGrantInfo() bool {
  return p.GrantInfo != nil
}

func (p *HiveObjectPrivilege) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *HiveObjectPrivilege)  ReadField1(iprot thrift.TProtocol) error {
  p.HiveObject = &HiveObjectRef{}
  if err := p.HiveObject.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HiveObject), err)
  }
  return nil
}

func (p *HiveObjectPrivilege)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.PrincipalName = v
}
  return nil
}

func (p *HiveObjectPrivilege)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := PrincipalType(v)
  p.PrincipalType = temp
}
  return nil
}

func (p *HiveObjectPrivilege)  ReadField4(iprot thrift.TProtocol) error {
  p.GrantInfo = &PrivilegeGrantInfo{}
  if err := p.GrantInfo.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GrantInfo), err)
  }
  return nil
}

func (p *HiveObjectPrivilege) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("HiveObjectPrivilege"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *HiveObjectPrivilege) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("hiveObject", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hiveObject: ", p), err) }
  if err := p.HiveObject.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HiveObject), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hiveObject: ", p), err) }
  return err
}

func (p *HiveObjectPrivilege) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principalName", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:principalName: ", p), err) }
  if err := oprot.WriteString(string(p.PrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principalName (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:principalName: ", p), err) }
  return err
}

func (p *HiveObjectPrivilege) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principalType", thrift.I32, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:principalType: ", p), err) }
  if err := oprot.WriteI32(int32(p.PrincipalType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principalType (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:principalType: ", p), err) }
  return err
}

func (p *HiveObjectPrivilege) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantInfo", thrift.STRUCT, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:grantInfo: ", p), err) }
  if err := p.GrantInfo.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GrantInfo), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:grantInfo: ", p), err) }
  return err
}

func (p *HiveObjectPrivilege) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("HiveObjectPrivilege(%+v)", *p)
}

// Attributes:
//  - Privileges
type PrivilegeBag struct {
  Privileges []*HiveObjectPrivilege `thrift:"privileges,1" db:"privileges" json:"privileges"`
}

func NewPrivilegeBag() *PrivilegeBag {
  return &PrivilegeBag{}
}


func (p *PrivilegeBag) GetPrivileges() []*HiveObjectPrivilege {
  return p.Privileges
}
func (p *PrivilegeBag) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *PrivilegeBag)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*HiveObjectPrivilege, 0, size)
  p.Privileges =  tSlice
  for i := 0; i < size; i ++ {
    _elem2 := &HiveObjectPrivilege{}
    if err := _elem2.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem2), err)
    }
    p.Privileges = append(p.Privileges, _elem2)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *PrivilegeBag) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("PrivilegeBag"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *PrivilegeBag) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("privileges", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:privileges: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Privileges)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Privileges {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:privileges: ", p), err) }
  return err
}

func (p *PrivilegeBag) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("PrivilegeBag(%+v)", *p)
}

// Attributes:
//  - UserPrivileges
//  - GroupPrivileges
//  - RolePrivileges
type PrincipalPrivilegeSet struct {
  UserPrivileges map[string][]*PrivilegeGrantInfo `thrift:"userPrivileges,1" db:"userPrivileges" json:"userPrivileges"`
  GroupPrivileges map[string][]*PrivilegeGrantInfo `thrift:"groupPrivileges,2" db:"groupPrivileges" json:"groupPrivileges"`
  RolePrivileges map[string][]*PrivilegeGrantInfo `thrift:"rolePrivileges,3" db:"rolePrivileges" json:"rolePrivileges"`
}

func NewPrincipalPrivilegeSet() *PrincipalPrivilegeSet {
  return &PrincipalPrivilegeSet{}
}


func (p *PrincipalPrivilegeSet) GetUserPrivileges() map[string][]*PrivilegeGrantInfo {
  return p.UserPrivileges
}

func (p *PrincipalPrivilegeSet) GetGroupPrivileges() map[string][]*PrivilegeGrantInfo {
  return p.GroupPrivileges
}

func (p *PrincipalPrivilegeSet) GetRolePrivileges() map[string][]*PrivilegeGrantInfo {
  return p.RolePrivileges
}
func (p *PrincipalPrivilegeSet) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *PrincipalPrivilegeSet)  ReadField1(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string][]*PrivilegeGrantInfo, size)
  p.UserPrivileges =  tMap
  for i := 0; i < size; i ++ {
var _key3 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key3 = v
}
    _, size, err := iprot.ReadListBegin()
    if err != nil {
      return thrift.PrependError("error reading list begin: ", err)
    }
    tSlice := make([]*PrivilegeGrantInfo, 0, size)
    _val4 :=  tSlice
    for i := 0; i < size; i ++ {
      _elem5 := &PrivilegeGrantInfo{}
      if err := _elem5.Read(iprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err)
      }
      _val4 = append(_val4, _elem5)
    }
    if err := iprot.ReadListEnd(); err != nil {
      return thrift.PrependError("error reading list end: ", err)
    }
    p.UserPrivileges[_key3] = _val4
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *PrincipalPrivilegeSet)  ReadField2(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string][]*PrivilegeGrantInfo, size)
  p.GroupPrivileges =  tMap
  for i := 0; i < size; i ++ {
var _key6 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key6 = v
}
    _, size, err := iprot.ReadListBegin()
    if err != nil {
      return thrift.PrependError("error reading list begin: ", err)
    }
    tSlice := make([]*PrivilegeGrantInfo, 0, size)
    _val7 :=  tSlice
    for i := 0; i < size; i ++ {
      _elem8 := &PrivilegeGrantInfo{}
      if err := _elem8.Read(iprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err)
      }
      _val7 = append(_val7, _elem8)
    }
    if err := iprot.ReadListEnd(); err != nil {
      return thrift.PrependError("error reading list end: ", err)
    }
    p.GroupPrivileges[_key6] = _val7
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *PrincipalPrivilegeSet)  ReadField3(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string][]*PrivilegeGrantInfo, size)
  p.RolePrivileges =  tMap
  for i := 0; i < size; i ++ {
var _key9 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key9 = v
}
    _, size, err := iprot.ReadListBegin()
    if err != nil {
      return thrift.PrependError("error reading list begin: ", err)
    }
    tSlice := make([]*PrivilegeGrantInfo, 0, size)
    _val10 :=  tSlice
    for i := 0; i < size; i ++ {
      _elem11 := &PrivilegeGrantInfo{}
      if err := _elem11.Read(iprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err)
      }
      _val10 = append(_val10, _elem11)
    }
    if err := iprot.ReadListEnd(); err != nil {
      return thrift.PrependError("error reading list end: ", err)
    }
    p.RolePrivileges[_key9] = _val10
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *PrincipalPrivilegeSet) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("PrincipalPrivilegeSet"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *PrincipalPrivilegeSet) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("userPrivileges", thrift.MAP, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:userPrivileges: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.UserPrivileges)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.UserPrivileges {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range v {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:userPrivileges: ", p), err) }
  return err
}

func (p *PrincipalPrivilegeSet) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("groupPrivileges", thrift.MAP, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:groupPrivileges: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.GroupPrivileges)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.GroupPrivileges {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range v {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:groupPrivileges: ", p), err) }
  return err
}

func (p *PrincipalPrivilegeSet) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("rolePrivileges", thrift.MAP, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:rolePrivileges: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.RolePrivileges)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.RolePrivileges {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range v {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:rolePrivileges: ", p), err) }
  return err
}

func (p *PrincipalPrivilegeSet) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("PrincipalPrivilegeSet(%+v)", *p)
}

// Attributes:
//  - RoleName
//  - CreateTime
//  - OwnerName
type Role struct {
  RoleName string `thrift:"roleName,1" db:"roleName" json:"roleName"`
  CreateTime int32 `thrift:"createTime,2" db:"createTime" json:"createTime"`
  OwnerName string `thrift:"ownerName,3" db:"ownerName" json:"ownerName"`
}

func NewRole() *Role {
  return &Role{}
}


func (p *Role) GetRoleName() string {
  return p.RoleName
}

func (p *Role) GetCreateTime() int32 {
  return p.CreateTime
}

func (p *Role) GetOwnerName() string {
  return p.OwnerName
}
func (p *Role) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Role)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RoleName = v
}
  return nil
}

func (p *Role)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.CreateTime = v
}
  return nil
}

func (p *Role)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.OwnerName = v
}
  return nil
}

func (p *Role) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Role"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Role) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("roleName", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:roleName: ", p), err) }
  if err := oprot.WriteString(string(p.RoleName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.roleName (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:roleName: ", p), err) }
  return err
}

func (p *Role) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("createTime", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:createTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.CreateTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.createTime (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:createTime: ", p), err) }
  return err
}

func (p *Role) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("ownerName", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ownerName: ", p), err) }
  if err := oprot.WriteString(string(p.OwnerName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.ownerName (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ownerName: ", p), err) }
  return err
}

func (p *Role) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Role(%+v)", *p)
}

// Attributes:
//  - Name
//  - Description
//  - LocationUri
//  - Parameters
//  - Privileges
type Database struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  Description string `thrift:"description,2" db:"description" json:"description"`
  LocationUri string `thrift:"locationUri,3" db:"locationUri" json:"locationUri"`
  Parameters map[string]string `thrift:"parameters,4" db:"parameters" json:"parameters"`
  Privileges *PrincipalPrivilegeSet `thrift:"privileges,5" db:"privileges" json:"privileges,omitempty"`
}

func NewDatabase() *Database {
  return &Database{}
}


func (p *Database) GetName() string {
  return p.Name
}

func (p *Database) GetDescription() string {
  return p.Description
}

func (p *Database) GetLocationUri() string {
  return p.LocationUri
}

func (p *Database) GetParameters() map[string]string {
  return p.Parameters
}
var Database_Privileges_DEFAULT *PrincipalPrivilegeSet
func (p *Database) GetPrivileges() *PrincipalPrivilegeSet {
  if !p.IsSetPrivileges() {
    return Database_Privileges_DEFAULT
  }
return p.Privileges
}
func (p *Database) IsSetPrivileges() bool {
  return p.Privileges != nil
}

func (p *Database) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Database)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *Database)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Description = v
}
  return nil
}

func (p *Database)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.LocationUri = v
}
  return nil
}

func (p *Database)  ReadField4(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key12 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key12 = v
}
var _val13 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val13 = v
}
    p.Parameters[_key12] = _val13
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *Database)  ReadField5(iprot thrift.TProtocol) error {
  p.Privileges = &PrincipalPrivilegeSet{}
  if err := p.Privileges.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Privileges), err)
  }
  return nil
}

func (p *Database) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Database"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Database) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *Database) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("description", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:description: ", p), err) }
  if err := oprot.WriteString(string(p.Description)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.description (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:description: ", p), err) }
  return err
}

func (p *Database) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("locationUri", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:locationUri: ", p), err) }
  if err := oprot.WriteString(string(p.LocationUri)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.locationUri (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:locationUri: ", p), err) }
  return err
}

func (p *Database) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parameters: ", p), err) }
  return err
}

func (p *Database) writeField5(oprot thrift.TProtocol) (err error) {
  if p.IsSetPrivileges() {
    if err := oprot.WriteFieldBegin("privileges", thrift.STRUCT, 5); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:privileges: ", p), err) }
    if err := p.Privileges.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Privileges), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 5:privileges: ", p), err) }
  }
  return err
}

func (p *Database) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Database(%+v)", *p)
}

// Attributes:
//  - Name
//  - SerializationLib
//  - Parameters
type SerDeInfo struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  SerializationLib string `thrift:"serializationLib,2" db:"serializationLib" json:"serializationLib"`
  Parameters map[string]string `thrift:"parameters,3" db:"parameters" json:"parameters"`
}

func NewSerDeInfo() *SerDeInfo {
  return &SerDeInfo{}
}


func (p *SerDeInfo) GetName() string {
  return p.Name
}

func (p *SerDeInfo) GetSerializationLib() string {
  return p.SerializationLib
}

func (p *SerDeInfo) GetParameters() map[string]string {
  return p.Parameters
}
func (p *SerDeInfo) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *SerDeInfo)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *SerDeInfo)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.SerializationLib = v
}
  return nil
}

func (p *SerDeInfo)  ReadField3(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key14 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key14 = v
}
var _val15 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val15 = v
}
    p.Parameters[_key14] = _val15
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *SerDeInfo) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("SerDeInfo"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *SerDeInfo) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *SerDeInfo) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("serializationLib", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serializationLib: ", p), err) }
  if err := oprot.WriteString(string(p.SerializationLib)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.serializationLib (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serializationLib: ", p), err) }
  return err
}

func (p *SerDeInfo) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parameters: ", p), err) }
  return err
}

func (p *SerDeInfo) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("SerDeInfo(%+v)", *p)
}

// Attributes:
//  - Col
//  - Order
type Order struct {
  Col string `thrift:"col,1" db:"col" json:"col"`
  Order int32 `thrift:"order,2" db:"order" json:"order"`
}

func NewOrder() *Order {
  return &Order{}
}


func (p *Order) GetCol() string {
  return p.Col
}

func (p *Order) GetOrder() int32 {
  return p.Order
}
func (p *Order) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Order)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Col = v
}
  return nil
}

func (p *Order)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Order = v
}
  return nil
}

func (p *Order) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Order"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Order) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("col", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:col: ", p), err) }
  if err := oprot.WriteString(string(p.Col)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.col (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:col: ", p), err) }
  return err
}

func (p *Order) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("order", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:order: ", p), err) }
  if err := oprot.WriteI32(int32(p.Order)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.order (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:order: ", p), err) }
  return err
}

func (p *Order) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Order(%+v)", *p)
}

// Attributes:
//  - Cols
//  - Location
//  - InputFormat
//  - OutputFormat
//  - Compressed
//  - NumBuckets
//  - SerdeInfo
//  - BucketCols
//  - SortCols
//  - Parameters
type StorageDescriptor struct {
  Cols []*FieldSchema `thrift:"cols,1" db:"cols" json:"cols"`
  Location string `thrift:"location,2" db:"location" json:"location"`
  InputFormat string `thrift:"inputFormat,3" db:"inputFormat" json:"inputFormat"`
  OutputFormat string `thrift:"outputFormat,4" db:"outputFormat" json:"outputFormat"`
  Compressed bool `thrift:"compressed,5" db:"compressed" json:"compressed"`
  NumBuckets int32 `thrift:"numBuckets,6" db:"numBuckets" json:"numBuckets"`
  SerdeInfo *SerDeInfo `thrift:"serdeInfo,7" db:"serdeInfo" json:"serdeInfo"`
  BucketCols []string `thrift:"bucketCols,8" db:"bucketCols" json:"bucketCols"`
  SortCols []*Order `thrift:"sortCols,9" db:"sortCols" json:"sortCols"`
  Parameters map[string]string `thrift:"parameters,10" db:"parameters" json:"parameters"`
}

func NewStorageDescriptor() *StorageDescriptor {
  return &StorageDescriptor{}
}


func (p *StorageDescriptor) GetCols() []*FieldSchema {
  return p.Cols
}

func (p *StorageDescriptor) GetLocation() string {
  return p.Location
}

func (p *StorageDescriptor) GetInputFormat() string {
  return p.InputFormat
}

func (p *StorageDescriptor) GetOutputFormat() string {
  return p.OutputFormat
}

func (p *StorageDescriptor) GetCompressed() bool {
  return p.Compressed
}

func (p *StorageDescriptor) GetNumBuckets() int32 {
  return p.NumBuckets
}
var StorageDescriptor_SerdeInfo_DEFAULT *SerDeInfo
func (p *StorageDescriptor) GetSerdeInfo() *SerDeInfo {
  if !p.IsSetSerdeInfo() {
    return StorageDescriptor_SerdeInfo_DEFAULT
  }
return p.SerdeInfo
}

func (p *StorageDescriptor) GetBucketCols() []string {
  return p.BucketCols
}

func (p *StorageDescriptor) GetSortCols() []*Order {
  return p.SortCols
}

func (p *StorageDescriptor) GetParameters() map[string]string {
  return p.Parameters
}
func (p *StorageDescriptor) IsSetSerdeInfo() bool {
  return p.SerdeInfo != nil
}

func (p *StorageDescriptor) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 8:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField8(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 9:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField9(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 10:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField10(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *StorageDescriptor)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.Cols =  tSlice
  for i := 0; i < size; i ++ {
    _elem16 := &FieldSchema{}
    if err := _elem16.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err)
    }
    p.Cols = append(p.Cols, _elem16)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *StorageDescriptor)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Location = v
}
  return nil
}

func (p *StorageDescriptor)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.InputFormat = v
}
  return nil
}

func (p *StorageDescriptor)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.OutputFormat = v
}
  return nil
}

func (p *StorageDescriptor)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.Compressed = v
}
  return nil
}

func (p *StorageDescriptor)  ReadField6(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 6: ", err)
} else {
  p.NumBuckets = v
}
  return nil
}

func (p *StorageDescriptor)  ReadField7(iprot thrift.TProtocol) error {
  p.SerdeInfo = &SerDeInfo{}
  if err := p.SerdeInfo.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SerdeInfo), err)
  }
  return nil
}

func (p *StorageDescriptor)  ReadField8(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.BucketCols =  tSlice
  for i := 0; i < size; i ++ {
var _elem17 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem17 = v
}
    p.BucketCols = append(p.BucketCols, _elem17)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *StorageDescriptor)  ReadField9(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Order, 0, size)
  p.SortCols =  tSlice
  for i := 0; i < size; i ++ {
    _elem18 := &Order{}
    if err := _elem18.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err)
    }
    p.SortCols = append(p.SortCols, _elem18)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *StorageDescriptor)  ReadField10(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key19 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key19 = v
}
var _val20 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val20 = v
}
    p.Parameters[_key19] = _val20
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *StorageDescriptor) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("StorageDescriptor"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
    if err := p.writeField8(oprot); err != nil { return err }
    if err := p.writeField9(oprot); err != nil { return err }
    if err := p.writeField10(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *StorageDescriptor) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("cols", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cols: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Cols)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Cols {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cols: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("location", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:location: ", p), err) }
  if err := oprot.WriteString(string(p.Location)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.location (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:location: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("inputFormat", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:inputFormat: ", p), err) }
  if err := oprot.WriteString(string(p.InputFormat)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.inputFormat (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:inputFormat: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("outputFormat", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:outputFormat: ", p), err) }
  if err := oprot.WriteString(string(p.OutputFormat)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.outputFormat (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:outputFormat: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("compressed", thrift.BOOL, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:compressed: ", p), err) }
  if err := oprot.WriteBool(bool(p.Compressed)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.compressed (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:compressed: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("numBuckets", thrift.I32, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:numBuckets: ", p), err) }
  if err := oprot.WriteI32(int32(p.NumBuckets)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.numBuckets (6) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:numBuckets: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField7(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("serdeInfo", thrift.STRUCT, 7); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:serdeInfo: ", p), err) }
  if err := p.SerdeInfo.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SerdeInfo), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 7:serdeInfo: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField8(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("bucketCols", thrift.LIST, 8); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:bucketCols: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.BucketCols)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.BucketCols {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 8:bucketCols: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField9(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sortCols", thrift.LIST, 9); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:sortCols: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SortCols)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.SortCols {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 9:sortCols: ", p), err) }
  return err
}

func (p *StorageDescriptor) writeField10(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 10); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 10:parameters: ", p), err) }
  return err
}

func (p *StorageDescriptor) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("StorageDescriptor(%+v)", *p)
}

// Attributes:
//  - TableName
//  - DbName
//  - Owner
//  - CreateTime
//  - LastAccessTime
//  - Retention
//  - Sd
//  - PartitionKeys
//  - Parameters
//  - ViewOriginalText
//  - ViewExpandedText
//  - TableType
//  - Privileges
type Table struct {
  TableName string `thrift:"tableName,1" db:"tableName" json:"tableName"`
  DbName string `thrift:"dbName,2" db:"dbName" json:"dbName"`
  Owner string `thrift:"owner,3" db:"owner" json:"owner"`
  CreateTime int32 `thrift:"createTime,4" db:"createTime" json:"createTime"`
  LastAccessTime int32 `thrift:"lastAccessTime,5" db:"lastAccessTime" json:"lastAccessTime"`
  Retention int32 `thrift:"retention,6" db:"retention" json:"retention"`
  Sd *StorageDescriptor `thrift:"sd,7" db:"sd" json:"sd"`
  PartitionKeys []*FieldSchema `thrift:"partitionKeys,8" db:"partitionKeys" json:"partitionKeys"`
  Parameters map[string]string `thrift:"parameters,9" db:"parameters" json:"parameters"`
  ViewOriginalText string `thrift:"viewOriginalText,10" db:"viewOriginalText" json:"viewOriginalText"`
  ViewExpandedText string `thrift:"viewExpandedText,11" db:"viewExpandedText" json:"viewExpandedText"`
  TableType string `thrift:"tableType,12" db:"tableType" json:"tableType"`
  Privileges *PrincipalPrivilegeSet `thrift:"privileges,13" db:"privileges" json:"privileges,omitempty"`
}

func NewTable() *Table {
  return &Table{}
}


func (p *Table) GetTableName() string {
  return p.TableName
}

func (p *Table) GetDbName() string {
  return p.DbName
}

func (p *Table) GetOwner() string {
  return p.Owner
}

func (p *Table) GetCreateTime() int32 {
  return p.CreateTime
}

func (p *Table) GetLastAccessTime() int32 {
  return p.LastAccessTime
}

func (p *Table) GetRetention() int32 {
  return p.Retention
}
var Table_Sd_DEFAULT *StorageDescriptor
func (p *Table) GetSd() *StorageDescriptor {
  if !p.IsSetSd() {
    return Table_Sd_DEFAULT
  }
return p.Sd
}

func (p *Table) GetPartitionKeys() []*FieldSchema {
  return p.PartitionKeys
}

func (p *Table) GetParameters() map[string]string {
  return p.Parameters
}

func (p *Table) GetViewOriginalText() string {
  return p.ViewOriginalText
}

func (p *Table) GetViewExpandedText() string {
  return p.ViewExpandedText
}

func (p *Table) GetTableType() string {
  return p.TableType
}
var Table_Privileges_DEFAULT *PrincipalPrivilegeSet
func (p *Table) GetPrivileges() *PrincipalPrivilegeSet {
  if !p.IsSetPrivileges() {
    return Table_Privileges_DEFAULT
  }
return p.Privileges
}
func (p *Table) IsSetSd() bool {
  return p.Sd != nil
}

func (p *Table) IsSetPrivileges() bool {
  return p.Privileges != nil
}

func (p *Table) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 8:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField8(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 9:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField9(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 10:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField10(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 11:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField11(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 12:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField12(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 13:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField13(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Table)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.TableName = v
}
  return nil
}

func (p *Table)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *Table)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Owner = v
}
  return nil
}

func (p *Table)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.CreateTime = v
}
  return nil
}

func (p *Table)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.LastAccessTime = v
}
  return nil
}

func (p *Table)  ReadField6(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 6: ", err)
} else {
  p.Retention = v
}
  return nil
}

func (p *Table)  ReadField7(iprot thrift.TProtocol) error {
  p.Sd = &StorageDescriptor{}
  if err := p.Sd.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Sd), err)
  }
  return nil
}

func (p *Table)  ReadField8(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.PartitionKeys =  tSlice
  for i := 0; i < size; i ++ {
    _elem21 := &FieldSchema{}
    if err := _elem21.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err)
    }
    p.PartitionKeys = append(p.PartitionKeys, _elem21)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *Table)  ReadField9(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key22 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key22 = v
}
var _val23 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val23 = v
}
    p.Parameters[_key22] = _val23
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *Table)  ReadField10(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 10: ", err)
} else {
  p.ViewOriginalText = v
}
  return nil
}

func (p *Table)  ReadField11(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 11: ", err)
} else {
  p.ViewExpandedText = v
}
  return nil
}

func (p *Table)  ReadField12(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 12: ", err)
} else {
  p.TableType = v
}
  return nil
}

func (p *Table)  ReadField13(iprot thrift.TProtocol) error {
  p.Privileges = &PrincipalPrivilegeSet{}
  if err := p.Privileges.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Privileges), err)
  }
  return nil
}

func (p *Table) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Table"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
    if err := p.writeField8(oprot); err != nil { return err }
    if err := p.writeField9(oprot); err != nil { return err }
    if err := p.writeField10(oprot); err != nil { return err }
    if err := p.writeField11(oprot); err != nil { return err }
    if err := p.writeField12(oprot); err != nil { return err }
    if err := p.writeField13(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Table) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tableName: ", p), err) }
  if err := oprot.WriteString(string(p.TableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tableName (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tableName: ", p), err) }
  return err
}

func (p *Table) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbName", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dbName: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbName (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dbName: ", p), err) }
  return err
}

func (p *Table) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("owner", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:owner: ", p), err) }
  if err := oprot.WriteString(string(p.Owner)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.owner (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:owner: ", p), err) }
  return err
}

func (p *Table) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("createTime", thrift.I32, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:createTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.CreateTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.createTime (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:createTime: ", p), err) }
  return err
}

func (p *Table) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("lastAccessTime", thrift.I32, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:lastAccessTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.LastAccessTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.lastAccessTime (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:lastAccessTime: ", p), err) }
  return err
}

func (p *Table) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("retention", thrift.I32, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:retention: ", p), err) }
  if err := oprot.WriteI32(int32(p.Retention)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.retention (6) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:retention: ", p), err) }
  return err
}

func (p *Table) writeField7(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sd", thrift.STRUCT, 7); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:sd: ", p), err) }
  if err := p.Sd.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Sd), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 7:sd: ", p), err) }
  return err
}

func (p *Table) writeField8(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("partitionKeys", thrift.LIST, 8); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:partitionKeys: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.PartitionKeys)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartitionKeys {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 8:partitionKeys: ", p), err) }
  return err
}

func (p *Table) writeField9(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 9); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 9:parameters: ", p), err) }
  return err
}

func (p *Table) writeField10(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("viewOriginalText", thrift.STRING, 10); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:viewOriginalText: ", p), err) }
  if err := oprot.WriteString(string(p.ViewOriginalText)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.viewOriginalText (10) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 10:viewOriginalText: ", p), err) }
  return err
}

func (p *Table) writeField11(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("viewExpandedText", thrift.STRING, 11); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:viewExpandedText: ", p), err) }
  if err := oprot.WriteString(string(p.ViewExpandedText)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.viewExpandedText (11) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 11:viewExpandedText: ", p), err) }
  return err
}

func (p *Table) writeField12(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tableType", thrift.STRING, 12); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:tableType: ", p), err) }
  if err := oprot.WriteString(string(p.TableType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tableType (12) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 12:tableType: ", p), err) }
  return err
}

func (p *Table) writeField13(oprot thrift.TProtocol) (err error) {
  if p.IsSetPrivileges() {
    if err := oprot.WriteFieldBegin("privileges", thrift.STRUCT, 13); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 13:privileges: ", p), err) }
    if err := p.Privileges.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Privileges), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 13:privileges: ", p), err) }
  }
  return err
}

func (p *Table) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Table(%+v)", *p)
}

// Attributes:
//  - Values
//  - DbName
//  - TableName
//  - CreateTime
//  - LastAccessTime
//  - Sd
//  - Parameters
//  - Privileges
type Partition struct {
  Values []string `thrift:"values,1" db:"values" json:"values"`
  DbName string `thrift:"dbName,2" db:"dbName" json:"dbName"`
  TableName string `thrift:"tableName,3" db:"tableName" json:"tableName"`
  CreateTime int32 `thrift:"createTime,4" db:"createTime" json:"createTime"`
  LastAccessTime int32 `thrift:"lastAccessTime,5" db:"lastAccessTime" json:"lastAccessTime"`
  Sd *StorageDescriptor `thrift:"sd,6" db:"sd" json:"sd"`
  Parameters map[string]string `thrift:"parameters,7" db:"parameters" json:"parameters"`
  Privileges *PrincipalPrivilegeSet `thrift:"privileges,8" db:"privileges" json:"privileges,omitempty"`
}

func NewPartition() *Partition {
  return &Partition{}
}


func (p *Partition) GetValues() []string {
  return p.Values
}

func (p *Partition) GetDbName() string {
  return p.DbName
}

func (p *Partition) GetTableName() string {
  return p.TableName
}

func (p *Partition) GetCreateTime() int32 {
  return p.CreateTime
}

func (p *Partition) GetLastAccessTime() int32 {
  return p.LastAccessTime
}
var Partition_Sd_DEFAULT *StorageDescriptor
func (p *Partition) GetSd() *StorageDescriptor {
  if !p.IsSetSd() {
    return Partition_Sd_DEFAULT
  }
return p.Sd
}

func (p *Partition) GetParameters() map[string]string {
  return p.Parameters
}
var Partition_Privileges_DEFAULT *PrincipalPrivilegeSet
func (p *Partition) GetPrivileges() *PrincipalPrivilegeSet {
  if !p.IsSetPrivileges() {
    return Partition_Privileges_DEFAULT
  }
return p.Privileges
}
func (p *Partition) IsSetSd() bool {
  return p.Sd != nil
}

func (p *Partition) IsSetPrivileges() bool {
  return p.Privileges != nil
}

func (p *Partition) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 8:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField8(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Partition)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Values =  tSlice
  for i := 0; i < size; i ++ {
var _elem24 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem24 = v
}
    p.Values = append(p.Values, _elem24)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *Partition)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *Partition)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.TableName = v
}
  return nil
}

func (p *Partition)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.CreateTime = v
}
  return nil
}

func (p *Partition)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.LastAccessTime = v
}
  return nil
}

func (p *Partition)  ReadField6(iprot thrift.TProtocol) error {
  p.Sd = &StorageDescriptor{}
  if err := p.Sd.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Sd), err)
  }
  return nil
}

func (p *Partition)  ReadField7(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key25 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key25 = v
}
var _val26 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val26 = v
}
    p.Parameters[_key25] = _val26
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *Partition)  ReadField8(iprot thrift.TProtocol) error {
  p.Privileges = &PrincipalPrivilegeSet{}
  if err := p.Privileges.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Privileges), err)
  }
  return nil
}

func (p *Partition) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Partition"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
    if err := p.writeField8(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Partition) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.Values {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) }
  return err
}

func (p *Partition) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbName", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dbName: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbName (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dbName: ", p), err) }
  return err
}

func (p *Partition) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tableName: ", p), err) }
  if err := oprot.WriteString(string(p.TableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tableName (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tableName: ", p), err) }
  return err
}

func (p *Partition) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("createTime", thrift.I32, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:createTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.CreateTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.createTime (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:createTime: ", p), err) }
  return err
}

func (p *Partition) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("lastAccessTime", thrift.I32, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:lastAccessTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.LastAccessTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.lastAccessTime (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:lastAccessTime: ", p), err) }
  return err
}

func (p *Partition) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sd", thrift.STRUCT, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sd: ", p), err) }
  if err := p.Sd.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Sd), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sd: ", p), err) }
  return err
}

func (p *Partition) writeField7(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 7); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 7:parameters: ", p), err) }
  return err
}

func (p *Partition) writeField8(oprot thrift.TProtocol) (err error) {
  if p.IsSetPrivileges() {
    if err := oprot.WriteFieldBegin("privileges", thrift.STRUCT, 8); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:privileges: ", p), err) }
    if err := p.Privileges.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Privileges), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 8:privileges: ", p), err) }
  }
  return err
}

func (p *Partition) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Partition(%+v)", *p)
}

// Attributes:
//  - IndexName
//  - IndexHandlerClass
//  - DbName
//  - OrigTableName
//  - CreateTime
//  - LastAccessTime
//  - IndexTableName
//  - Sd
//  - Parameters
//  - DeferredRebuild
type Index struct {
  IndexName string `thrift:"indexName,1" db:"indexName" json:"indexName"`
  IndexHandlerClass string `thrift:"indexHandlerClass,2" db:"indexHandlerClass" json:"indexHandlerClass"`
  DbName string `thrift:"dbName,3" db:"dbName" json:"dbName"`
  OrigTableName string `thrift:"origTableName,4" db:"origTableName" json:"origTableName"`
  CreateTime int32 `thrift:"createTime,5" db:"createTime" json:"createTime"`
  LastAccessTime int32 `thrift:"lastAccessTime,6" db:"lastAccessTime" json:"lastAccessTime"`
  IndexTableName string `thrift:"indexTableName,7" db:"indexTableName" json:"indexTableName"`
  Sd *StorageDescriptor `thrift:"sd,8" db:"sd" json:"sd"`
  Parameters map[string]string `thrift:"parameters,9" db:"parameters" json:"parameters"`
  DeferredRebuild bool `thrift:"deferredRebuild,10" db:"deferredRebuild" json:"deferredRebuild"`
}

func NewIndex() *Index {
  return &Index{}
}


func (p *Index) GetIndexName() string {
  return p.IndexName
}

func (p *Index) GetIndexHandlerClass() string {
  return p.IndexHandlerClass
}

func (p *Index) GetDbName() string {
  return p.DbName
}

func (p *Index) GetOrigTableName() string {
  return p.OrigTableName
}

func (p *Index) GetCreateTime() int32 {
  return p.CreateTime
}

func (p *Index) GetLastAccessTime() int32 {
  return p.LastAccessTime
}

func (p *Index) GetIndexTableName() string {
  return p.IndexTableName
}
var Index_Sd_DEFAULT *StorageDescriptor
func (p *Index) GetSd() *StorageDescriptor {
  if !p.IsSetSd() {
    return Index_Sd_DEFAULT
  }
return p.Sd
}

func (p *Index) GetParameters() map[string]string {
  return p.Parameters
}

func (p *Index) GetDeferredRebuild() bool {
  return p.DeferredRebuild
}
func (p *Index) IsSetSd() bool {
  return p.Sd != nil
}

func (p *Index) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 7:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField7(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 8:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField8(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 9:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField9(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 10:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField10(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Index)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.IndexName = v
}
  return nil
}

func (p *Index)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.IndexHandlerClass = v
}
  return nil
}

func (p *Index)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *Index)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.OrigTableName = v
}
  return nil
}

func (p *Index)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.CreateTime = v
}
  return nil
}

func (p *Index)  ReadField6(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 6: ", err)
} else {
  p.LastAccessTime = v
}
  return nil
}

func (p *Index)  ReadField7(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 7: ", err)
} else {
  p.IndexTableName = v
}
  return nil
}

func (p *Index)  ReadField8(iprot thrift.TProtocol) error {
  p.Sd = &StorageDescriptor{}
  if err := p.Sd.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Sd), err)
  }
  return nil
}

func (p *Index)  ReadField9(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Parameters =  tMap
  for i := 0; i < size; i ++ {
var _key27 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key27 = v
}
var _val28 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val28 = v
}
    p.Parameters[_key27] = _val28
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *Index)  ReadField10(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 10: ", err)
} else {
  p.DeferredRebuild = v
}
  return nil
}

func (p *Index) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Index"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
    if err := p.writeField7(oprot); err != nil { return err }
    if err := p.writeField8(oprot); err != nil { return err }
    if err := p.writeField9(oprot); err != nil { return err }
    if err := p.writeField10(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Index) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("indexName", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:indexName: ", p), err) }
  if err := oprot.WriteString(string(p.IndexName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.indexName (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:indexName: ", p), err) }
  return err
}

func (p *Index) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("indexHandlerClass", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:indexHandlerClass: ", p), err) }
  if err := oprot.WriteString(string(p.IndexHandlerClass)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.indexHandlerClass (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:indexHandlerClass: ", p), err) }
  return err
}

func (p *Index) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbName", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dbName: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbName (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dbName: ", p), err) }
  return err
}

func (p *Index) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("origTableName", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:origTableName: ", p), err) }
  if err := oprot.WriteString(string(p.OrigTableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.origTableName (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:origTableName: ", p), err) }
  return err
}

func (p *Index) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("createTime", thrift.I32, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:createTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.CreateTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.createTime (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:createTime: ", p), err) }
  return err
}

func (p *Index) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("lastAccessTime", thrift.I32, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lastAccessTime: ", p), err) }
  if err := oprot.WriteI32(int32(p.LastAccessTime)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.lastAccessTime (6) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lastAccessTime: ", p), err) }
  return err
}

func (p *Index) writeField7(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("indexTableName", thrift.STRING, 7); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:indexTableName: ", p), err) }
  if err := oprot.WriteString(string(p.IndexTableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.indexTableName (7) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 7:indexTableName: ", p), err) }
  return err
}

func (p *Index) writeField8(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("sd", thrift.STRUCT, 8); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:sd: ", p), err) }
  if err := p.Sd.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Sd), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 8:sd: ", p), err) }
  return err
}

func (p *Index) writeField9(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("parameters", thrift.MAP, 9); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:parameters: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Parameters)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Parameters {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 9:parameters: ", p), err) }
  return err
}

func (p *Index) writeField10(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deferredRebuild", thrift.BOOL, 10); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:deferredRebuild: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeferredRebuild)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deferredRebuild (10) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 10:deferredRebuild: ", p), err) }
  return err
}

func (p *Index) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Index(%+v)", *p)
}

// Attributes:
//  - FieldSchemas
//  - Properties
type Schema struct {
  FieldSchemas []*FieldSchema `thrift:"fieldSchemas,1" db:"fieldSchemas" json:"fieldSchemas"`
  Properties map[string]string `thrift:"properties,2" db:"properties" json:"properties"`
}

func NewSchema() *Schema {
  return &Schema{}
}


func (p *Schema) GetFieldSchemas() []*FieldSchema {
  return p.FieldSchemas
}

func (p *Schema) GetProperties() map[string]string {
  return p.Properties
}
func (p *Schema) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *Schema)  ReadField1(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.FieldSchemas =  tSlice
  for i := 0; i < size; i ++ {
    _elem29 := &FieldSchema{}
    if err := _elem29.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err)
    }
    p.FieldSchemas = append(p.FieldSchemas, _elem29)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *Schema)  ReadField2(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Properties =  tMap
  for i := 0; i < size; i ++ {
var _key30 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key30 = v
}
var _val31 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val31 = v
}
    p.Properties[_key30] = _val31
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *Schema) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("Schema"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *Schema) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("fieldSchemas", thrift.LIST, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:fieldSchemas: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRUCT, len(p.FieldSchemas)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.FieldSchemas {
    if err := v.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
    }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fieldSchemas: ", p), err) }
  return err
}

func (p *Schema) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("properties", thrift.MAP, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:properties: ", p), err) }
  if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Properties)); err != nil {
    return thrift.PrependError("error writing map begin: ", err)
  }
  for k, v := range p.Properties {
    if err := oprot.WriteString(string(k)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteMapEnd(); err != nil {
    return thrift.PrependError("error writing map end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) }
  return err
}

func (p *Schema) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("Schema(%+v)", *p)
}

// Attributes:
//  - Message
type MetaException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewMetaException() *MetaException {
  return &MetaException{}
}


func (p *MetaException) GetMessage() string {
  return p.Message
}
func (p *MetaException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *MetaException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *MetaException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("MetaException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *MetaException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *MetaException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("MetaException(%+v)", *p)
}

func (p *MetaException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type UnknownTableException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewUnknownTableException() *UnknownTableException {
  return &UnknownTableException{}
}


func (p *UnknownTableException) GetMessage() string {
  return p.Message
}
func (p *UnknownTableException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *UnknownTableException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *UnknownTableException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("UnknownTableException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *UnknownTableException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *UnknownTableException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("UnknownTableException(%+v)", *p)
}

func (p *UnknownTableException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type UnknownDBException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewUnknownDBException() *UnknownDBException {
  return &UnknownDBException{}
}


func (p *UnknownDBException) GetMessage() string {
  return p.Message
}
func (p *UnknownDBException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *UnknownDBException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *UnknownDBException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("UnknownDBException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *UnknownDBException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *UnknownDBException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("UnknownDBException(%+v)", *p)
}

func (p *UnknownDBException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type AlreadyExistsException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewAlreadyExistsException() *AlreadyExistsException {
  return &AlreadyExistsException{}
}


func (p *AlreadyExistsException) GetMessage() string {
  return p.Message
}
func (p *AlreadyExistsException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *AlreadyExistsException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *AlreadyExistsException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("AlreadyExistsException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *AlreadyExistsException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *AlreadyExistsException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("AlreadyExistsException(%+v)", *p)
}

func (p *AlreadyExistsException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type InvalidObjectException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewInvalidObjectException() *InvalidObjectException {
  return &InvalidObjectException{}
}


func (p *InvalidObjectException) GetMessage() string {
  return p.Message
}
func (p *InvalidObjectException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *InvalidObjectException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *InvalidObjectException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("InvalidObjectException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *InvalidObjectException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *InvalidObjectException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("InvalidObjectException(%+v)", *p)
}

func (p *InvalidObjectException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type NoSuchObjectException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewNoSuchObjectException() *NoSuchObjectException {
  return &NoSuchObjectException{}
}


func (p *NoSuchObjectException) GetMessage() string {
  return p.Message
}
func (p *NoSuchObjectException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *NoSuchObjectException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *NoSuchObjectException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("NoSuchObjectException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *NoSuchObjectException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *NoSuchObjectException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("NoSuchObjectException(%+v)", *p)
}

func (p *NoSuchObjectException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type IndexAlreadyExistsException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewIndexAlreadyExistsException() *IndexAlreadyExistsException {
  return &IndexAlreadyExistsException{}
}


func (p *IndexAlreadyExistsException) GetMessage() string {
  return p.Message
}
func (p *IndexAlreadyExistsException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *IndexAlreadyExistsException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *IndexAlreadyExistsException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("IndexAlreadyExistsException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *IndexAlreadyExistsException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *IndexAlreadyExistsException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("IndexAlreadyExistsException(%+v)", *p)
}

func (p *IndexAlreadyExistsException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type InvalidOperationException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewInvalidOperationException() *InvalidOperationException {
  return &InvalidOperationException{}
}


func (p *InvalidOperationException) GetMessage() string {
  return p.Message
}
func (p *InvalidOperationException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *InvalidOperationException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *InvalidOperationException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("InvalidOperationException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *InvalidOperationException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *InvalidOperationException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("InvalidOperationException(%+v)", *p)
}

func (p *InvalidOperationException) Error() string {
  return p.String()
}

// Attributes:
//  - Message
type ConfigValSecurityException struct {
  Message string `thrift:"message,1" db:"message" json:"message"`
}

func NewConfigValSecurityException() *ConfigValSecurityException {
  return &ConfigValSecurityException{}
}


func (p *ConfigValSecurityException) GetMessage() string {
  return p.Message
}
func (p *ConfigValSecurityException) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ConfigValSecurityException)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Message = v
}
  return nil
}

func (p *ConfigValSecurityException) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("ConfigValSecurityException"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ConfigValSecurityException) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("message", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err) }
  if err := oprot.WriteString(string(p.Message)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err) }
  return err
}

func (p *ConfigValSecurityException) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ConfigValSecurityException(%+v)", *p)
}

func (p *ConfigValSecurityException) Error() string {
  return p.String()
}

type ThriftHiveMetastore interface {
  fb303.FacebookService
  //This interface is live.

  // Parameters:
  //  - Database
  CreateDatabase(ctx context.Context, database *Database) (err error)
  // Parameters:
  //  - Name
  GetDatabase(ctx context.Context, name string) (r *Database, err error)
  // Parameters:
  //  - Name
  //  - DeleteData
  DropDatabase(ctx context.Context, name string, deleteData bool) (err error)
  // Parameters:
  //  - Pattern
  GetDatabases(ctx context.Context, pattern string) (r []string, err error)
  GetAllDatabases(ctx context.Context) (r []string, err error)
  // Parameters:
  //  - Dbname
  //  - Db
  AlterDatabase(ctx context.Context, dbname string, db *Database) (err error)
  // Parameters:
  //  - Name
  GetType(ctx context.Context, name string) (r *Type, err error)
  // Parameters:
  //  - Type
  CreateType(ctx context.Context, type_a1 *Type) (r bool, err error)
  // Parameters:
  //  - Type
  DropType(ctx context.Context, type_a1 string) (r bool, err error)
  // Parameters:
  //  - Name
  GetTypeAll(ctx context.Context, name string) (r map[string]*Type, err error)
  // Parameters:
  //  - DbName
  //  - TableName
  GetFields(ctx context.Context, db_name string, table_name string) (r []*FieldSchema, err error)
  // Parameters:
  //  - DbName
  //  - TableName
  GetSchema(ctx context.Context, db_name string, table_name string) (r []*FieldSchema, err error)
  // Parameters:
  //  - Tbl
  CreateTable(ctx context.Context, tbl *Table) (err error)
  // Parameters:
  //  - Dbname
  //  - Name
  //  - DeleteData
  DropTable(ctx context.Context, dbname string, name string, deleteData bool) (err error)
  // Parameters:
  //  - DbName
  //  - Pattern
  GetTables(ctx context.Context, db_name string, pattern string) (r []string, err error)
  // Parameters:
  //  - DbName
  GetAllTables(ctx context.Context, db_name string) (r []string, err error)
  // Parameters:
  //  - Dbname
  //  - TblName
  GetTable(ctx context.Context, dbname string, tbl_name string) (r *Table, err error)
  // Parameters:
  //  - Dbname
  //  - TblName
  //  - NewTbl_
  AlterTable(ctx context.Context, dbname string, tbl_name string, new_tbl *Table) (err error)
  // Parameters:
  //  - NewPart_
  AddPartition(ctx context.Context, new_part *Partition) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  AppendPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartName
  AppendPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  //  - DeleteData
  DropPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string, deleteData bool) (r bool, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartName
  //  - DeleteData
  DropPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string, deleteData bool) (r bool, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  GetPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  //  - UserName
  //  - GroupNames
  GetPartitionWithAuth(ctx context.Context, db_name string, tbl_name string, part_vals []string, user_name string, group_names []string) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartName
  GetPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string) (r *Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - MaxParts
  GetPartitions(ctx context.Context, db_name string, tbl_name string, max_parts int16) (r []*Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - MaxParts
  //  - UserName
  //  - GroupNames
  GetPartitionsWithAuth(ctx context.Context, db_name string, tbl_name string, max_parts int16, user_name string, group_names []string) (r []*Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - MaxParts
  GetPartitionNames(ctx context.Context, db_name string, tbl_name string, max_parts int16) (r []string, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  //  - MaxParts
  GetPartitionsPs(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16) (r []*Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  //  - MaxParts
  //  - UserName
  //  - GroupNames
  GetPartitionsPsWithAuth(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16, user_name string, group_names []string) (r []*Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - PartVals
  //  - MaxParts
  GetPartitionNamesPs(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16) (r []string, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - Filter
  //  - MaxParts
  GetPartitionsByFilter(ctx context.Context, db_name string, tbl_name string, filter string, max_parts int16) (r []*Partition, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - NewPart_
  AlterPartition(ctx context.Context, db_name string, tbl_name string, new_part *Partition) (err error)
  // Parameters:
  //  - Name
  //  - DefaultValue
  GetConfigValue(ctx context.Context, name string, defaultValue string) (r string, err error)
  // Parameters:
  //  - PartName
  PartitionNameToVals(ctx context.Context, part_name string) (r []string, err error)
  // Parameters:
  //  - PartName
  PartitionNameToSpec(ctx context.Context, part_name string) (r map[string]string, err error)
  // Parameters:
  //  - NewIndex_
  //  - IndexTable
  AddIndex(ctx context.Context, new_index *Index, index_table *Table) (r *Index, err error)
  // Parameters:
  //  - Dbname
  //  - BaseTblName
  //  - IdxName
  //  - NewIdx_
  AlterIndex(ctx context.Context, dbname string, base_tbl_name string, idx_name string, new_idx *Index) (err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - IndexName
  //  - DeleteData
  DropIndexByName(ctx context.Context, db_name string, tbl_name string, index_name string, deleteData bool) (r bool, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - IndexName
  GetIndexByName(ctx context.Context, db_name string, tbl_name string, index_name string) (r *Index, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - MaxIndexes
  GetIndexes(ctx context.Context, db_name string, tbl_name string, max_indexes int16) (r []*Index, err error)
  // Parameters:
  //  - DbName
  //  - TblName
  //  - MaxIndexes
  GetIndexNames(ctx context.Context, db_name string, tbl_name string, max_indexes int16) (r []string, err error)
  // Parameters:
  //  - Role
  CreateRole(ctx context.Context, role *Role) (r bool, err error)
  // Parameters:
  //  - RoleName
  DropRole(ctx context.Context, role_name string) (r bool, err error)
  GetRoleNames(ctx context.Context) (r []string, err error)
  // Parameters:
  //  - RoleName
  //  - PrincipalName
  //  - PrincipalType
  //  - Grantor
  //  - GrantorType
  //  - GrantOption
  GrantRole(ctx context.Context, role_name string, principal_name string, principal_type PrincipalType, grantor string, grantorType PrincipalType, grant_option bool) (r bool, err error)
  // Parameters:
  //  - RoleName
  //  - PrincipalName
  //  - PrincipalType
  RevokeRole(ctx context.Context, role_name string, principal_name string, principal_type PrincipalType) (r bool, err error)
  // Parameters:
  //  - PrincipalName
  //  - PrincipalType
  ListRoles(ctx context.Context, principal_name string, principal_type PrincipalType) (r []*Role, err error)
  // Parameters:
  //  - HiveObject
  //  - UserName
  //  - GroupNames
  GetPrivilegeSet(ctx context.Context, hiveObject *HiveObjectRef, user_name string, group_names []string) (r *PrincipalPrivilegeSet, err error)
  // Parameters:
  //  - PrincipalName
  //  - PrincipalType
  //  - HiveObject
  ListPrivileges(ctx context.Context, principal_name string, principal_type PrincipalType, hiveObject *HiveObjectRef) (r []*HiveObjectPrivilege, err error)
  // Parameters:
  //  - Privileges
  GrantPrivileges(ctx context.Context, privileges *PrivilegeBag) (r bool, err error)
  // Parameters:
  //  - Privileges
  RevokePrivileges(ctx context.Context, privileges *PrivilegeBag) (r bool, err error)
  // Parameters:
  //  - RenewerKerberosPrincipalName
  GetDelegationToken(ctx context.Context, renewer_kerberos_principal_name string) (r string, err error)
  // Parameters:
  //  - RenewerKerberosPrincipalName
  //  - TokenSignature
  GetDelegationTokenWithSignature(ctx context.Context, renewer_kerberos_principal_name string, token_signature string) (r string, err error)
  // Parameters:
  //  - TokenStrForm
  RenewDelegationToken(ctx context.Context, token_str_form string) (r int64, err error)
  // Parameters:
  //  - TokenStrForm
  CancelDelegationToken(ctx context.Context, token_str_form string) (err error)
}

//This interface is live.
type ThriftHiveMetastoreClient struct {
  *fb303.FacebookServiceClient
}

func NewThriftHiveMetastoreClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *ThriftHiveMetastoreClient {
  return &ThriftHiveMetastoreClient{FacebookServiceClient: fb303.NewFacebookServiceClientFactory(t, f)}}

func NewThriftHiveMetastoreClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *ThriftHiveMetastoreClient {
  return &ThriftHiveMetastoreClient{FacebookServiceClient: fb303.NewFacebookServiceClientProtocol(t, iprot, oprot)}
}

func NewThriftHiveMetastoreClient(c thrift.TClient) *ThriftHiveMetastoreClient {
  return &ThriftHiveMetastoreClient{
    FacebookServiceClient: fb303.NewFacebookServiceClient(c),
  }
}

// Parameters:
//  - Database
func (p *ThriftHiveMetastoreClient) CreateDatabase(ctx context.Context, database *Database) (err error) {
  var _args32 ThriftHiveMetastoreCreateDatabaseArgs
  _args32.Database = database
  var _result33 ThriftHiveMetastoreCreateDatabaseResult
  if err = p.Client_().Call(ctx, "create_database", &_args32, &_result33); err != nil {
    return
  }
  switch {
  case _result33.O1!= nil:
    return _result33.O1
  case _result33.O2!= nil:
    return _result33.O2
  case _result33.O3!= nil:
    return _result33.O3
  }

  return nil
}

// Parameters:
//  - Name
func (p *ThriftHiveMetastoreClient) GetDatabase(ctx context.Context, name string) (r *Database, err error) {
  var _args34 ThriftHiveMetastoreGetDatabaseArgs
  _args34.Name = name
  var _result35 ThriftHiveMetastoreGetDatabaseResult
  if err = p.Client_().Call(ctx, "get_database", &_args34, &_result35); err != nil {
    return
  }
  switch {
  case _result35.O1!= nil:
    return r, _result35.O1
  case _result35.O2!= nil:
    return r, _result35.O2
  }

  return _result35.GetSuccess(), nil
}

// Parameters:
//  - Name
//  - DeleteData
func (p *ThriftHiveMetastoreClient) DropDatabase(ctx context.Context, name string, deleteData bool) (err error) {
  var _args36 ThriftHiveMetastoreDropDatabaseArgs
  _args36.Name = name
  _args36.DeleteData = deleteData
  var _result37 ThriftHiveMetastoreDropDatabaseResult
  if err = p.Client_().Call(ctx, "drop_database", &_args36, &_result37); err != nil {
    return
  }
  switch {
  case _result37.O1!= nil:
    return _result37.O1
  case _result37.O2!= nil:
    return _result37.O2
  case _result37.O3!= nil:
    return _result37.O3
  }

  return nil
}

// Parameters:
//  - Pattern
func (p *ThriftHiveMetastoreClient) GetDatabases(ctx context.Context, pattern string) (r []string, err error) {
  var _args38 ThriftHiveMetastoreGetDatabasesArgs
  _args38.Pattern = pattern
  var _result39 ThriftHiveMetastoreGetDatabasesResult
  if err = p.Client_().Call(ctx, "get_databases", &_args38, &_result39); err != nil {
    return
  }
  switch {
  case _result39.O1!= nil:
    return r, _result39.O1
  }

  return _result39.GetSuccess(), nil
}

func (p *ThriftHiveMetastoreClient) GetAllDatabases(ctx context.Context) (r []string, err error) {
  var _args40 ThriftHiveMetastoreGetAllDatabasesArgs
  var _result41 ThriftHiveMetastoreGetAllDatabasesResult
  if err = p.Client_().Call(ctx, "get_all_databases", &_args40, &_result41); err != nil {
    return
  }
  switch {
  case _result41.O1!= nil:
    return r, _result41.O1
  }

  return _result41.GetSuccess(), nil
}

// Parameters:
//  - Dbname
//  - Db
func (p *ThriftHiveMetastoreClient) AlterDatabase(ctx context.Context, dbname string, db *Database) (err error) {
  var _args42 ThriftHiveMetastoreAlterDatabaseArgs
  _args42.Dbname = dbname
  _args42.Db = db
  var _result43 ThriftHiveMetastoreAlterDatabaseResult
  if err = p.Client_().Call(ctx, "alter_database", &_args42, &_result43); err != nil {
    return
  }
  switch {
  case _result43.O1!= nil:
    return _result43.O1
  case _result43.O2!= nil:
    return _result43.O2
  }

  return nil
}

// Parameters:
//  - Name
func (p *ThriftHiveMetastoreClient) GetType(ctx context.Context, name string) (r *Type, err error) {
  var _args44 ThriftHiveMetastoreGetTypeArgs
  _args44.Name = name
  var _result45 ThriftHiveMetastoreGetTypeResult
  if err = p.Client_().Call(ctx, "get_type", &_args44, &_result45); err != nil {
    return
  }
  switch {
  case _result45.O1!= nil:
    return r, _result45.O1
  case _result45.O2!= nil:
    return r, _result45.O2
  }

  return _result45.GetSuccess(), nil
}

// Parameters:
//  - Type
func (p *ThriftHiveMetastoreClient) CreateType(ctx context.Context, type_a1 *Type) (r bool, err error) {
  var _args46 ThriftHiveMetastoreCreateTypeArgs
  _args46.Type = type_a1
  var _result47 ThriftHiveMetastoreCreateTypeResult
  if err = p.Client_().Call(ctx, "create_type", &_args46, &_result47); err != nil {
    return
  }
  switch {
  case _result47.O1!= nil:
    return r, _result47.O1
  case _result47.O2!= nil:
    return r, _result47.O2
  case _result47.O3!= nil:
    return r, _result47.O3
  }

  return _result47.GetSuccess(), nil
}

// Parameters:
//  - Type
func (p *ThriftHiveMetastoreClient) DropType(ctx context.Context, type_a1 string) (r bool, err error) {
  var _args48 ThriftHiveMetastoreDropTypeArgs
  _args48.Type = type_a1
  var _result49 ThriftHiveMetastoreDropTypeResult
  if err = p.Client_().Call(ctx, "drop_type", &_args48, &_result49); err != nil {
    return
  }
  switch {
  case _result49.O1!= nil:
    return r, _result49.O1
  case _result49.O2!= nil:
    return r, _result49.O2
  }

  return _result49.GetSuccess(), nil
}

// Parameters:
//  - Name
func (p *ThriftHiveMetastoreClient) GetTypeAll(ctx context.Context, name string) (r map[string]*Type, err error) {
  var _args50 ThriftHiveMetastoreGetTypeAllArgs
  _args50.Name = name
  var _result51 ThriftHiveMetastoreGetTypeAllResult
  if err = p.Client_().Call(ctx, "get_type_all", &_args50, &_result51); err != nil {
    return
  }
  switch {
  case _result51.O2!= nil:
    return r, _result51.O2
  }

  return _result51.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TableName
func (p *ThriftHiveMetastoreClient) GetFields(ctx context.Context, db_name string, table_name string) (r []*FieldSchema, err error) {
  var _args52 ThriftHiveMetastoreGetFieldsArgs
  _args52.DbName = db_name
  _args52.TableName = table_name
  var _result53 ThriftHiveMetastoreGetFieldsResult
  if err = p.Client_().Call(ctx, "get_fields", &_args52, &_result53); err != nil {
    return
  }
  switch {
  case _result53.O1!= nil:
    return r, _result53.O1
  case _result53.O2!= nil:
    return r, _result53.O2
  case _result53.O3!= nil:
    return r, _result53.O3
  }

  return _result53.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TableName
func (p *ThriftHiveMetastoreClient) GetSchema(ctx context.Context, db_name string, table_name string) (r []*FieldSchema, err error) {
  var _args54 ThriftHiveMetastoreGetSchemaArgs
  _args54.DbName = db_name
  _args54.TableName = table_name
  var _result55 ThriftHiveMetastoreGetSchemaResult
  if err = p.Client_().Call(ctx, "get_schema", &_args54, &_result55); err != nil {
    return
  }
  switch {
  case _result55.O1!= nil:
    return r, _result55.O1
  case _result55.O2!= nil:
    return r, _result55.O2
  case _result55.O3!= nil:
    return r, _result55.O3
  }

  return _result55.GetSuccess(), nil
}

// Parameters:
//  - Tbl
func (p *ThriftHiveMetastoreClient) CreateTable(ctx context.Context, tbl *Table) (err error) {
  var _args56 ThriftHiveMetastoreCreateTableArgs
  _args56.Tbl = tbl
  var _result57 ThriftHiveMetastoreCreateTableResult
  if err = p.Client_().Call(ctx, "create_table", &_args56, &_result57); err != nil {
    return
  }
  switch {
  case _result57.O1!= nil:
    return _result57.O1
  case _result57.O2!= nil:
    return _result57.O2
  case _result57.O3!= nil:
    return _result57.O3
  case _result57.O4!= nil:
    return _result57.O4
  }

  return nil
}

// Parameters:
//  - Dbname
//  - Name
//  - DeleteData
func (p *ThriftHiveMetastoreClient) DropTable(ctx context.Context, dbname string, name string, deleteData bool) (err error) {
  var _args58 ThriftHiveMetastoreDropTableArgs
  _args58.Dbname = dbname
  _args58.Name = name
  _args58.DeleteData = deleteData
  var _result59 ThriftHiveMetastoreDropTableResult
  if err = p.Client_().Call(ctx, "drop_table", &_args58, &_result59); err != nil {
    return
  }
  switch {
  case _result59.O1!= nil:
    return _result59.O1
  case _result59.O3!= nil:
    return _result59.O3
  }

  return nil
}

// Parameters:
//  - DbName
//  - Pattern
func (p *ThriftHiveMetastoreClient) GetTables(ctx context.Context, db_name string, pattern string) (r []string, err error) {
  var _args60 ThriftHiveMetastoreGetTablesArgs
  _args60.DbName = db_name
  _args60.Pattern = pattern
  var _result61 ThriftHiveMetastoreGetTablesResult
  if err = p.Client_().Call(ctx, "get_tables", &_args60, &_result61); err != nil {
    return
  }
  switch {
  case _result61.O1!= nil:
    return r, _result61.O1
  }

  return _result61.GetSuccess(), nil
}

// Parameters:
//  - DbName
func (p *ThriftHiveMetastoreClient) GetAllTables(ctx context.Context, db_name string) (r []string, err error) {
  var _args62 ThriftHiveMetastoreGetAllTablesArgs
  _args62.DbName = db_name
  var _result63 ThriftHiveMetastoreGetAllTablesResult
  if err = p.Client_().Call(ctx, "get_all_tables", &_args62, &_result63); err != nil {
    return
  }
  switch {
  case _result63.O1!= nil:
    return r, _result63.O1
  }

  return _result63.GetSuccess(), nil
}

// Parameters:
//  - Dbname
//  - TblName
func (p *ThriftHiveMetastoreClient) GetTable(ctx context.Context, dbname string, tbl_name string) (r *Table, err error) {
  var _args64 ThriftHiveMetastoreGetTableArgs
  _args64.Dbname = dbname
  _args64.TblName = tbl_name
  var _result65 ThriftHiveMetastoreGetTableResult
  if err = p.Client_().Call(ctx, "get_table", &_args64, &_result65); err != nil {
    return
  }
  switch {
  case _result65.O1!= nil:
    return r, _result65.O1
  case _result65.O2!= nil:
    return r, _result65.O2
  }

  return _result65.GetSuccess(), nil
}

// Parameters:
//  - Dbname
//  - TblName
//  - NewTbl_
func (p *ThriftHiveMetastoreClient) AlterTable(ctx context.Context, dbname string, tbl_name string, new_tbl *Table) (err error) {
  var _args66 ThriftHiveMetastoreAlterTableArgs
  _args66.Dbname = dbname
  _args66.TblName = tbl_name
  _args66.NewTbl_ = new_tbl
  var _result67 ThriftHiveMetastoreAlterTableResult
  if err = p.Client_().Call(ctx, "alter_table", &_args66, &_result67); err != nil {
    return
  }
  switch {
  case _result67.O1!= nil:
    return _result67.O1
  case _result67.O2!= nil:
    return _result67.O2
  }

  return nil
}

// Parameters:
//  - NewPart_
func (p *ThriftHiveMetastoreClient) AddPartition(ctx context.Context, new_part *Partition) (r *Partition, err error) {
  var _args68 ThriftHiveMetastoreAddPartitionArgs
  _args68.NewPart_ = new_part
  var _result69 ThriftHiveMetastoreAddPartitionResult
  if err = p.Client_().Call(ctx, "add_partition", &_args68, &_result69); err != nil {
    return
  }
  switch {
  case _result69.O1!= nil:
    return r, _result69.O1
  case _result69.O2!= nil:
    return r, _result69.O2
  case _result69.O3!= nil:
    return r, _result69.O3
  }

  return _result69.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
func (p *ThriftHiveMetastoreClient) AppendPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string) (r *Partition, err error) {
  var _args70 ThriftHiveMetastoreAppendPartitionArgs
  _args70.DbName = db_name
  _args70.TblName = tbl_name
  _args70.PartVals = part_vals
  var _result71 ThriftHiveMetastoreAppendPartitionResult
  if err = p.Client_().Call(ctx, "append_partition", &_args70, &_result71); err != nil {
    return
  }
  switch {
  case _result71.O1!= nil:
    return r, _result71.O1
  case _result71.O2!= nil:
    return r, _result71.O2
  case _result71.O3!= nil:
    return r, _result71.O3
  }

  return _result71.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartName
func (p *ThriftHiveMetastoreClient) AppendPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string) (r *Partition, err error) {
  var _args72 ThriftHiveMetastoreAppendPartitionByNameArgs
  _args72.DbName = db_name
  _args72.TblName = tbl_name
  _args72.PartName = part_name
  var _result73 ThriftHiveMetastoreAppendPartitionByNameResult
  if err = p.Client_().Call(ctx, "append_partition_by_name", &_args72, &_result73); err != nil {
    return
  }
  switch {
  case _result73.O1!= nil:
    return r, _result73.O1
  case _result73.O2!= nil:
    return r, _result73.O2
  case _result73.O3!= nil:
    return r, _result73.O3
  }

  return _result73.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
//  - DeleteData
func (p *ThriftHiveMetastoreClient) DropPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string, deleteData bool) (r bool, err error) {
  var _args74 ThriftHiveMetastoreDropPartitionArgs
  _args74.DbName = db_name
  _args74.TblName = tbl_name
  _args74.PartVals = part_vals
  _args74.DeleteData = deleteData
  var _result75 ThriftHiveMetastoreDropPartitionResult
  if err = p.Client_().Call(ctx, "drop_partition", &_args74, &_result75); err != nil {
    return
  }
  switch {
  case _result75.O1!= nil:
    return r, _result75.O1
  case _result75.O2!= nil:
    return r, _result75.O2
  }

  return _result75.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartName
//  - DeleteData
func (p *ThriftHiveMetastoreClient) DropPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string, deleteData bool) (r bool, err error) {
  var _args76 ThriftHiveMetastoreDropPartitionByNameArgs
  _args76.DbName = db_name
  _args76.TblName = tbl_name
  _args76.PartName = part_name
  _args76.DeleteData = deleteData
  var _result77 ThriftHiveMetastoreDropPartitionByNameResult
  if err = p.Client_().Call(ctx, "drop_partition_by_name", &_args76, &_result77); err != nil {
    return
  }
  switch {
  case _result77.O1!= nil:
    return r, _result77.O1
  case _result77.O2!= nil:
    return r, _result77.O2
  }

  return _result77.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
func (p *ThriftHiveMetastoreClient) GetPartition(ctx context.Context, db_name string, tbl_name string, part_vals []string) (r *Partition, err error) {
  var _args78 ThriftHiveMetastoreGetPartitionArgs
  _args78.DbName = db_name
  _args78.TblName = tbl_name
  _args78.PartVals = part_vals
  var _result79 ThriftHiveMetastoreGetPartitionResult
  if err = p.Client_().Call(ctx, "get_partition", &_args78, &_result79); err != nil {
    return
  }
  switch {
  case _result79.O1!= nil:
    return r, _result79.O1
  case _result79.O2!= nil:
    return r, _result79.O2
  }

  return _result79.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
//  - UserName
//  - GroupNames
func (p *ThriftHiveMetastoreClient) GetPartitionWithAuth(ctx context.Context, db_name string, tbl_name string, part_vals []string, user_name string, group_names []string) (r *Partition, err error) {
  var _args80 ThriftHiveMetastoreGetPartitionWithAuthArgs
  _args80.DbName = db_name
  _args80.TblName = tbl_name
  _args80.PartVals = part_vals
  _args80.UserName = user_name
  _args80.GroupNames = group_names
  var _result81 ThriftHiveMetastoreGetPartitionWithAuthResult
  if err = p.Client_().Call(ctx, "get_partition_with_auth", &_args80, &_result81); err != nil {
    return
  }
  switch {
  case _result81.O1!= nil:
    return r, _result81.O1
  case _result81.O2!= nil:
    return r, _result81.O2
  }

  return _result81.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartName
func (p *ThriftHiveMetastoreClient) GetPartitionByName(ctx context.Context, db_name string, tbl_name string, part_name string) (r *Partition, err error) {
  var _args82 ThriftHiveMetastoreGetPartitionByNameArgs
  _args82.DbName = db_name
  _args82.TblName = tbl_name
  _args82.PartName = part_name
  var _result83 ThriftHiveMetastoreGetPartitionByNameResult
  if err = p.Client_().Call(ctx, "get_partition_by_name", &_args82, &_result83); err != nil {
    return
  }
  switch {
  case _result83.O1!= nil:
    return r, _result83.O1
  case _result83.O2!= nil:
    return r, _result83.O2
  }

  return _result83.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - MaxParts
func (p *ThriftHiveMetastoreClient) GetPartitions(ctx context.Context, db_name string, tbl_name string, max_parts int16) (r []*Partition, err error) {
  var _args84 ThriftHiveMetastoreGetPartitionsArgs
  _args84.DbName = db_name
  _args84.TblName = tbl_name
  _args84.MaxParts = max_parts
  var _result85 ThriftHiveMetastoreGetPartitionsResult
  if err = p.Client_().Call(ctx, "get_partitions", &_args84, &_result85); err != nil {
    return
  }
  switch {
  case _result85.O1!= nil:
    return r, _result85.O1
  case _result85.O2!= nil:
    return r, _result85.O2
  }

  return _result85.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - MaxParts
//  - UserName
//  - GroupNames
func (p *ThriftHiveMetastoreClient) GetPartitionsWithAuth(ctx context.Context, db_name string, tbl_name string, max_parts int16, user_name string, group_names []string) (r []*Partition, err error) {
  var _args86 ThriftHiveMetastoreGetPartitionsWithAuthArgs
  _args86.DbName = db_name
  _args86.TblName = tbl_name
  _args86.MaxParts = max_parts
  _args86.UserName = user_name
  _args86.GroupNames = group_names
  var _result87 ThriftHiveMetastoreGetPartitionsWithAuthResult
  if err = p.Client_().Call(ctx, "get_partitions_with_auth", &_args86, &_result87); err != nil {
    return
  }
  switch {
  case _result87.O1!= nil:
    return r, _result87.O1
  case _result87.O2!= nil:
    return r, _result87.O2
  }

  return _result87.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - MaxParts
func (p *ThriftHiveMetastoreClient) GetPartitionNames(ctx context.Context, db_name string, tbl_name string, max_parts int16) (r []string, err error) {
  var _args88 ThriftHiveMetastoreGetPartitionNamesArgs
  _args88.DbName = db_name
  _args88.TblName = tbl_name
  _args88.MaxParts = max_parts
  var _result89 ThriftHiveMetastoreGetPartitionNamesResult
  if err = p.Client_().Call(ctx, "get_partition_names", &_args88, &_result89); err != nil {
    return
  }
  switch {
  case _result89.O2!= nil:
    return r, _result89.O2
  }

  return _result89.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
func (p *ThriftHiveMetastoreClient) GetPartitionsPs(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16) (r []*Partition, err error) {
  var _args90 ThriftHiveMetastoreGetPartitionsPsArgs
  _args90.DbName = db_name
  _args90.TblName = tbl_name
  _args90.PartVals = part_vals
  _args90.MaxParts = max_parts
  var _result91 ThriftHiveMetastoreGetPartitionsPsResult
  if err = p.Client_().Call(ctx, "get_partitions_ps", &_args90, &_result91); err != nil {
    return
  }
  switch {
  case _result91.O1!= nil:
    return r, _result91.O1
  }

  return _result91.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
//  - UserName
//  - GroupNames
func (p *ThriftHiveMetastoreClient) GetPartitionsPsWithAuth(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16, user_name string, group_names []string) (r []*Partition, err error) {
  var _args92 ThriftHiveMetastoreGetPartitionsPsWithAuthArgs
  _args92.DbName = db_name
  _args92.TblName = tbl_name
  _args92.PartVals = part_vals
  _args92.MaxParts = max_parts
  _args92.UserName = user_name
  _args92.GroupNames = group_names
  var _result93 ThriftHiveMetastoreGetPartitionsPsWithAuthResult
  if err = p.Client_().Call(ctx, "get_partitions_ps_with_auth", &_args92, &_result93); err != nil {
    return
  }
  switch {
  case _result93.O1!= nil:
    return r, _result93.O1
  case _result93.O2!= nil:
    return r, _result93.O2
  }

  return _result93.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
func (p *ThriftHiveMetastoreClient) GetPartitionNamesPs(ctx context.Context, db_name string, tbl_name string, part_vals []string, max_parts int16) (r []string, err error) {
  var _args94 ThriftHiveMetastoreGetPartitionNamesPsArgs
  _args94.DbName = db_name
  _args94.TblName = tbl_name
  _args94.PartVals = part_vals
  _args94.MaxParts = max_parts
  var _result95 ThriftHiveMetastoreGetPartitionNamesPsResult
  if err = p.Client_().Call(ctx, "get_partition_names_ps", &_args94, &_result95); err != nil {
    return
  }
  switch {
  case _result95.O1!= nil:
    return r, _result95.O1
  }

  return _result95.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - Filter
//  - MaxParts
func (p *ThriftHiveMetastoreClient) GetPartitionsByFilter(ctx context.Context, db_name string, tbl_name string, filter string, max_parts int16) (r []*Partition, err error) {
  var _args96 ThriftHiveMetastoreGetPartitionsByFilterArgs
  _args96.DbName = db_name
  _args96.TblName = tbl_name
  _args96.Filter = filter
  _args96.MaxParts = max_parts
  var _result97 ThriftHiveMetastoreGetPartitionsByFilterResult
  if err = p.Client_().Call(ctx, "get_partitions_by_filter", &_args96, &_result97); err != nil {
    return
  }
  switch {
  case _result97.O1!= nil:
    return r, _result97.O1
  case _result97.O2!= nil:
    return r, _result97.O2
  }

  return _result97.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - NewPart_
func (p *ThriftHiveMetastoreClient) AlterPartition(ctx context.Context, db_name string, tbl_name string, new_part *Partition) (err error) {
  var _args98 ThriftHiveMetastoreAlterPartitionArgs
  _args98.DbName = db_name
  _args98.TblName = tbl_name
  _args98.NewPart_ = new_part
  var _result99 ThriftHiveMetastoreAlterPartitionResult
  if err = p.Client_().Call(ctx, "alter_partition", &_args98, &_result99); err != nil {
    return
  }
  switch {
  case _result99.O1!= nil:
    return _result99.O1
  case _result99.O2!= nil:
    return _result99.O2
  }

  return nil
}

// Parameters:
//  - Name
//  - DefaultValue
func (p *ThriftHiveMetastoreClient) GetConfigValue(ctx context.Context, name string, defaultValue string) (r string, err error) {
  var _args100 ThriftHiveMetastoreGetConfigValueArgs
  _args100.Name = name
  _args100.DefaultValue = defaultValue
  var _result101 ThriftHiveMetastoreGetConfigValueResult
  if err = p.Client_().Call(ctx, "get_config_value", &_args100, &_result101); err != nil {
    return
  }
  switch {
  case _result101.O1!= nil:
    return r, _result101.O1
  }

  return _result101.GetSuccess(), nil
}

// Parameters:
//  - PartName
func (p *ThriftHiveMetastoreClient) PartitionNameToVals(ctx context.Context, part_name string) (r []string, err error) {
  var _args102 ThriftHiveMetastorePartitionNameToValsArgs
  _args102.PartName = part_name
  var _result103 ThriftHiveMetastorePartitionNameToValsResult
  if err = p.Client_().Call(ctx, "partition_name_to_vals", &_args102, &_result103); err != nil {
    return
  }
  switch {
  case _result103.O1!= nil:
    return r, _result103.O1
  }

  return _result103.GetSuccess(), nil
}

// Parameters:
//  - PartName
func (p *ThriftHiveMetastoreClient) PartitionNameToSpec(ctx context.Context, part_name string) (r map[string]string, err error) {
  var _args104 ThriftHiveMetastorePartitionNameToSpecArgs
  _args104.PartName = part_name
  var _result105 ThriftHiveMetastorePartitionNameToSpecResult
  if err = p.Client_().Call(ctx, "partition_name_to_spec", &_args104, &_result105); err != nil {
    return
  }
  switch {
  case _result105.O1!= nil:
    return r, _result105.O1
  }

  return _result105.GetSuccess(), nil
}

// Parameters:
//  - NewIndex_
//  - IndexTable
func (p *ThriftHiveMetastoreClient) AddIndex(ctx context.Context, new_index *Index, index_table *Table) (r *Index, err error) {
  var _args106 ThriftHiveMetastoreAddIndexArgs
  _args106.NewIndex_ = new_index
  _args106.IndexTable = index_table
  var _result107 ThriftHiveMetastoreAddIndexResult
  if err = p.Client_().Call(ctx, "add_index", &_args106, &_result107); err != nil {
    return
  }
  switch {
  case _result107.O1!= nil:
    return r, _result107.O1
  case _result107.O2!= nil:
    return r, _result107.O2
  case _result107.O3!= nil:
    return r, _result107.O3
  }

  return _result107.GetSuccess(), nil
}

// Parameters:
//  - Dbname
//  - BaseTblName
//  - IdxName
//  - NewIdx_
func (p *ThriftHiveMetastoreClient) AlterIndex(ctx context.Context, dbname string, base_tbl_name string, idx_name string, new_idx *Index) (err error) {
  var _args108 ThriftHiveMetastoreAlterIndexArgs
  _args108.Dbname = dbname
  _args108.BaseTblName = base_tbl_name
  _args108.IdxName = idx_name
  _args108.NewIdx_ = new_idx
  var _result109 ThriftHiveMetastoreAlterIndexResult
  if err = p.Client_().Call(ctx, "alter_index", &_args108, &_result109); err != nil {
    return
  }
  switch {
  case _result109.O1!= nil:
    return _result109.O1
  case _result109.O2!= nil:
    return _result109.O2
  }

  return nil
}

// Parameters:
//  - DbName
//  - TblName
//  - IndexName
//  - DeleteData
func (p *ThriftHiveMetastoreClient) DropIndexByName(ctx context.Context, db_name string, tbl_name string, index_name string, deleteData bool) (r bool, err error) {
  var _args110 ThriftHiveMetastoreDropIndexByNameArgs
  _args110.DbName = db_name
  _args110.TblName = tbl_name
  _args110.IndexName = index_name
  _args110.DeleteData = deleteData
  var _result111 ThriftHiveMetastoreDropIndexByNameResult
  if err = p.Client_().Call(ctx, "drop_index_by_name", &_args110, &_result111); err != nil {
    return
  }
  switch {
  case _result111.O1!= nil:
    return r, _result111.O1
  case _result111.O2!= nil:
    return r, _result111.O2
  }

  return _result111.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - IndexName
func (p *ThriftHiveMetastoreClient) GetIndexByName(ctx context.Context, db_name string, tbl_name string, index_name string) (r *Index, err error) {
  var _args112 ThriftHiveMetastoreGetIndexByNameArgs
  _args112.DbName = db_name
  _args112.TblName = tbl_name
  _args112.IndexName = index_name
  var _result113 ThriftHiveMetastoreGetIndexByNameResult
  if err = p.Client_().Call(ctx, "get_index_by_name", &_args112, &_result113); err != nil {
    return
  }
  switch {
  case _result113.O1!= nil:
    return r, _result113.O1
  case _result113.O2!= nil:
    return r, _result113.O2
  }

  return _result113.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - MaxIndexes
func (p *ThriftHiveMetastoreClient) GetIndexes(ctx context.Context, db_name string, tbl_name string, max_indexes int16) (r []*Index, err error) {
  var _args114 ThriftHiveMetastoreGetIndexesArgs
  _args114.DbName = db_name
  _args114.TblName = tbl_name
  _args114.MaxIndexes = max_indexes
  var _result115 ThriftHiveMetastoreGetIndexesResult
  if err = p.Client_().Call(ctx, "get_indexes", &_args114, &_result115); err != nil {
    return
  }
  switch {
  case _result115.O1!= nil:
    return r, _result115.O1
  case _result115.O2!= nil:
    return r, _result115.O2
  }

  return _result115.GetSuccess(), nil
}

// Parameters:
//  - DbName
//  - TblName
//  - MaxIndexes
func (p *ThriftHiveMetastoreClient) GetIndexNames(ctx context.Context, db_name string, tbl_name string, max_indexes int16) (r []string, err error) {
  var _args116 ThriftHiveMetastoreGetIndexNamesArgs
  _args116.DbName = db_name
  _args116.TblName = tbl_name
  _args116.MaxIndexes = max_indexes
  var _result117 ThriftHiveMetastoreGetIndexNamesResult
  if err = p.Client_().Call(ctx, "get_index_names", &_args116, &_result117); err != nil {
    return
  }
  switch {
  case _result117.O2!= nil:
    return r, _result117.O2
  }

  return _result117.GetSuccess(), nil
}

// Parameters:
//  - Role
func (p *ThriftHiveMetastoreClient) CreateRole(ctx context.Context, role *Role) (r bool, err error) {
  var _args118 ThriftHiveMetastoreCreateRoleArgs
  _args118.Role = role
  var _result119 ThriftHiveMetastoreCreateRoleResult
  if err = p.Client_().Call(ctx, "create_role", &_args118, &_result119); err != nil {
    return
  }
  switch {
  case _result119.O1!= nil:
    return r, _result119.O1
  }

  return _result119.GetSuccess(), nil
}

// Parameters:
//  - RoleName
func (p *ThriftHiveMetastoreClient) DropRole(ctx context.Context, role_name string) (r bool, err error) {
  var _args120 ThriftHiveMetastoreDropRoleArgs
  _args120.RoleName = role_name
  var _result121 ThriftHiveMetastoreDropRoleResult
  if err = p.Client_().Call(ctx, "drop_role", &_args120, &_result121); err != nil {
    return
  }
  switch {
  case _result121.O1!= nil:
    return r, _result121.O1
  }

  return _result121.GetSuccess(), nil
}

func (p *ThriftHiveMetastoreClient) GetRoleNames(ctx context.Context) (r []string, err error) {
  var _args122 ThriftHiveMetastoreGetRoleNamesArgs
  var _result123 ThriftHiveMetastoreGetRoleNamesResult
  if err = p.Client_().Call(ctx, "get_role_names", &_args122, &_result123); err != nil {
    return
  }
  switch {
  case _result123.O1!= nil:
    return r, _result123.O1
  }

  return _result123.GetSuccess(), nil
}

// Parameters:
//  - RoleName
//  - PrincipalName
//  - PrincipalType
//  - Grantor
//  - GrantorType
//  - GrantOption
func (p *ThriftHiveMetastoreClient) GrantRole(ctx context.Context, role_name string, principal_name string, principal_type PrincipalType, grantor string, grantorType PrincipalType, grant_option bool) (r bool, err error) {
  var _args124 ThriftHiveMetastoreGrantRoleArgs
  _args124.RoleName = role_name
  _args124.PrincipalName = principal_name
  _args124.PrincipalType = principal_type
  _args124.Grantor = grantor
  _args124.GrantorType = grantorType
  _args124.GrantOption = grant_option
  var _result125 ThriftHiveMetastoreGrantRoleResult
  if err = p.Client_().Call(ctx, "grant_role", &_args124, &_result125); err != nil {
    return
  }
  switch {
  case _result125.O1!= nil:
    return r, _result125.O1
  }

  return _result125.GetSuccess(), nil
}

// Parameters:
//  - RoleName
//  - PrincipalName
//  - PrincipalType
func (p *ThriftHiveMetastoreClient) RevokeRole(ctx context.Context, role_name string, principal_name string, principal_type PrincipalType) (r bool, err error) {
  var _args126 ThriftHiveMetastoreRevokeRoleArgs
  _args126.RoleName = role_name
  _args126.PrincipalName = principal_name
  _args126.PrincipalType = principal_type
  var _result127 ThriftHiveMetastoreRevokeRoleResult
  if err = p.Client_().Call(ctx, "revoke_role", &_args126, &_result127); err != nil {
    return
  }
  switch {
  case _result127.O1!= nil:
    return r, _result127.O1
  }

  return _result127.GetSuccess(), nil
}

// Parameters:
//  - PrincipalName
//  - PrincipalType
func (p *ThriftHiveMetastoreClient) ListRoles(ctx context.Context, principal_name string, principal_type PrincipalType) (r []*Role, err error) {
  var _args128 ThriftHiveMetastoreListRolesArgs
  _args128.PrincipalName = principal_name
  _args128.PrincipalType = principal_type
  var _result129 ThriftHiveMetastoreListRolesResult
  if err = p.Client_().Call(ctx, "list_roles", &_args128, &_result129); err != nil {
    return
  }
  switch {
  case _result129.O1!= nil:
    return r, _result129.O1
  }

  return _result129.GetSuccess(), nil
}

// Parameters:
//  - HiveObject
//  - UserName
//  - GroupNames
func (p *ThriftHiveMetastoreClient) GetPrivilegeSet(ctx context.Context, hiveObject *HiveObjectRef, user_name string, group_names []string) (r *PrincipalPrivilegeSet, err error) {
  var _args130 ThriftHiveMetastoreGetPrivilegeSetArgs
  _args130.HiveObject = hiveObject
  _args130.UserName = user_name
  _args130.GroupNames = group_names
  var _result131 ThriftHiveMetastoreGetPrivilegeSetResult
  if err = p.Client_().Call(ctx, "get_privilege_set", &_args130, &_result131); err != nil {
    return
  }
  switch {
  case _result131.O1!= nil:
    return r, _result131.O1
  }

  return _result131.GetSuccess(), nil
}

// Parameters:
//  - PrincipalName
//  - PrincipalType
//  - HiveObject
func (p *ThriftHiveMetastoreClient) ListPrivileges(ctx context.Context, principal_name string, principal_type PrincipalType, hiveObject *HiveObjectRef) (r []*HiveObjectPrivilege, err error) {
  var _args132 ThriftHiveMetastoreListPrivilegesArgs
  _args132.PrincipalName = principal_name
  _args132.PrincipalType = principal_type
  _args132.HiveObject = hiveObject
  var _result133 ThriftHiveMetastoreListPrivilegesResult
  if err = p.Client_().Call(ctx, "list_privileges", &_args132, &_result133); err != nil {
    return
  }
  switch {
  case _result133.O1!= nil:
    return r, _result133.O1
  }

  return _result133.GetSuccess(), nil
}

// Parameters:
//  - Privileges
func (p *ThriftHiveMetastoreClient) GrantPrivileges(ctx context.Context, privileges *PrivilegeBag) (r bool, err error) {
  var _args134 ThriftHiveMetastoreGrantPrivilegesArgs
  _args134.Privileges = privileges
  var _result135 ThriftHiveMetastoreGrantPrivilegesResult
  if err = p.Client_().Call(ctx, "grant_privileges", &_args134, &_result135); err != nil {
    return
  }
  switch {
  case _result135.O1!= nil:
    return r, _result135.O1
  }

  return _result135.GetSuccess(), nil
}

// Parameters:
//  - Privileges
func (p *ThriftHiveMetastoreClient) RevokePrivileges(ctx context.Context, privileges *PrivilegeBag) (r bool, err error) {
  var _args136 ThriftHiveMetastoreRevokePrivilegesArgs
  _args136.Privileges = privileges
  var _result137 ThriftHiveMetastoreRevokePrivilegesResult
  if err = p.Client_().Call(ctx, "revoke_privileges", &_args136, &_result137); err != nil {
    return
  }
  switch {
  case _result137.O1!= nil:
    return r, _result137.O1
  }

  return _result137.GetSuccess(), nil
}

// Parameters:
//  - RenewerKerberosPrincipalName
func (p *ThriftHiveMetastoreClient) GetDelegationToken(ctx context.Context, renewer_kerberos_principal_name string) (r string, err error) {
  var _args138 ThriftHiveMetastoreGetDelegationTokenArgs
  _args138.RenewerKerberosPrincipalName = renewer_kerberos_principal_name
  var _result139 ThriftHiveMetastoreGetDelegationTokenResult
  if err = p.Client_().Call(ctx, "get_delegation_token", &_args138, &_result139); err != nil {
    return
  }
  switch {
  case _result139.O1!= nil:
    return r, _result139.O1
  }

  return _result139.GetSuccess(), nil
}

// Parameters:
//  - RenewerKerberosPrincipalName
//  - TokenSignature
func (p *ThriftHiveMetastoreClient) GetDelegationTokenWithSignature(ctx context.Context, renewer_kerberos_principal_name string, token_signature string) (r string, err error) {
  var _args140 ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs
  _args140.RenewerKerberosPrincipalName = renewer_kerberos_principal_name
  _args140.TokenSignature = token_signature
  var _result141 ThriftHiveMetastoreGetDelegationTokenWithSignatureResult
  if err = p.Client_().Call(ctx, "get_delegation_token_with_signature", &_args140, &_result141); err != nil {
    return
  }
  switch {
  case _result141.O1!= nil:
    return r, _result141.O1
  }

  return _result141.GetSuccess(), nil
}

// Parameters:
//  - TokenStrForm
func (p *ThriftHiveMetastoreClient) RenewDelegationToken(ctx context.Context, token_str_form string) (r int64, err error) {
  var _args142 ThriftHiveMetastoreRenewDelegationTokenArgs
  _args142.TokenStrForm = token_str_form
  var _result143 ThriftHiveMetastoreRenewDelegationTokenResult
  if err = p.Client_().Call(ctx, "renew_delegation_token", &_args142, &_result143); err != nil {
    return
  }
  switch {
  case _result143.O1!= nil:
    return r, _result143.O1
  }

  return _result143.GetSuccess(), nil
}

// Parameters:
//  - TokenStrForm
func (p *ThriftHiveMetastoreClient) CancelDelegationToken(ctx context.Context, token_str_form string) (err error) {
  var _args144 ThriftHiveMetastoreCancelDelegationTokenArgs
  _args144.TokenStrForm = token_str_form
  var _result145 ThriftHiveMetastoreCancelDelegationTokenResult
  if err = p.Client_().Call(ctx, "cancel_delegation_token", &_args144, &_result145); err != nil {
    return
  }
  switch {
  case _result145.O1!= nil:
    return _result145.O1
  }

  return nil
}

type ThriftHiveMetastoreProcessor struct {
  *fb303.FacebookServiceProcessor
}

func NewThriftHiveMetastoreProcessor(handler ThriftHiveMetastore) *ThriftHiveMetastoreProcessor {
  self146 := &ThriftHiveMetastoreProcessor{fb303.NewFacebookServiceProcessor(handler)}
  self146.AddToProcessorMap("create_database", &thriftHiveMetastoreProcessorCreateDatabase{handler:handler})
  self146.AddToProcessorMap("get_database", &thriftHiveMetastoreProcessorGetDatabase{handler:handler})
  self146.AddToProcessorMap("drop_database", &thriftHiveMetastoreProcessorDropDatabase{handler:handler})
  self146.AddToProcessorMap("get_databases", &thriftHiveMetastoreProcessorGetDatabases{handler:handler})
  self146.AddToProcessorMap("get_all_databases", &thriftHiveMetastoreProcessorGetAllDatabases{handler:handler})
  self146.AddToProcessorMap("alter_database", &thriftHiveMetastoreProcessorAlterDatabase{handler:handler})
  self146.AddToProcessorMap("get_type", &thriftHiveMetastoreProcessorGetType{handler:handler})
  self146.AddToProcessorMap("create_type", &thriftHiveMetastoreProcessorCreateType{handler:handler})
  self146.AddToProcessorMap("drop_type", &thriftHiveMetastoreProcessorDropType{handler:handler})
  self146.AddToProcessorMap("get_type_all", &thriftHiveMetastoreProcessorGetTypeAll{handler:handler})
  self146.AddToProcessorMap("get_fields", &thriftHiveMetastoreProcessorGetFields{handler:handler})
  self146.AddToProcessorMap("get_schema", &thriftHiveMetastoreProcessorGetSchema{handler:handler})
  self146.AddToProcessorMap("create_table", &thriftHiveMetastoreProcessorCreateTable{handler:handler})
  self146.AddToProcessorMap("drop_table", &thriftHiveMetastoreProcessorDropTable{handler:handler})
  self146.AddToProcessorMap("get_tables", &thriftHiveMetastoreProcessorGetTables{handler:handler})
  self146.AddToProcessorMap("get_all_tables", &thriftHiveMetastoreProcessorGetAllTables{handler:handler})
  self146.AddToProcessorMap("get_table", &thriftHiveMetastoreProcessorGetTable{handler:handler})
  self146.AddToProcessorMap("alter_table", &thriftHiveMetastoreProcessorAlterTable{handler:handler})
  self146.AddToProcessorMap("add_partition", &thriftHiveMetastoreProcessorAddPartition{handler:handler})
  self146.AddToProcessorMap("append_partition", &thriftHiveMetastoreProcessorAppendPartition{handler:handler})
  self146.AddToProcessorMap("append_partition_by_name", &thriftHiveMetastoreProcessorAppendPartitionByName{handler:handler})
  self146.AddToProcessorMap("drop_partition", &thriftHiveMetastoreProcessorDropPartition{handler:handler})
  self146.AddToProcessorMap("drop_partition_by_name", &thriftHiveMetastoreProcessorDropPartitionByName{handler:handler})
  self146.AddToProcessorMap("get_partition", &thriftHiveMetastoreProcessorGetPartition{handler:handler})
  self146.AddToProcessorMap("get_partition_with_auth", &thriftHiveMetastoreProcessorGetPartitionWithAuth{handler:handler})
  self146.AddToProcessorMap("get_partition_by_name", &thriftHiveMetastoreProcessorGetPartitionByName{handler:handler})
  self146.AddToProcessorMap("get_partitions", &thriftHiveMetastoreProcessorGetPartitions{handler:handler})
  self146.AddToProcessorMap("get_partitions_with_auth", &thriftHiveMetastoreProcessorGetPartitionsWithAuth{handler:handler})
  self146.AddToProcessorMap("get_partition_names", &thriftHiveMetastoreProcessorGetPartitionNames{handler:handler})
  self146.AddToProcessorMap("get_partitions_ps", &thriftHiveMetastoreProcessorGetPartitionsPs{handler:handler})
  self146.AddToProcessorMap("get_partitions_ps_with_auth", &thriftHiveMetastoreProcessorGetPartitionsPsWithAuth{handler:handler})
  self146.AddToProcessorMap("get_partition_names_ps", &thriftHiveMetastoreProcessorGetPartitionNamesPs{handler:handler})
  self146.AddToProcessorMap("get_partitions_by_filter", &thriftHiveMetastoreProcessorGetPartitionsByFilter{handler:handler})
  self146.AddToProcessorMap("alter_partition", &thriftHiveMetastoreProcessorAlterPartition{handler:handler})
  self146.AddToProcessorMap("get_config_value", &thriftHiveMetastoreProcessorGetConfigValue{handler:handler})
  self146.AddToProcessorMap("partition_name_to_vals", &thriftHiveMetastoreProcessorPartitionNameToVals{handler:handler})
  self146.AddToProcessorMap("partition_name_to_spec", &thriftHiveMetastoreProcessorPartitionNameToSpec{handler:handler})
  self146.AddToProcessorMap("add_index", &thriftHiveMetastoreProcessorAddIndex{handler:handler})
  self146.AddToProcessorMap("alter_index", &thriftHiveMetastoreProcessorAlterIndex{handler:handler})
  self146.AddToProcessorMap("drop_index_by_name", &thriftHiveMetastoreProcessorDropIndexByName{handler:handler})
  self146.AddToProcessorMap("get_index_by_name", &thriftHiveMetastoreProcessorGetIndexByName{handler:handler})
  self146.AddToProcessorMap("get_indexes", &thriftHiveMetastoreProcessorGetIndexes{handler:handler})
  self146.AddToProcessorMap("get_index_names", &thriftHiveMetastoreProcessorGetIndexNames{handler:handler})
  self146.AddToProcessorMap("create_role", &thriftHiveMetastoreProcessorCreateRole{handler:handler})
  self146.AddToProcessorMap("drop_role", &thriftHiveMetastoreProcessorDropRole{handler:handler})
  self146.AddToProcessorMap("get_role_names", &thriftHiveMetastoreProcessorGetRoleNames{handler:handler})
  self146.AddToProcessorMap("grant_role", &thriftHiveMetastoreProcessorGrantRole{handler:handler})
  self146.AddToProcessorMap("revoke_role", &thriftHiveMetastoreProcessorRevokeRole{handler:handler})
  self146.AddToProcessorMap("list_roles", &thriftHiveMetastoreProcessorListRoles{handler:handler})
  self146.AddToProcessorMap("get_privilege_set", &thriftHiveMetastoreProcessorGetPrivilegeSet{handler:handler})
  self146.AddToProcessorMap("list_privileges", &thriftHiveMetastoreProcessorListPrivileges{handler:handler})
  self146.AddToProcessorMap("grant_privileges", &thriftHiveMetastoreProcessorGrantPrivileges{handler:handler})
  self146.AddToProcessorMap("revoke_privileges", &thriftHiveMetastoreProcessorRevokePrivileges{handler:handler})
  self146.AddToProcessorMap("get_delegation_token", &thriftHiveMetastoreProcessorGetDelegationToken{handler:handler})
  self146.AddToProcessorMap("get_delegation_token_with_signature", &thriftHiveMetastoreProcessorGetDelegationTokenWithSignature{handler:handler})
  self146.AddToProcessorMap("renew_delegation_token", &thriftHiveMetastoreProcessorRenewDelegationToken{handler:handler})
  self146.AddToProcessorMap("cancel_delegation_token", &thriftHiveMetastoreProcessorCancelDelegationToken{handler:handler})
  return self146
}

type thriftHiveMetastoreProcessorCreateDatabase struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorCreateDatabase) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreCreateDatabaseArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("create_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreCreateDatabaseResult{}
  var err2 error
  if err2 = p.handler.CreateDatabase(ctx, args.Database); err2 != nil {
  switch v := err2.(type) {
    case *AlreadyExistsException:
  result.O1 = v
    case *InvalidObjectException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing create_database: " + err2.Error())
    oprot.WriteMessageBegin("create_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("create_database", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetDatabase struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetDatabase) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetDatabaseArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetDatabaseResult{}
var retval *Database
  var err2 error
  if retval, err2 = p.handler.GetDatabase(ctx, args.Name); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_database: " + err2.Error())
    oprot.WriteMessageBegin("get_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_database", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropDatabase struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropDatabase) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropDatabaseArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropDatabaseResult{}
  var err2 error
  if err2 = p.handler.DropDatabase(ctx, args.Name, args.DeleteData); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *InvalidOperationException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_database: " + err2.Error())
    oprot.WriteMessageBegin("drop_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("drop_database", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetDatabases struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetDatabases) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetDatabasesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_databases", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetDatabasesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetDatabases(ctx, args.Pattern); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_databases: " + err2.Error())
    oprot.WriteMessageBegin("get_databases", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_databases", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetAllDatabases struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetAllDatabases) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetAllDatabasesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_all_databases", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetAllDatabasesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetAllDatabases(ctx); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_all_databases: " + err2.Error())
    oprot.WriteMessageBegin("get_all_databases", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_all_databases", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAlterDatabase struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAlterDatabase) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAlterDatabaseArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("alter_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAlterDatabaseResult{}
  var err2 error
  if err2 = p.handler.AlterDatabase(ctx, args.Dbname, args.Db); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alter_database: " + err2.Error())
    oprot.WriteMessageBegin("alter_database", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("alter_database", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetType struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetType) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetTypeArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetTypeResult{}
var retval *Type
  var err2 error
  if retval, err2 = p.handler.GetType(ctx, args.Name); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_type: " + err2.Error())
    oprot.WriteMessageBegin("get_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_type", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorCreateType struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorCreateType) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreCreateTypeArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("create_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreCreateTypeResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.CreateType(ctx, args.Type); err2 != nil {
  switch v := err2.(type) {
    case *AlreadyExistsException:
  result.O1 = v
    case *InvalidObjectException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing create_type: " + err2.Error())
    oprot.WriteMessageBegin("create_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("create_type", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropType struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropType) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropTypeArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropTypeResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.DropType(ctx, args.Type); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_type: " + err2.Error())
    oprot.WriteMessageBegin("drop_type", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("drop_type", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetTypeAll struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetTypeAll) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetTypeAllArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_type_all", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetTypeAllResult{}
var retval map[string]*Type
  var err2 error
  if retval, err2 = p.handler.GetTypeAll(ctx, args.Name); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_type_all: " + err2.Error())
    oprot.WriteMessageBegin("get_type_all", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_type_all", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetFields struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetFields) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetFieldsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_fields", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetFieldsResult{}
var retval []*FieldSchema
  var err2 error
  if retval, err2 = p.handler.GetFields(ctx, args.DbName, args.TableName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *UnknownTableException:
  result.O2 = v
    case *UnknownDBException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_fields: " + err2.Error())
    oprot.WriteMessageBegin("get_fields", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_fields", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetSchema struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetSchema) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetSchemaArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_schema", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetSchemaResult{}
var retval []*FieldSchema
  var err2 error
  if retval, err2 = p.handler.GetSchema(ctx, args.DbName, args.TableName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *UnknownTableException:
  result.O2 = v
    case *UnknownDBException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_schema: " + err2.Error())
    oprot.WriteMessageBegin("get_schema", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_schema", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorCreateTable struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorCreateTable) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreCreateTableArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("create_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreCreateTableResult{}
  var err2 error
  if err2 = p.handler.CreateTable(ctx, args.Tbl); err2 != nil {
  switch v := err2.(type) {
    case *AlreadyExistsException:
  result.O1 = v
    case *InvalidObjectException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    case *NoSuchObjectException:
  result.O4 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing create_table: " + err2.Error())
    oprot.WriteMessageBegin("create_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("create_table", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropTable struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropTable) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropTableArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropTableResult{}
  var err2 error
  if err2 = p.handler.DropTable(ctx, args.Dbname, args.Name, args.DeleteData); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_table: " + err2.Error())
    oprot.WriteMessageBegin("drop_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("drop_table", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetTables struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetTablesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_tables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetTablesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetTables(ctx, args.DbName, args.Pattern); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_tables: " + err2.Error())
    oprot.WriteMessageBegin("get_tables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_tables", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetAllTables struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetAllTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetAllTablesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_all_tables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetAllTablesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetAllTables(ctx, args.DbName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_all_tables: " + err2.Error())
    oprot.WriteMessageBegin("get_all_tables", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_all_tables", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetTable struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetTable) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetTableArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetTableResult{}
var retval *Table
  var err2 error
  if retval, err2 = p.handler.GetTable(ctx, args.Dbname, args.TblName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_table: " + err2.Error())
    oprot.WriteMessageBegin("get_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_table", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAlterTable struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAlterTable) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAlterTableArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("alter_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAlterTableResult{}
  var err2 error
  if err2 = p.handler.AlterTable(ctx, args.Dbname, args.TblName, args.NewTbl_); err2 != nil {
  switch v := err2.(type) {
    case *InvalidOperationException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alter_table: " + err2.Error())
    oprot.WriteMessageBegin("alter_table", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("alter_table", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAddPartition struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAddPartition) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAddPartitionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("add_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAddPartitionResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.AddPartition(ctx, args.NewPart_); err2 != nil {
  switch v := err2.(type) {
    case *InvalidObjectException:
  result.O1 = v
    case *AlreadyExistsException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing add_partition: " + err2.Error())
    oprot.WriteMessageBegin("add_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("add_partition", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAppendPartition struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAppendPartition) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAppendPartitionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("append_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAppendPartitionResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.AppendPartition(ctx, args.DbName, args.TblName, args.PartVals); err2 != nil {
  switch v := err2.(type) {
    case *InvalidObjectException:
  result.O1 = v
    case *AlreadyExistsException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing append_partition: " + err2.Error())
    oprot.WriteMessageBegin("append_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("append_partition", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAppendPartitionByName struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAppendPartitionByName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAppendPartitionByNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("append_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAppendPartitionByNameResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.AppendPartitionByName(ctx, args.DbName, args.TblName, args.PartName); err2 != nil {
  switch v := err2.(type) {
    case *InvalidObjectException:
  result.O1 = v
    case *AlreadyExistsException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing append_partition_by_name: " + err2.Error())
    oprot.WriteMessageBegin("append_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("append_partition_by_name", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropPartition struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropPartition) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropPartitionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropPartitionResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.DropPartition(ctx, args.DbName, args.TblName, args.PartVals, args.DeleteData); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_partition: " + err2.Error())
    oprot.WriteMessageBegin("drop_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("drop_partition", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropPartitionByName struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropPartitionByName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropPartitionByNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropPartitionByNameResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.DropPartitionByName(ctx, args.DbName, args.TblName, args.PartName, args.DeleteData); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_partition_by_name: " + err2.Error())
    oprot.WriteMessageBegin("drop_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("drop_partition_by_name", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartition struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartition) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.GetPartition(ctx, args.DbName, args.TblName, args.PartVals); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partition: " + err2.Error())
    oprot.WriteMessageBegin("get_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partition", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionWithAuth struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionWithAuth) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionWithAuthArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partition_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionWithAuthResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionWithAuth(ctx, args.DbName, args.TblName, args.PartVals, args.UserName, args.GroupNames); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partition_with_auth: " + err2.Error())
    oprot.WriteMessageBegin("get_partition_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partition_with_auth", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionByName struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionByName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionByNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionByNameResult{}
var retval *Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionByName(ctx, args.DbName, args.TblName, args.PartName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partition_by_name: " + err2.Error())
    oprot.WriteMessageBegin("get_partition_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partition_by_name", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitions struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partitions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionsResult{}
var retval []*Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitions(ctx, args.DbName, args.TblName, args.MaxParts); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partitions: " + err2.Error())
    oprot.WriteMessageBegin("get_partitions", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partitions", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionsWithAuth struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionsWithAuth) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionsWithAuthArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partitions_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionsWithAuthResult{}
var retval []*Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionsWithAuth(ctx, args.DbName, args.TblName, args.MaxParts, args.UserName, args.GroupNames); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partitions_with_auth: " + err2.Error())
    oprot.WriteMessageBegin("get_partitions_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partitions_with_auth", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionNames struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionNames) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionNamesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partition_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionNamesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetPartitionNames(ctx, args.DbName, args.TblName, args.MaxParts); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partition_names: " + err2.Error())
    oprot.WriteMessageBegin("get_partition_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partition_names", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionsPs struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionsPs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionsPsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partitions_ps", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionsPsResult{}
var retval []*Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionsPs(ctx, args.DbName, args.TblName, args.PartVals, args.MaxParts); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partitions_ps: " + err2.Error())
    oprot.WriteMessageBegin("get_partitions_ps", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partitions_ps", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionsPsWithAuth struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionsPsWithAuth) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionsPsWithAuthArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partitions_ps_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionsPsWithAuthResult{}
var retval []*Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionsPsWithAuth(ctx, args.DbName, args.TblName, args.PartVals, args.MaxParts, args.UserName, args.GroupNames); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partitions_ps_with_auth: " + err2.Error())
    oprot.WriteMessageBegin("get_partitions_ps_with_auth", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partitions_ps_with_auth", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionNamesPs struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionNamesPs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionNamesPsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partition_names_ps", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionNamesPsResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetPartitionNamesPs(ctx, args.DbName, args.TblName, args.PartVals, args.MaxParts); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partition_names_ps: " + err2.Error())
    oprot.WriteMessageBegin("get_partition_names_ps", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partition_names_ps", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPartitionsByFilter struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPartitionsByFilter) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPartitionsByFilterArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_partitions_by_filter", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPartitionsByFilterResult{}
var retval []*Partition
  var err2 error
  if retval, err2 = p.handler.GetPartitionsByFilter(ctx, args.DbName, args.TblName, args.Filter, args.MaxParts); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_partitions_by_filter: " + err2.Error())
    oprot.WriteMessageBegin("get_partitions_by_filter", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_partitions_by_filter", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAlterPartition struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAlterPartition) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAlterPartitionArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("alter_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAlterPartitionResult{}
  var err2 error
  if err2 = p.handler.AlterPartition(ctx, args.DbName, args.TblName, args.NewPart_); err2 != nil {
  switch v := err2.(type) {
    case *InvalidOperationException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alter_partition: " + err2.Error())
    oprot.WriteMessageBegin("alter_partition", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("alter_partition", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetConfigValue struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetConfigValue) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetConfigValueArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_config_value", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetConfigValueResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetConfigValue(ctx, args.Name, args.DefaultValue); err2 != nil {
  switch v := err2.(type) {
    case *ConfigValSecurityException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_config_value: " + err2.Error())
    oprot.WriteMessageBegin("get_config_value", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("get_config_value", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorPartitionNameToVals struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorPartitionNameToVals) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastorePartitionNameToValsArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("partition_name_to_vals", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastorePartitionNameToValsResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.PartitionNameToVals(ctx, args.PartName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing partition_name_to_vals: " + err2.Error())
    oprot.WriteMessageBegin("partition_name_to_vals", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("partition_name_to_vals", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorPartitionNameToSpec struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorPartitionNameToSpec) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastorePartitionNameToSpecArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("partition_name_to_spec", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastorePartitionNameToSpecResult{}
var retval map[string]string
  var err2 error
  if retval, err2 = p.handler.PartitionNameToSpec(ctx, args.PartName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing partition_name_to_spec: " + err2.Error())
    oprot.WriteMessageBegin("partition_name_to_spec", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("partition_name_to_spec", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAddIndex struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAddIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAddIndexArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("add_index", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAddIndexResult{}
var retval *Index
  var err2 error
  if retval, err2 = p.handler.AddIndex(ctx, args.NewIndex_, args.IndexTable); err2 != nil {
  switch v := err2.(type) {
    case *InvalidObjectException:
  result.O1 = v
    case *AlreadyExistsException:
  result.O2 = v
    case *MetaException:
  result.O3 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing add_index: " + err2.Error())
    oprot.WriteMessageBegin("add_index", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("add_index", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorAlterIndex struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorAlterIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreAlterIndexArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("alter_index", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreAlterIndexResult{}
  var err2 error
  if err2 = p.handler.AlterIndex(ctx, args.Dbname, args.BaseTblName, args.IdxName, args.NewIdx_); err2 != nil {
  switch v := err2.(type) {
    case *InvalidOperationException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alter_index: " + err2.Error())
    oprot.WriteMessageBegin("alter_index", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("alter_index", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropIndexByName struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropIndexByName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropIndexByNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_index_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropIndexByNameResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.DropIndexByName(ctx, args.DbName, args.TblName, args.IndexName, args.DeleteData); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_index_by_name: " + err2.Error())
    oprot.WriteMessageBegin("drop_index_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("drop_index_by_name", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetIndexByName struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetIndexByName) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetIndexByNameArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_index_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetIndexByNameResult{}
var retval *Index
  var err2 error
  if retval, err2 = p.handler.GetIndexByName(ctx, args.DbName, args.TblName, args.IndexName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    case *NoSuchObjectException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_index_by_name: " + err2.Error())
    oprot.WriteMessageBegin("get_index_by_name", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_index_by_name", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetIndexes struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetIndexes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetIndexesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_indexes", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetIndexesResult{}
var retval []*Index
  var err2 error
  if retval, err2 = p.handler.GetIndexes(ctx, args.DbName, args.TblName, args.MaxIndexes); err2 != nil {
  switch v := err2.(type) {
    case *NoSuchObjectException:
  result.O1 = v
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_indexes: " + err2.Error())
    oprot.WriteMessageBegin("get_indexes", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_indexes", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetIndexNames struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetIndexNames) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetIndexNamesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_index_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetIndexNamesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetIndexNames(ctx, args.DbName, args.TblName, args.MaxIndexes); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O2 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_index_names: " + err2.Error())
    oprot.WriteMessageBegin("get_index_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_index_names", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorCreateRole struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorCreateRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreCreateRoleArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("create_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreCreateRoleResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.CreateRole(ctx, args.Role); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing create_role: " + err2.Error())
    oprot.WriteMessageBegin("create_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("create_role", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorDropRole struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorDropRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreDropRoleArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("drop_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreDropRoleResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.DropRole(ctx, args.RoleName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing drop_role: " + err2.Error())
    oprot.WriteMessageBegin("drop_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("drop_role", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetRoleNames struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetRoleNames) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetRoleNamesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_role_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetRoleNamesResult{}
var retval []string
  var err2 error
  if retval, err2 = p.handler.GetRoleNames(ctx); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_role_names: " + err2.Error())
    oprot.WriteMessageBegin("get_role_names", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_role_names", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGrantRole struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGrantRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGrantRoleArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("grant_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGrantRoleResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.GrantRole(ctx, args.RoleName, args.PrincipalName, args.PrincipalType, args.Grantor, args.GrantorType, args.GrantOption); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grant_role: " + err2.Error())
    oprot.WriteMessageBegin("grant_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("grant_role", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorRevokeRole struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorRevokeRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreRevokeRoleArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("revoke_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreRevokeRoleResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.RevokeRole(ctx, args.RoleName, args.PrincipalName, args.PrincipalType); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revoke_role: " + err2.Error())
    oprot.WriteMessageBegin("revoke_role", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("revoke_role", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorListRoles struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorListRoles) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreListRolesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("list_roles", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreListRolesResult{}
var retval []*Role
  var err2 error
  if retval, err2 = p.handler.ListRoles(ctx, args.PrincipalName, args.PrincipalType); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing list_roles: " + err2.Error())
    oprot.WriteMessageBegin("list_roles", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("list_roles", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetPrivilegeSet struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetPrivilegeSet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetPrivilegeSetArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_privilege_set", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetPrivilegeSetResult{}
var retval *PrincipalPrivilegeSet
  var err2 error
  if retval, err2 = p.handler.GetPrivilegeSet(ctx, args.HiveObject, args.UserName, args.GroupNames); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_privilege_set: " + err2.Error())
    oprot.WriteMessageBegin("get_privilege_set", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("get_privilege_set", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorListPrivileges struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorListPrivileges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreListPrivilegesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("list_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreListPrivilegesResult{}
var retval []*HiveObjectPrivilege
  var err2 error
  if retval, err2 = p.handler.ListPrivileges(ctx, args.PrincipalName, args.PrincipalType, args.HiveObject); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing list_privileges: " + err2.Error())
    oprot.WriteMessageBegin("list_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = retval
}
  if err2 = oprot.WriteMessageBegin("list_privileges", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGrantPrivileges struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGrantPrivileges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGrantPrivilegesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("grant_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGrantPrivilegesResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.GrantPrivileges(ctx, args.Privileges); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grant_privileges: " + err2.Error())
    oprot.WriteMessageBegin("grant_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("grant_privileges", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorRevokePrivileges struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorRevokePrivileges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreRevokePrivilegesArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("revoke_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreRevokePrivilegesResult{}
var retval bool
  var err2 error
  if retval, err2 = p.handler.RevokePrivileges(ctx, args.Privileges); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revoke_privileges: " + err2.Error())
    oprot.WriteMessageBegin("revoke_privileges", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("revoke_privileges", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetDelegationToken struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetDelegationTokenResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetDelegationToken(ctx, args.RenewerKerberosPrincipalName); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_delegation_token: " + err2.Error())
    oprot.WriteMessageBegin("get_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("get_delegation_token", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorGetDelegationTokenWithSignature struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorGetDelegationTokenWithSignature) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("get_delegation_token_with_signature", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreGetDelegationTokenWithSignatureResult{}
var retval string
  var err2 error
  if retval, err2 = p.handler.GetDelegationTokenWithSignature(ctx, args.RenewerKerberosPrincipalName, args.TokenSignature); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get_delegation_token_with_signature: " + err2.Error())
    oprot.WriteMessageBegin("get_delegation_token_with_signature", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("get_delegation_token_with_signature", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorRenewDelegationToken struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreRenewDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("renew_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreRenewDelegationTokenResult{}
var retval int64
  var err2 error
  if retval, err2 = p.handler.RenewDelegationToken(ctx, args.TokenStrForm); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renew_delegation_token: " + err2.Error())
    oprot.WriteMessageBegin("renew_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  } else {
    result.Success = &retval
}
  if err2 = oprot.WriteMessageBegin("renew_delegation_token", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}

type thriftHiveMetastoreProcessorCancelDelegationToken struct {
  handler ThriftHiveMetastore
}

func (p *thriftHiveMetastoreProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
  args := ThriftHiveMetastoreCancelDelegationTokenArgs{}
  if err = args.Read(iprot); err != nil {
    iprot.ReadMessageEnd()
    x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
    oprot.WriteMessageBegin("cancel_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return false, err
  }

  iprot.ReadMessageEnd()
  result := ThriftHiveMetastoreCancelDelegationTokenResult{}
  var err2 error
  if err2 = p.handler.CancelDelegationToken(ctx, args.TokenStrForm); err2 != nil {
  switch v := err2.(type) {
    case *MetaException:
  result.O1 = v
    default:
    x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing cancel_delegation_token: " + err2.Error())
    oprot.WriteMessageBegin("cancel_delegation_token", thrift.EXCEPTION, seqId)
    x.Write(oprot)
    oprot.WriteMessageEnd()
    oprot.Flush(ctx)
    return true, err2
  }
  }
  if err2 = oprot.WriteMessageBegin("cancel_delegation_token", thrift.REPLY, seqId); err2 != nil {
    err = err2
  }
  if err2 = result.Write(oprot); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
    err = err2
  }
  if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
    err = err2
  }
  if err != nil {
    return
  }
  return true, err
}


// HELPER FUNCTIONS AND STRUCTURES

// Attributes:
//  - Database
type ThriftHiveMetastoreCreateDatabaseArgs struct {
  Database *Database `thrift:"database,1" db:"database" json:"database"`
}

func NewThriftHiveMetastoreCreateDatabaseArgs() *ThriftHiveMetastoreCreateDatabaseArgs {
  return &ThriftHiveMetastoreCreateDatabaseArgs{}
}

var ThriftHiveMetastoreCreateDatabaseArgs_Database_DEFAULT *Database
func (p *ThriftHiveMetastoreCreateDatabaseArgs) GetDatabase() *Database {
  if !p.IsSetDatabase() {
    return ThriftHiveMetastoreCreateDatabaseArgs_Database_DEFAULT
  }
return p.Database
}
func (p *ThriftHiveMetastoreCreateDatabaseArgs) IsSetDatabase() bool {
  return p.Database != nil
}

func (p *ThriftHiveMetastoreCreateDatabaseArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Database = &Database{}
  if err := p.Database.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Database), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_database_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("database", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:database: ", p), err) }
  if err := p.Database.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Database), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:database: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreCreateDatabaseArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateDatabaseArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreCreateDatabaseResult struct {
  O1 *AlreadyExistsException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *InvalidObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreCreateDatabaseResult() *ThriftHiveMetastoreCreateDatabaseResult {
  return &ThriftHiveMetastoreCreateDatabaseResult{}
}

var ThriftHiveMetastoreCreateDatabaseResult_O1_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreCreateDatabaseResult) GetO1() *AlreadyExistsException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreCreateDatabaseResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreCreateDatabaseResult_O2_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreCreateDatabaseResult) GetO2() *InvalidObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreCreateDatabaseResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreCreateDatabaseResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreCreateDatabaseResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreCreateDatabaseResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreCreateDatabaseResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &AlreadyExistsException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &InvalidObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_database_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateDatabaseResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateDatabaseResult(%+v)", *p)
}

// Attributes:
//  - Name
type ThriftHiveMetastoreGetDatabaseArgs struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
}

func NewThriftHiveMetastoreGetDatabaseArgs() *ThriftHiveMetastoreGetDatabaseArgs {
  return &ThriftHiveMetastoreGetDatabaseArgs{}
}


func (p *ThriftHiveMetastoreGetDatabaseArgs) GetName() string {
  return p.Name
}
func (p *ThriftHiveMetastoreGetDatabaseArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_database_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetDatabaseArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDatabaseArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetDatabaseResult struct {
  Success *Database `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetDatabaseResult() *ThriftHiveMetastoreGetDatabaseResult {
  return &ThriftHiveMetastoreGetDatabaseResult{}
}

var ThriftHiveMetastoreGetDatabaseResult_Success_DEFAULT *Database
func (p *ThriftHiveMetastoreGetDatabaseResult) GetSuccess() *Database {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetDatabaseResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetDatabaseResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetDatabaseResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetDatabaseResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetDatabaseResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetDatabaseResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetDatabaseResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetDatabaseResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Database{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_database_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabaseResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDatabaseResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDatabaseResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDatabaseResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDatabaseResult(%+v)", *p)
}

// Attributes:
//  - Name
//  - DeleteData
type ThriftHiveMetastoreDropDatabaseArgs struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  DeleteData bool `thrift:"deleteData,2" db:"deleteData" json:"deleteData"`
}

func NewThriftHiveMetastoreDropDatabaseArgs() *ThriftHiveMetastoreDropDatabaseArgs {
  return &ThriftHiveMetastoreDropDatabaseArgs{}
}


func (p *ThriftHiveMetastoreDropDatabaseArgs) GetName() string {
  return p.Name
}

func (p *ThriftHiveMetastoreDropDatabaseArgs) GetDeleteData() bool {
  return p.DeleteData
}
func (p *ThriftHiveMetastoreDropDatabaseArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DeleteData = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_database_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropDatabaseArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deleteData", thrift.BOOL, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:deleteData: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeleteData)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deleteData (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:deleteData: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropDatabaseArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropDatabaseArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreDropDatabaseResult struct {
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *InvalidOperationException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreDropDatabaseResult() *ThriftHiveMetastoreDropDatabaseResult {
  return &ThriftHiveMetastoreDropDatabaseResult{}
}

var ThriftHiveMetastoreDropDatabaseResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropDatabaseResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropDatabaseResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropDatabaseResult_O2_DEFAULT *InvalidOperationException
func (p *ThriftHiveMetastoreDropDatabaseResult) GetO2() *InvalidOperationException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreDropDatabaseResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreDropDatabaseResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropDatabaseResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreDropDatabaseResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreDropDatabaseResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &InvalidOperationException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_database_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropDatabaseResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropDatabaseResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropDatabaseResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropDatabaseResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropDatabaseResult(%+v)", *p)
}

// Attributes:
//  - Pattern
type ThriftHiveMetastoreGetDatabasesArgs struct {
  Pattern string `thrift:"pattern,1" db:"pattern" json:"pattern"`
}

func NewThriftHiveMetastoreGetDatabasesArgs() *ThriftHiveMetastoreGetDatabasesArgs {
  return &ThriftHiveMetastoreGetDatabasesArgs{}
}


func (p *ThriftHiveMetastoreGetDatabasesArgs) GetPattern() string {
  return p.Pattern
}
func (p *ThriftHiveMetastoreGetDatabasesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Pattern = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_databases_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("pattern", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:pattern: ", p), err) }
  if err := oprot.WriteString(string(p.Pattern)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.pattern (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:pattern: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetDatabasesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDatabasesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetDatabasesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetDatabasesResult() *ThriftHiveMetastoreGetDatabasesResult {
  return &ThriftHiveMetastoreGetDatabasesResult{}
}

var ThriftHiveMetastoreGetDatabasesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetDatabasesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetDatabasesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetDatabasesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetDatabasesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetDatabasesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem147 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem147 = v
}
    p.Success = append(p.Success, _elem147)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_databases_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDatabasesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDatabasesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDatabasesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDatabasesResult(%+v)", *p)
}

type ThriftHiveMetastoreGetAllDatabasesArgs struct {
}

func NewThriftHiveMetastoreGetAllDatabasesArgs() *ThriftHiveMetastoreGetAllDatabasesArgs {
  return &ThriftHiveMetastoreGetAllDatabasesArgs{}
}

func (p *ThriftHiveMetastoreGetAllDatabasesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_all_databases_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetAllDatabasesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetAllDatabasesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetAllDatabasesResult() *ThriftHiveMetastoreGetAllDatabasesResult {
  return &ThriftHiveMetastoreGetAllDatabasesResult{}
}

var ThriftHiveMetastoreGetAllDatabasesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetAllDatabasesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetAllDatabasesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetAllDatabasesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetAllDatabasesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetAllDatabasesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem148 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem148 = v
}
    p.Success = append(p.Success, _elem148)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_all_databases_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetAllDatabasesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetAllDatabasesResult(%+v)", *p)
}

// Attributes:
//  - Dbname
//  - Db
type ThriftHiveMetastoreAlterDatabaseArgs struct {
  Dbname string `thrift:"dbname,1" db:"dbname" json:"dbname"`
  Db *Database `thrift:"db,2" db:"db" json:"db"`
}

func NewThriftHiveMetastoreAlterDatabaseArgs() *ThriftHiveMetastoreAlterDatabaseArgs {
  return &ThriftHiveMetastoreAlterDatabaseArgs{}
}


func (p *ThriftHiveMetastoreAlterDatabaseArgs) GetDbname() string {
  return p.Dbname
}
var ThriftHiveMetastoreAlterDatabaseArgs_Db_DEFAULT *Database
func (p *ThriftHiveMetastoreAlterDatabaseArgs) GetDb() *Database {
  if !p.IsSetDb() {
    return ThriftHiveMetastoreAlterDatabaseArgs_Db_DEFAULT
  }
return p.Db
}
func (p *ThriftHiveMetastoreAlterDatabaseArgs) IsSetDb() bool {
  return p.Db != nil
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Dbname = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs)  ReadField2(iprot thrift.TProtocol) error {
  p.Db = &Database{}
  if err := p.Db.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Db), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_database_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbname", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dbname: ", p), err) }
  if err := oprot.WriteString(string(p.Dbname)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbname (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dbname: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db", thrift.STRUCT, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:db: ", p), err) }
  if err := p.Db.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Db), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:db: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterDatabaseArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterDatabaseArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
type ThriftHiveMetastoreAlterDatabaseResult struct {
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreAlterDatabaseResult() *ThriftHiveMetastoreAlterDatabaseResult {
  return &ThriftHiveMetastoreAlterDatabaseResult{}
}

var ThriftHiveMetastoreAlterDatabaseResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAlterDatabaseResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAlterDatabaseResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAlterDatabaseResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreAlterDatabaseResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAlterDatabaseResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreAlterDatabaseResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_database_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterDatabaseResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterDatabaseResult(%+v)", *p)
}

// Attributes:
//  - Name
type ThriftHiveMetastoreGetTypeArgs struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
}

func NewThriftHiveMetastoreGetTypeArgs() *ThriftHiveMetastoreGetTypeArgs {
  return &ThriftHiveMetastoreGetTypeArgs{}
}


func (p *ThriftHiveMetastoreGetTypeArgs) GetName() string {
  return p.Name
}
func (p *ThriftHiveMetastoreGetTypeArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTypeArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_type_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTypeArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTypeArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetTypeResult struct {
  Success *Type `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetTypeResult() *ThriftHiveMetastoreGetTypeResult {
  return &ThriftHiveMetastoreGetTypeResult{}
}

var ThriftHiveMetastoreGetTypeResult_Success_DEFAULT *Type
func (p *ThriftHiveMetastoreGetTypeResult) GetSuccess() *Type {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetTypeResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetTypeResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetTypeResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetTypeResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetTypeResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetTypeResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetTypeResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetTypeResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetTypeResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetTypeResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetTypeResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Type{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_type_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTypeResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTypeResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTypeResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTypeResult(%+v)", *p)
}

// Attributes:
//  - Type
type ThriftHiveMetastoreCreateTypeArgs struct {
  Type *Type `thrift:"type,1" db:"type" json:"type"`
}

func NewThriftHiveMetastoreCreateTypeArgs() *ThriftHiveMetastoreCreateTypeArgs {
  return &ThriftHiveMetastoreCreateTypeArgs{}
}

var ThriftHiveMetastoreCreateTypeArgs_Type_DEFAULT *Type
func (p *ThriftHiveMetastoreCreateTypeArgs) GetType() *Type {
  if !p.IsSetType() {
    return ThriftHiveMetastoreCreateTypeArgs_Type_DEFAULT
  }
return p.Type
}
func (p *ThriftHiveMetastoreCreateTypeArgs) IsSetType() bool {
  return p.Type != nil
}

func (p *ThriftHiveMetastoreCreateTypeArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Type = &Type{}
  if err := p.Type.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_type_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("type", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) }
  if err := p.Type.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreCreateTypeArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateTypeArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreCreateTypeResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *AlreadyExistsException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *InvalidObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreCreateTypeResult() *ThriftHiveMetastoreCreateTypeResult {
  return &ThriftHiveMetastoreCreateTypeResult{}
}

var ThriftHiveMetastoreCreateTypeResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreCreateTypeResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreCreateTypeResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreCreateTypeResult_O1_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreCreateTypeResult) GetO1() *AlreadyExistsException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreCreateTypeResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreCreateTypeResult_O2_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreCreateTypeResult) GetO2() *InvalidObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreCreateTypeResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreCreateTypeResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreCreateTypeResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreCreateTypeResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreCreateTypeResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &AlreadyExistsException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &InvalidObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_type_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateTypeResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTypeResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTypeResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTypeResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTypeResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateTypeResult(%+v)", *p)
}

// Attributes:
//  - Type
type ThriftHiveMetastoreDropTypeArgs struct {
  Type string `thrift:"type,1" db:"type" json:"type"`
}

func NewThriftHiveMetastoreDropTypeArgs() *ThriftHiveMetastoreDropTypeArgs {
  return &ThriftHiveMetastoreDropTypeArgs{}
}


func (p *ThriftHiveMetastoreDropTypeArgs) GetType() string {
  return p.Type
}
func (p *ThriftHiveMetastoreDropTypeArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Type = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropTypeArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_type_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("type", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) }
  if err := oprot.WriteString(string(p.Type)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropTypeArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropTypeArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreDropTypeResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreDropTypeResult() *ThriftHiveMetastoreDropTypeResult {
  return &ThriftHiveMetastoreDropTypeResult{}
}

var ThriftHiveMetastoreDropTypeResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreDropTypeResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreDropTypeResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreDropTypeResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropTypeResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropTypeResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropTypeResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropTypeResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreDropTypeResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreDropTypeResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreDropTypeResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropTypeResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreDropTypeResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreDropTypeResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_type_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropTypeResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropTypeResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropTypeResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropTypeResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropTypeResult(%+v)", *p)
}

// Attributes:
//  - Name
type ThriftHiveMetastoreGetTypeAllArgs struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
}

func NewThriftHiveMetastoreGetTypeAllArgs() *ThriftHiveMetastoreGetTypeAllArgs {
  return &ThriftHiveMetastoreGetTypeAllArgs{}
}


func (p *ThriftHiveMetastoreGetTypeAllArgs) GetName() string {
  return p.Name
}
func (p *ThriftHiveMetastoreGetTypeAllArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_type_all_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTypeAllArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTypeAllArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O2
type ThriftHiveMetastoreGetTypeAllResult struct {
  Success map[string]*Type `thrift:"success,0" db:"success" json:"success,omitempty"`
  O2 *MetaException `thrift:"o2,1" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetTypeAllResult() *ThriftHiveMetastoreGetTypeAllResult {
  return &ThriftHiveMetastoreGetTypeAllResult{}
}

var ThriftHiveMetastoreGetTypeAllResult_Success_DEFAULT map[string]*Type

func (p *ThriftHiveMetastoreGetTypeAllResult) GetSuccess() map[string]*Type {
  return p.Success
}
var ThriftHiveMetastoreGetTypeAllResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetTypeAllResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetTypeAllResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetTypeAllResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]*Type, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key149 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key149 = v
}
    _val150 := &Type{}
    if err := _val150.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val150), err)
    }
    p.Success[_key149] = _val150
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_type_all_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTypeAllResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTypeAllResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTypeAllResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTypeAllResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TableName
type ThriftHiveMetastoreGetFieldsArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TableName string `thrift:"table_name,2" db:"table_name" json:"table_name"`
}

func NewThriftHiveMetastoreGetFieldsArgs() *ThriftHiveMetastoreGetFieldsArgs {
  return &ThriftHiveMetastoreGetFieldsArgs{}
}


func (p *ThriftHiveMetastoreGetFieldsArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetFieldsArgs) GetTableName() string {
  return p.TableName
}
func (p *ThriftHiveMetastoreGetFieldsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TableName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_fields_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("table_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:table_name: ", p), err) }
  if err := oprot.WriteString(string(p.TableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.table_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:table_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetFieldsArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreGetFieldsResult struct {
  Success []*FieldSchema `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *UnknownTableException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *UnknownDBException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreGetFieldsResult() *ThriftHiveMetastoreGetFieldsResult {
  return &ThriftHiveMetastoreGetFieldsResult{}
}

var ThriftHiveMetastoreGetFieldsResult_Success_DEFAULT []*FieldSchema

func (p *ThriftHiveMetastoreGetFieldsResult) GetSuccess() []*FieldSchema {
  return p.Success
}
var ThriftHiveMetastoreGetFieldsResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetFieldsResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetFieldsResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetFieldsResult_O2_DEFAULT *UnknownTableException
func (p *ThriftHiveMetastoreGetFieldsResult) GetO2() *UnknownTableException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetFieldsResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreGetFieldsResult_O3_DEFAULT *UnknownDBException
func (p *ThriftHiveMetastoreGetFieldsResult) GetO3() *UnknownDBException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreGetFieldsResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreGetFieldsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem151 := &FieldSchema{}
    if err := _elem151.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem151), err)
    }
    p.Success = append(p.Success, _elem151)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &UnknownTableException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &UnknownDBException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_fields_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetFieldsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetFieldsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetFieldsResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TableName
type ThriftHiveMetastoreGetSchemaArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TableName string `thrift:"table_name,2" db:"table_name" json:"table_name"`
}

func NewThriftHiveMetastoreGetSchemaArgs() *ThriftHiveMetastoreGetSchemaArgs {
  return &ThriftHiveMetastoreGetSchemaArgs{}
}


func (p *ThriftHiveMetastoreGetSchemaArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetSchemaArgs) GetTableName() string {
  return p.TableName
}
func (p *ThriftHiveMetastoreGetSchemaArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TableName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_schema_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("table_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:table_name: ", p), err) }
  if err := oprot.WriteString(string(p.TableName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.table_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:table_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetSchemaArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreGetSchemaResult struct {
  Success []*FieldSchema `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *UnknownTableException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *UnknownDBException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreGetSchemaResult() *ThriftHiveMetastoreGetSchemaResult {
  return &ThriftHiveMetastoreGetSchemaResult{}
}

var ThriftHiveMetastoreGetSchemaResult_Success_DEFAULT []*FieldSchema

func (p *ThriftHiveMetastoreGetSchemaResult) GetSuccess() []*FieldSchema {
  return p.Success
}
var ThriftHiveMetastoreGetSchemaResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetSchemaResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetSchemaResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetSchemaResult_O2_DEFAULT *UnknownTableException
func (p *ThriftHiveMetastoreGetSchemaResult) GetO2() *UnknownTableException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetSchemaResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreGetSchemaResult_O3_DEFAULT *UnknownDBException
func (p *ThriftHiveMetastoreGetSchemaResult) GetO3() *UnknownDBException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreGetSchemaResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreGetSchemaResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*FieldSchema, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem152 := &FieldSchema{}
    if err := _elem152.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem152), err)
    }
    p.Success = append(p.Success, _elem152)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &UnknownTableException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &UnknownDBException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_schema_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetSchemaResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetSchemaResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetSchemaResult(%+v)", *p)
}

// Attributes:
//  - Tbl
type ThriftHiveMetastoreCreateTableArgs struct {
  Tbl *Table `thrift:"tbl,1" db:"tbl" json:"tbl"`
}

func NewThriftHiveMetastoreCreateTableArgs() *ThriftHiveMetastoreCreateTableArgs {
  return &ThriftHiveMetastoreCreateTableArgs{}
}

var ThriftHiveMetastoreCreateTableArgs_Tbl_DEFAULT *Table
func (p *ThriftHiveMetastoreCreateTableArgs) GetTbl() *Table {
  if !p.IsSetTbl() {
    return ThriftHiveMetastoreCreateTableArgs_Tbl_DEFAULT
  }
return p.Tbl
}
func (p *ThriftHiveMetastoreCreateTableArgs) IsSetTbl() bool {
  return p.Tbl != nil
}

func (p *ThriftHiveMetastoreCreateTableArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Tbl = &Table{}
  if err := p.Tbl.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Tbl), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_table_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tbl: ", p), err) }
  if err := p.Tbl.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Tbl), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tbl: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreCreateTableArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateTableArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
//  - O3
//  - O4
type ThriftHiveMetastoreCreateTableResult struct {
  O1 *AlreadyExistsException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *InvalidObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
  O4 *NoSuchObjectException `thrift:"o4,4" db:"o4" json:"o4,omitempty"`
}

func NewThriftHiveMetastoreCreateTableResult() *ThriftHiveMetastoreCreateTableResult {
  return &ThriftHiveMetastoreCreateTableResult{}
}

var ThriftHiveMetastoreCreateTableResult_O1_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreCreateTableResult) GetO1() *AlreadyExistsException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreCreateTableResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreCreateTableResult_O2_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreCreateTableResult) GetO2() *InvalidObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreCreateTableResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreCreateTableResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreCreateTableResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreCreateTableResult_O3_DEFAULT
  }
return p.O3
}
var ThriftHiveMetastoreCreateTableResult_O4_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreCreateTableResult) GetO4() *NoSuchObjectException {
  if !p.IsSetO4() {
    return ThriftHiveMetastoreCreateTableResult_O4_DEFAULT
  }
return p.O4
}
func (p *ThriftHiveMetastoreCreateTableResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreCreateTableResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreCreateTableResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreCreateTableResult) IsSetO4() bool {
  return p.O4 != nil
}

func (p *ThriftHiveMetastoreCreateTableResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &AlreadyExistsException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &InvalidObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult)  ReadField4(iprot thrift.TProtocol) error {
  p.O4 = &NoSuchObjectException{}
  if err := p.O4.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O4), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_table_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateTableResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTableResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTableResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTableResult) writeField4(oprot thrift.TProtocol) (err error) {
  if p.IsSetO4() {
    if err := oprot.WriteFieldBegin("o4", thrift.STRUCT, 4); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:o4: ", p), err) }
    if err := p.O4.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O4), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 4:o4: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateTableResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateTableResult(%+v)", *p)
}

// Attributes:
//  - Dbname
//  - Name
//  - DeleteData
type ThriftHiveMetastoreDropTableArgs struct {
  Dbname string `thrift:"dbname,1" db:"dbname" json:"dbname"`
  Name string `thrift:"name,2" db:"name" json:"name"`
  DeleteData bool `thrift:"deleteData,3" db:"deleteData" json:"deleteData"`
}

func NewThriftHiveMetastoreDropTableArgs() *ThriftHiveMetastoreDropTableArgs {
  return &ThriftHiveMetastoreDropTableArgs{}
}


func (p *ThriftHiveMetastoreDropTableArgs) GetDbname() string {
  return p.Dbname
}

func (p *ThriftHiveMetastoreDropTableArgs) GetName() string {
  return p.Name
}

func (p *ThriftHiveMetastoreDropTableArgs) GetDeleteData() bool {
  return p.DeleteData
}
func (p *ThriftHiveMetastoreDropTableArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTableArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Dbname = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropTableArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropTableArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.DeleteData = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropTableArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_table_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropTableArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbname", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dbname: ", p), err) }
  if err := oprot.WriteString(string(p.Dbname)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbname (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dbname: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropTableArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropTableArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deleteData", thrift.BOOL, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:deleteData: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeleteData)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deleteData (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:deleteData: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropTableArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropTableArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O3
type ThriftHiveMetastoreDropTableResult struct {
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O3 *MetaException `thrift:"o3,2" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreDropTableResult() *ThriftHiveMetastoreDropTableResult {
  return &ThriftHiveMetastoreDropTableResult{}
}

var ThriftHiveMetastoreDropTableResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropTableResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropTableResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropTableResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropTableResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreDropTableResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreDropTableResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropTableResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreDropTableResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTableResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTableResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropTableResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_table_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropTableResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropTableResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropTableResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropTableResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - Pattern
type ThriftHiveMetastoreGetTablesArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  Pattern string `thrift:"pattern,2" db:"pattern" json:"pattern"`
}

func NewThriftHiveMetastoreGetTablesArgs() *ThriftHiveMetastoreGetTablesArgs {
  return &ThriftHiveMetastoreGetTablesArgs{}
}


func (p *ThriftHiveMetastoreGetTablesArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetTablesArgs) GetPattern() string {
  return p.Pattern
}
func (p *ThriftHiveMetastoreGetTablesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTablesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.Pattern = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTablesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_tables_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTablesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("pattern", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:pattern: ", p), err) }
  if err := oprot.WriteString(string(p.Pattern)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.pattern (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:pattern: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTablesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTablesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetTablesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetTablesResult() *ThriftHiveMetastoreGetTablesResult {
  return &ThriftHiveMetastoreGetTablesResult{}
}

var ThriftHiveMetastoreGetTablesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetTablesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetTablesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetTablesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetTablesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetTablesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetTablesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetTablesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem153 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem153 = v
}
    p.Success = append(p.Success, _elem153)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_tables_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTablesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTablesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTablesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTablesResult(%+v)", *p)
}

// Attributes:
//  - DbName
type ThriftHiveMetastoreGetAllTablesArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
}

func NewThriftHiveMetastoreGetAllTablesArgs() *ThriftHiveMetastoreGetAllTablesArgs {
  return &ThriftHiveMetastoreGetAllTablesArgs{}
}


func (p *ThriftHiveMetastoreGetAllTablesArgs) GetDbName() string {
  return p.DbName
}
func (p *ThriftHiveMetastoreGetAllTablesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_all_tables_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetAllTablesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetAllTablesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetAllTablesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetAllTablesResult() *ThriftHiveMetastoreGetAllTablesResult {
  return &ThriftHiveMetastoreGetAllTablesResult{}
}

var ThriftHiveMetastoreGetAllTablesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetAllTablesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetAllTablesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetAllTablesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetAllTablesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetAllTablesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem154 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem154 = v
}
    p.Success = append(p.Success, _elem154)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_all_tables_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetAllTablesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetAllTablesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetAllTablesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetAllTablesResult(%+v)", *p)
}

// Attributes:
//  - Dbname
//  - TblName
type ThriftHiveMetastoreGetTableArgs struct {
  Dbname string `thrift:"dbname,1" db:"dbname" json:"dbname"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
}

func NewThriftHiveMetastoreGetTableArgs() *ThriftHiveMetastoreGetTableArgs {
  return &ThriftHiveMetastoreGetTableArgs{}
}


func (p *ThriftHiveMetastoreGetTableArgs) GetDbname() string {
  return p.Dbname
}

func (p *ThriftHiveMetastoreGetTableArgs) GetTblName() string {
  return p.TblName
}
func (p *ThriftHiveMetastoreGetTableArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTableArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Dbname = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTableArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetTableArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_table_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTableArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbname", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dbname: ", p), err) }
  if err := oprot.WriteString(string(p.Dbname)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbname (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dbname: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTableArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetTableArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTableArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetTableResult struct {
  Success *Table `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetTableResult() *ThriftHiveMetastoreGetTableResult {
  return &ThriftHiveMetastoreGetTableResult{}
}

var ThriftHiveMetastoreGetTableResult_Success_DEFAULT *Table
func (p *ThriftHiveMetastoreGetTableResult) GetSuccess() *Table {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetTableResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetTableResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetTableResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetTableResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetTableResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetTableResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetTableResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetTableResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetTableResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetTableResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetTableResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTableResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Table{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTableResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTableResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetTableResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_table_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetTableResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTableResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTableResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetTableResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetTableResult(%+v)", *p)
}

// Attributes:
//  - Dbname
//  - TblName
//  - NewTbl_
type ThriftHiveMetastoreAlterTableArgs struct {
  Dbname string `thrift:"dbname,1" db:"dbname" json:"dbname"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  NewTbl_ *Table `thrift:"new_tbl,3" db:"new_tbl" json:"new_tbl"`
}

func NewThriftHiveMetastoreAlterTableArgs() *ThriftHiveMetastoreAlterTableArgs {
  return &ThriftHiveMetastoreAlterTableArgs{}
}


func (p *ThriftHiveMetastoreAlterTableArgs) GetDbname() string {
  return p.Dbname
}

func (p *ThriftHiveMetastoreAlterTableArgs) GetTblName() string {
  return p.TblName
}
var ThriftHiveMetastoreAlterTableArgs_NewTbl__DEFAULT *Table
func (p *ThriftHiveMetastoreAlterTableArgs) GetNewTbl_() *Table {
  if !p.IsSetNewTbl_() {
    return ThriftHiveMetastoreAlterTableArgs_NewTbl__DEFAULT
  }
return p.NewTbl_
}
func (p *ThriftHiveMetastoreAlterTableArgs) IsSetNewTbl_() bool {
  return p.NewTbl_ != nil
}

func (p *ThriftHiveMetastoreAlterTableArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Dbname = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterTableArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterTableArgs)  ReadField3(iprot thrift.TProtocol) error {
  p.NewTbl_ = &Table{}
  if err := p.NewTbl_.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewTbl_), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_table_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbname", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dbname: ", p), err) }
  if err := oprot.WriteString(string(p.Dbname)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbname (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dbname: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterTableArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterTableArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("new_tbl", thrift.STRUCT, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_tbl: ", p), err) }
  if err := p.NewTbl_.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewTbl_), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_tbl: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterTableArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterTableArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
type ThriftHiveMetastoreAlterTableResult struct {
  O1 *InvalidOperationException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreAlterTableResult() *ThriftHiveMetastoreAlterTableResult {
  return &ThriftHiveMetastoreAlterTableResult{}
}

var ThriftHiveMetastoreAlterTableResult_O1_DEFAULT *InvalidOperationException
func (p *ThriftHiveMetastoreAlterTableResult) GetO1() *InvalidOperationException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAlterTableResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAlterTableResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAlterTableResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAlterTableResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreAlterTableResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAlterTableResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAlterTableResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidOperationException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_table_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterTableResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterTableResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterTableResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterTableResult(%+v)", *p)
}

// Attributes:
//  - NewPart_
type ThriftHiveMetastoreAddPartitionArgs struct {
  NewPart_ *Partition `thrift:"new_part,1" db:"new_part" json:"new_part"`
}

func NewThriftHiveMetastoreAddPartitionArgs() *ThriftHiveMetastoreAddPartitionArgs {
  return &ThriftHiveMetastoreAddPartitionArgs{}
}

var ThriftHiveMetastoreAddPartitionArgs_NewPart__DEFAULT *Partition
func (p *ThriftHiveMetastoreAddPartitionArgs) GetNewPart_() *Partition {
  if !p.IsSetNewPart_() {
    return ThriftHiveMetastoreAddPartitionArgs_NewPart__DEFAULT
  }
return p.NewPart_
}
func (p *ThriftHiveMetastoreAddPartitionArgs) IsSetNewPart_() bool {
  return p.NewPart_ != nil
}

func (p *ThriftHiveMetastoreAddPartitionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.NewPart_ = &Partition{}
  if err := p.NewPart_.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewPart_), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("add_partition_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("new_part", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:new_part: ", p), err) }
  if err := p.NewPart_.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewPart_), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:new_part: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAddPartitionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAddPartitionArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreAddPartitionResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *InvalidObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *AlreadyExistsException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreAddPartitionResult() *ThriftHiveMetastoreAddPartitionResult {
  return &ThriftHiveMetastoreAddPartitionResult{}
}

var ThriftHiveMetastoreAddPartitionResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreAddPartitionResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreAddPartitionResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreAddPartitionResult_O1_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreAddPartitionResult) GetO1() *InvalidObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAddPartitionResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAddPartitionResult_O2_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreAddPartitionResult) GetO2() *AlreadyExistsException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAddPartitionResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreAddPartitionResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAddPartitionResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreAddPartitionResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreAddPartitionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &AlreadyExistsException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("add_partition_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAddPartitionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddPartitionResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddPartitionResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddPartitionResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddPartitionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAddPartitionResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
type ThriftHiveMetastoreAppendPartitionArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
}

func NewThriftHiveMetastoreAppendPartitionArgs() *ThriftHiveMetastoreAppendPartitionArgs {
  return &ThriftHiveMetastoreAppendPartitionArgs{}
}


func (p *ThriftHiveMetastoreAppendPartitionArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) GetPartVals() []string {
  return p.PartVals
}
func (p *ThriftHiveMetastoreAppendPartitionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem155 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem155 = v
}
    p.PartVals = append(p.PartVals, _elem155)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("append_partition_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAppendPartitionArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreAppendPartitionResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *InvalidObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *AlreadyExistsException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreAppendPartitionResult() *ThriftHiveMetastoreAppendPartitionResult {
  return &ThriftHiveMetastoreAppendPartitionResult{}
}

var ThriftHiveMetastoreAppendPartitionResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreAppendPartitionResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreAppendPartitionResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreAppendPartitionResult_O1_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreAppendPartitionResult) GetO1() *InvalidObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAppendPartitionResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAppendPartitionResult_O2_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreAppendPartitionResult) GetO2() *AlreadyExistsException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAppendPartitionResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreAppendPartitionResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAppendPartitionResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreAppendPartitionResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreAppendPartitionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &AlreadyExistsException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("append_partition_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAppendPartitionResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartName
type ThriftHiveMetastoreAppendPartitionByNameArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartName string `thrift:"part_name,3" db:"part_name" json:"part_name"`
}

func NewThriftHiveMetastoreAppendPartitionByNameArgs() *ThriftHiveMetastoreAppendPartitionByNameArgs {
  return &ThriftHiveMetastoreAppendPartitionByNameArgs{}
}


func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) GetPartName() string {
  return p.PartName
}
func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.PartName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("append_partition_by_name_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_name: ", p), err) }
  if err := oprot.WriteString(string(p.PartName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.part_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAppendPartitionByNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreAppendPartitionByNameResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *InvalidObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *AlreadyExistsException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreAppendPartitionByNameResult() *ThriftHiveMetastoreAppendPartitionByNameResult {
  return &ThriftHiveMetastoreAppendPartitionByNameResult{}
}

var ThriftHiveMetastoreAppendPartitionByNameResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreAppendPartitionByNameResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreAppendPartitionByNameResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreAppendPartitionByNameResult_O1_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreAppendPartitionByNameResult) GetO1() *InvalidObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAppendPartitionByNameResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAppendPartitionByNameResult_O2_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreAppendPartitionByNameResult) GetO2() *AlreadyExistsException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAppendPartitionByNameResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreAppendPartitionByNameResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAppendPartitionByNameResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreAppendPartitionByNameResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreAppendPartitionByNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &AlreadyExistsException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("append_partition_by_name_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAppendPartitionByNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAppendPartitionByNameResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
//  - DeleteData
type ThriftHiveMetastoreDropPartitionArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
  DeleteData bool `thrift:"deleteData,4" db:"deleteData" json:"deleteData"`
}

func NewThriftHiveMetastoreDropPartitionArgs() *ThriftHiveMetastoreDropPartitionArgs {
  return &ThriftHiveMetastoreDropPartitionArgs{}
}


func (p *ThriftHiveMetastoreDropPartitionArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreDropPartitionArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreDropPartitionArgs) GetPartVals() []string {
  return p.PartVals
}

func (p *ThriftHiveMetastoreDropPartitionArgs) GetDeleteData() bool {
  return p.DeleteData
}
func (p *ThriftHiveMetastoreDropPartitionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem156 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem156 = v
}
    p.PartVals = append(p.PartVals, _elem156)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.DeleteData = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_partition_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deleteData", thrift.BOOL, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:deleteData: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeleteData)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deleteData (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:deleteData: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropPartitionArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreDropPartitionResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreDropPartitionResult() *ThriftHiveMetastoreDropPartitionResult {
  return &ThriftHiveMetastoreDropPartitionResult{}
}

var ThriftHiveMetastoreDropPartitionResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreDropPartitionResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreDropPartitionResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreDropPartitionResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropPartitionResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropPartitionResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropPartitionResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropPartitionResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreDropPartitionResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreDropPartitionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreDropPartitionResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropPartitionResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreDropPartitionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_partition_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropPartitionResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartName
//  - DeleteData
type ThriftHiveMetastoreDropPartitionByNameArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartName string `thrift:"part_name,3" db:"part_name" json:"part_name"`
  DeleteData bool `thrift:"deleteData,4" db:"deleteData" json:"deleteData"`
}

func NewThriftHiveMetastoreDropPartitionByNameArgs() *ThriftHiveMetastoreDropPartitionByNameArgs {
  return &ThriftHiveMetastoreDropPartitionByNameArgs{}
}


func (p *ThriftHiveMetastoreDropPartitionByNameArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) GetPartName() string {
  return p.PartName
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) GetDeleteData() bool {
  return p.DeleteData
}
func (p *ThriftHiveMetastoreDropPartitionByNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.PartName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.DeleteData = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_partition_by_name_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_name: ", p), err) }
  if err := oprot.WriteString(string(p.PartName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.part_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deleteData", thrift.BOOL, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:deleteData: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeleteData)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deleteData (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:deleteData: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropPartitionByNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreDropPartitionByNameResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreDropPartitionByNameResult() *ThriftHiveMetastoreDropPartitionByNameResult {
  return &ThriftHiveMetastoreDropPartitionByNameResult{}
}

var ThriftHiveMetastoreDropPartitionByNameResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreDropPartitionByNameResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreDropPartitionByNameResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreDropPartitionByNameResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropPartitionByNameResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropPartitionByNameResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropPartitionByNameResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropPartitionByNameResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreDropPartitionByNameResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreDropPartitionByNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_partition_by_name_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropPartitionByNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropPartitionByNameResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
type ThriftHiveMetastoreGetPartitionArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
}

func NewThriftHiveMetastoreGetPartitionArgs() *ThriftHiveMetastoreGetPartitionArgs {
  return &ThriftHiveMetastoreGetPartitionArgs{}
}


func (p *ThriftHiveMetastoreGetPartitionArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionArgs) GetPartVals() []string {
  return p.PartVals
}
func (p *ThriftHiveMetastoreGetPartitionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem157 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem157 = v
}
    p.PartVals = append(p.PartVals, _elem157)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionResult() *ThriftHiveMetastoreGetPartitionResult {
  return &ThriftHiveMetastoreGetPartitionResult{}
}

var ThriftHiveMetastoreGetPartitionResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreGetPartitionResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetPartitionResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetPartitionResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
//  - UserName
//  - GroupNames
type ThriftHiveMetastoreGetPartitionWithAuthArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
  UserName string `thrift:"user_name,4" db:"user_name" json:"user_name"`
  GroupNames []string `thrift:"group_names,5" db:"group_names" json:"group_names"`
}

func NewThriftHiveMetastoreGetPartitionWithAuthArgs() *ThriftHiveMetastoreGetPartitionWithAuthArgs {
  return &ThriftHiveMetastoreGetPartitionWithAuthArgs{}
}


func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) GetPartVals() []string {
  return p.PartVals
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) GetUserName() string {
  return p.UserName
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) GetGroupNames() []string {
  return p.GroupNames
}
func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem158 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem158 = v
}
    p.PartVals = append(p.PartVals, _elem158)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.UserName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs)  ReadField5(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.GroupNames =  tSlice
  for i := 0; i < size; i ++ {
var _elem159 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem159 = v
}
    p.GroupNames = append(p.GroupNames, _elem159)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_with_auth_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) }
  if err := oprot.WriteString(string(p.UserName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("group_names", thrift.LIST, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:group_names: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.GroupNames)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.GroupNames {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:group_names: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionWithAuthArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionWithAuthResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionWithAuthResult() *ThriftHiveMetastoreGetPartitionWithAuthResult {
  return &ThriftHiveMetastoreGetPartitionWithAuthResult{}
}

var ThriftHiveMetastoreGetPartitionWithAuthResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetPartitionWithAuthResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetPartitionWithAuthResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionWithAuthResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionWithAuthResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionWithAuthResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_with_auth_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionWithAuthResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionWithAuthResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartName
type ThriftHiveMetastoreGetPartitionByNameArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartName string `thrift:"part_name,3" db:"part_name" json:"part_name"`
}

func NewThriftHiveMetastoreGetPartitionByNameArgs() *ThriftHiveMetastoreGetPartitionByNameArgs {
  return &ThriftHiveMetastoreGetPartitionByNameArgs{}
}


func (p *ThriftHiveMetastoreGetPartitionByNameArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) GetPartName() string {
  return p.PartName
}
func (p *ThriftHiveMetastoreGetPartitionByNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.PartName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_by_name_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_name: ", p), err) }
  if err := oprot.WriteString(string(p.PartName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.part_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionByNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionByNameResult struct {
  Success *Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionByNameResult() *ThriftHiveMetastoreGetPartitionByNameResult {
  return &ThriftHiveMetastoreGetPartitionByNameResult{}
}

var ThriftHiveMetastoreGetPartitionByNameResult_Success_DEFAULT *Partition
func (p *ThriftHiveMetastoreGetPartitionByNameResult) GetSuccess() *Partition {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetPartitionByNameResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetPartitionByNameResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionByNameResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionByNameResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionByNameResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionByNameResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionByNameResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionByNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Partition{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_by_name_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionByNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionByNameResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - MaxParts
type ThriftHiveMetastoreGetPartitionsArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  MaxParts int16 `thrift:"max_parts,3" db:"max_parts" json:"max_parts"`
}

func NewThriftHiveMetastoreGetPartitionsArgs() *ThriftHiveMetastoreGetPartitionsArgs {
  return &ThriftHiveMetastoreGetPartitionsArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionsArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) GetMaxParts() int16 {
  return p.MaxParts
}
func (p *ThriftHiveMetastoreGetPartitionsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionsResult struct {
  Success []*Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionsResult() *ThriftHiveMetastoreGetPartitionsResult {
  return &ThriftHiveMetastoreGetPartitionsResult{}
}

var ThriftHiveMetastoreGetPartitionsResult_Success_DEFAULT []*Partition

func (p *ThriftHiveMetastoreGetPartitionsResult) GetSuccess() []*Partition {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionsResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionsResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionsResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionsResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionsResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionsResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Partition, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem160 := &Partition{}
    if err := _elem160.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem160), err)
    }
    p.Success = append(p.Success, _elem160)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - MaxParts
//  - UserName
//  - GroupNames
type ThriftHiveMetastoreGetPartitionsWithAuthArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  MaxParts int16 `thrift:"max_parts,3" db:"max_parts" json:"max_parts"`
  UserName string `thrift:"user_name,4" db:"user_name" json:"user_name"`
  GroupNames []string `thrift:"group_names,5" db:"group_names" json:"group_names"`
}

func NewThriftHiveMetastoreGetPartitionsWithAuthArgs() *ThriftHiveMetastoreGetPartitionsWithAuthArgs {
  return &ThriftHiveMetastoreGetPartitionsWithAuthArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) GetMaxParts() int16 {
  return p.MaxParts
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) GetUserName() string {
  return p.UserName
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) GetGroupNames() []string {
  return p.GroupNames
}
func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.UserName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs)  ReadField5(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.GroupNames =  tSlice
  for i := 0; i < size; i ++ {
var _elem161 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem161 = v
}
    p.GroupNames = append(p.GroupNames, _elem161)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_with_auth_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:user_name: ", p), err) }
  if err := oprot.WriteString(string(p.UserName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("group_names", thrift.LIST, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:group_names: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.GroupNames)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.GroupNames {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:group_names: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsWithAuthArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionsWithAuthResult struct {
  Success []*Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionsWithAuthResult() *ThriftHiveMetastoreGetPartitionsWithAuthResult {
  return &ThriftHiveMetastoreGetPartitionsWithAuthResult{}
}

var ThriftHiveMetastoreGetPartitionsWithAuthResult_Success_DEFAULT []*Partition

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) GetSuccess() []*Partition {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionsWithAuthResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionsWithAuthResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionsWithAuthResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionsWithAuthResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Partition, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem162 := &Partition{}
    if err := _elem162.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem162), err)
    }
    p.Success = append(p.Success, _elem162)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_with_auth_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsWithAuthResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsWithAuthResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - MaxParts
type ThriftHiveMetastoreGetPartitionNamesArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  MaxParts int16 `thrift:"max_parts,3" db:"max_parts" json:"max_parts"`
}

func NewThriftHiveMetastoreGetPartitionNamesArgs() *ThriftHiveMetastoreGetPartitionNamesArgs {
  return &ThriftHiveMetastoreGetPartitionNamesArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionNamesArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) GetMaxParts() int16 {
  return p.MaxParts
}
func (p *ThriftHiveMetastoreGetPartitionNamesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_names_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionNamesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O2
type ThriftHiveMetastoreGetPartitionNamesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O2 *MetaException `thrift:"o2,1" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionNamesResult() *ThriftHiveMetastoreGetPartitionNamesResult {
  return &ThriftHiveMetastoreGetPartitionNamesResult{}
}

var ThriftHiveMetastoreGetPartitionNamesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetPartitionNamesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionNamesResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionNamesResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionNamesResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionNamesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem163 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem163 = v
}
    p.Success = append(p.Success, _elem163)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_names_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionNamesResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
type ThriftHiveMetastoreGetPartitionsPsArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
  MaxParts int16 `thrift:"max_parts,4" db:"max_parts" json:"max_parts"`
}

func NewThriftHiveMetastoreGetPartitionsPsArgs() *ThriftHiveMetastoreGetPartitionsPsArgs {
  return &ThriftHiveMetastoreGetPartitionsPsArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionsPsArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) GetPartVals() []string {
  return p.PartVals
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) GetMaxParts() int16 {
  return p.MaxParts
}
func (p *ThriftHiveMetastoreGetPartitionsPsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem164 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem164 = v
}
    p.PartVals = append(p.PartVals, _elem164)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_ps_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsPsArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetPartitionsPsResult struct {
  Success []*Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionsPsResult() *ThriftHiveMetastoreGetPartitionsPsResult {
  return &ThriftHiveMetastoreGetPartitionsPsResult{}
}

var ThriftHiveMetastoreGetPartitionsPsResult_Success_DEFAULT []*Partition

func (p *ThriftHiveMetastoreGetPartitionsPsResult) GetSuccess() []*Partition {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionsPsResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionsPsResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionsPsResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetPartitionsPsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Partition, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem165 := &Partition{}
    if err := _elem165.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem165), err)
    }
    p.Success = append(p.Success, _elem165)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_ps_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsPsResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
//  - UserName
//  - GroupNames
type ThriftHiveMetastoreGetPartitionsPsWithAuthArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
  MaxParts int16 `thrift:"max_parts,4" db:"max_parts" json:"max_parts"`
  UserName string `thrift:"user_name,5" db:"user_name" json:"user_name"`
  GroupNames []string `thrift:"group_names,6" db:"group_names" json:"group_names"`
}

func NewThriftHiveMetastoreGetPartitionsPsWithAuthArgs() *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs {
  return &ThriftHiveMetastoreGetPartitionsPsWithAuthArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetPartVals() []string {
  return p.PartVals
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetMaxParts() int16 {
  return p.MaxParts
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetUserName() string {
  return p.UserName
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) GetGroupNames() []string {
  return p.GroupNames
}
func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem166 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem166 = v
}
    p.PartVals = append(p.PartVals, _elem166)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  p.UserName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs)  ReadField6(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.GroupNames =  tSlice
  for i := 0; i < size; i ++ {
var _elem167 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem167 = v
}
    p.GroupNames = append(p.GroupNames, _elem167)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_ps_with_auth_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:user_name: ", p), err) }
  if err := oprot.WriteString(string(p.UserName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.user_name (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:user_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("group_names", thrift.LIST, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:group_names: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.GroupNames)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.GroupNames {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:group_names: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsPsWithAuthArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionsPsWithAuthResult struct {
  Success []*Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionsPsWithAuthResult() *ThriftHiveMetastoreGetPartitionsPsWithAuthResult {
  return &ThriftHiveMetastoreGetPartitionsPsWithAuthResult{}
}

var ThriftHiveMetastoreGetPartitionsPsWithAuthResult_Success_DEFAULT []*Partition

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) GetSuccess() []*Partition {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionsPsWithAuthResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionsPsWithAuthResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionsPsWithAuthResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionsPsWithAuthResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Partition, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem168 := &Partition{}
    if err := _elem168.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem168), err)
    }
    p.Success = append(p.Success, _elem168)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_ps_with_auth_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsPsWithAuthResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsPsWithAuthResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - PartVals
//  - MaxParts
type ThriftHiveMetastoreGetPartitionNamesPsArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  PartVals []string `thrift:"part_vals,3" db:"part_vals" json:"part_vals"`
  MaxParts int16 `thrift:"max_parts,4" db:"max_parts" json:"max_parts"`
}

func NewThriftHiveMetastoreGetPartitionNamesPsArgs() *ThriftHiveMetastoreGetPartitionNamesPsArgs {
  return &ThriftHiveMetastoreGetPartitionNamesPsArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) GetPartVals() []string {
  return p.PartVals
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) GetMaxParts() int16 {
  return p.MaxParts
}
func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.PartVals =  tSlice
  for i := 0; i < size; i ++ {
var _elem169 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem169 = v
}
    p.PartVals = append(p.PartVals, _elem169)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_names_ps_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_vals", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_vals: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.PartVals)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.PartVals {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_vals: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionNamesPsArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetPartitionNamesPsResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionNamesPsResult() *ThriftHiveMetastoreGetPartitionNamesPsResult {
  return &ThriftHiveMetastoreGetPartitionNamesPsResult{}
}

var ThriftHiveMetastoreGetPartitionNamesPsResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionNamesPsResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionNamesPsResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem170 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem170 = v
}
    p.Success = append(p.Success, _elem170)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partition_names_ps_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionNamesPsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionNamesPsResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - Filter
//  - MaxParts
type ThriftHiveMetastoreGetPartitionsByFilterArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  Filter string `thrift:"filter,3" db:"filter" json:"filter"`
  MaxParts int16 `thrift:"max_parts,4" db:"max_parts" json:"max_parts"`
}

func NewThriftHiveMetastoreGetPartitionsByFilterArgs() *ThriftHiveMetastoreGetPartitionsByFilterArgs {
  return &ThriftHiveMetastoreGetPartitionsByFilterArgs{
MaxParts: -1,
}
}


func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) GetFilter() string {
  return p.Filter
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) GetMaxParts() int16 {
  return p.MaxParts
}
func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.Filter = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.MaxParts = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_by_filter_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("filter", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:filter: ", p), err) }
  if err := oprot.WriteString(string(p.Filter)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.filter (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:filter: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_parts", thrift.I16, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:max_parts: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxParts)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_parts (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:max_parts: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsByFilterArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetPartitionsByFilterResult struct {
  Success []*Partition `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetPartitionsByFilterResult() *ThriftHiveMetastoreGetPartitionsByFilterResult {
  return &ThriftHiveMetastoreGetPartitionsByFilterResult{}
}

var ThriftHiveMetastoreGetPartitionsByFilterResult_Success_DEFAULT []*Partition

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) GetSuccess() []*Partition {
  return p.Success
}
var ThriftHiveMetastoreGetPartitionsByFilterResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPartitionsByFilterResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetPartitionsByFilterResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetPartitionsByFilterResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Partition, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem171 := &Partition{}
    if err := _elem171.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem171), err)
    }
    p.Success = append(p.Success, _elem171)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_partitions_by_filter_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPartitionsByFilterResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPartitionsByFilterResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - NewPart_
type ThriftHiveMetastoreAlterPartitionArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  NewPart_ *Partition `thrift:"new_part,3" db:"new_part" json:"new_part"`
}

func NewThriftHiveMetastoreAlterPartitionArgs() *ThriftHiveMetastoreAlterPartitionArgs {
  return &ThriftHiveMetastoreAlterPartitionArgs{}
}


func (p *ThriftHiveMetastoreAlterPartitionArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) GetTblName() string {
  return p.TblName
}
var ThriftHiveMetastoreAlterPartitionArgs_NewPart__DEFAULT *Partition
func (p *ThriftHiveMetastoreAlterPartitionArgs) GetNewPart_() *Partition {
  if !p.IsSetNewPart_() {
    return ThriftHiveMetastoreAlterPartitionArgs_NewPart__DEFAULT
  }
return p.NewPart_
}
func (p *ThriftHiveMetastoreAlterPartitionArgs) IsSetNewPart_() bool {
  return p.NewPart_ != nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs)  ReadField3(iprot thrift.TProtocol) error {
  p.NewPart_ = &Partition{}
  if err := p.NewPart_.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewPart_), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_partition_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("new_part", thrift.STRUCT, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:new_part: ", p), err) }
  if err := p.NewPart_.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewPart_), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_part: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterPartitionArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterPartitionArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
type ThriftHiveMetastoreAlterPartitionResult struct {
  O1 *InvalidOperationException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreAlterPartitionResult() *ThriftHiveMetastoreAlterPartitionResult {
  return &ThriftHiveMetastoreAlterPartitionResult{}
}

var ThriftHiveMetastoreAlterPartitionResult_O1_DEFAULT *InvalidOperationException
func (p *ThriftHiveMetastoreAlterPartitionResult) GetO1() *InvalidOperationException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAlterPartitionResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAlterPartitionResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAlterPartitionResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAlterPartitionResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreAlterPartitionResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidOperationException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_partition_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterPartitionResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterPartitionResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterPartitionResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterPartitionResult(%+v)", *p)
}

// Attributes:
//  - Name
//  - DefaultValue
type ThriftHiveMetastoreGetConfigValueArgs struct {
  Name string `thrift:"name,1" db:"name" json:"name"`
  DefaultValue string `thrift:"defaultValue,2" db:"defaultValue" json:"defaultValue"`
}

func NewThriftHiveMetastoreGetConfigValueArgs() *ThriftHiveMetastoreGetConfigValueArgs {
  return &ThriftHiveMetastoreGetConfigValueArgs{}
}


func (p *ThriftHiveMetastoreGetConfigValueArgs) GetName() string {
  return p.Name
}

func (p *ThriftHiveMetastoreGetConfigValueArgs) GetDefaultValue() string {
  return p.DefaultValue
}
func (p *ThriftHiveMetastoreGetConfigValueArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Name = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.DefaultValue = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_config_value_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) }
  if err := oprot.WriteString(string(p.Name)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetConfigValueArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("defaultValue", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:defaultValue: ", p), err) }
  if err := oprot.WriteString(string(p.DefaultValue)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.defaultValue (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:defaultValue: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetConfigValueArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetConfigValueArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetConfigValueResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *ConfigValSecurityException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetConfigValueResult() *ThriftHiveMetastoreGetConfigValueResult {
  return &ThriftHiveMetastoreGetConfigValueResult{}
}

var ThriftHiveMetastoreGetConfigValueResult_Success_DEFAULT string
func (p *ThriftHiveMetastoreGetConfigValueResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetConfigValueResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreGetConfigValueResult_O1_DEFAULT *ConfigValSecurityException
func (p *ThriftHiveMetastoreGetConfigValueResult) GetO1() *ConfigValSecurityException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetConfigValueResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetConfigValueResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &ConfigValSecurityException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_config_value_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetConfigValueResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetConfigValueResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetConfigValueResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetConfigValueResult(%+v)", *p)
}

// Attributes:
//  - PartName
type ThriftHiveMetastorePartitionNameToValsArgs struct {
  PartName string `thrift:"part_name,1" db:"part_name" json:"part_name"`
}

func NewThriftHiveMetastorePartitionNameToValsArgs() *ThriftHiveMetastorePartitionNameToValsArgs {
  return &ThriftHiveMetastorePartitionNameToValsArgs{}
}


func (p *ThriftHiveMetastorePartitionNameToValsArgs) GetPartName() string {
  return p.PartName
}
func (p *ThriftHiveMetastorePartitionNameToValsArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.PartName = v
}
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("partition_name_to_vals_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_name: ", p), err) }
  if err := oprot.WriteString(string(p.PartName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.part_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToValsArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastorePartitionNameToValsArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastorePartitionNameToValsResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastorePartitionNameToValsResult() *ThriftHiveMetastorePartitionNameToValsResult {
  return &ThriftHiveMetastorePartitionNameToValsResult{}
}

var ThriftHiveMetastorePartitionNameToValsResult_Success_DEFAULT []string

func (p *ThriftHiveMetastorePartitionNameToValsResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastorePartitionNameToValsResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastorePartitionNameToValsResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastorePartitionNameToValsResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastorePartitionNameToValsResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem172 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem172 = v
}
    p.Success = append(p.Success, _elem172)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("partition_name_to_vals_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToValsResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastorePartitionNameToValsResult(%+v)", *p)
}

// Attributes:
//  - PartName
type ThriftHiveMetastorePartitionNameToSpecArgs struct {
  PartName string `thrift:"part_name,1" db:"part_name" json:"part_name"`
}

func NewThriftHiveMetastorePartitionNameToSpecArgs() *ThriftHiveMetastorePartitionNameToSpecArgs {
  return &ThriftHiveMetastorePartitionNameToSpecArgs{}
}


func (p *ThriftHiveMetastorePartitionNameToSpecArgs) GetPartName() string {
  return p.PartName
}
func (p *ThriftHiveMetastorePartitionNameToSpecArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.PartName = v
}
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("partition_name_to_spec_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("part_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_name: ", p), err) }
  if err := oprot.WriteString(string(p.PartName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.part_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToSpecArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastorePartitionNameToSpecArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastorePartitionNameToSpecResult struct {
  Success map[string]string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastorePartitionNameToSpecResult() *ThriftHiveMetastorePartitionNameToSpecResult {
  return &ThriftHiveMetastorePartitionNameToSpecResult{}
}

var ThriftHiveMetastorePartitionNameToSpecResult_Success_DEFAULT map[string]string

func (p *ThriftHiveMetastorePartitionNameToSpecResult) GetSuccess() map[string]string {
  return p.Success
}
var ThriftHiveMetastorePartitionNameToSpecResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastorePartitionNameToSpecResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastorePartitionNameToSpecResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastorePartitionNameToSpecResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.MAP {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult)  ReadField0(iprot thrift.TProtocol) error {
  _, _, size, err := iprot.ReadMapBegin()
  if err != nil {
    return thrift.PrependError("error reading map begin: ", err)
  }
  tMap := make(map[string]string, size)
  p.Success =  tMap
  for i := 0; i < size; i ++ {
var _key173 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _key173 = v
}
var _val174 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _val174 = v
}
    p.Success[_key173] = _val174
  }
  if err := iprot.ReadMapEnd(); err != nil {
    return thrift.PrependError("error reading map end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("partition_name_to_spec_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.MAP, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing map begin: ", err)
    }
    for k, v := range p.Success {
      if err := oprot.WriteString(string(k)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteMapEnd(); err != nil {
      return thrift.PrependError("error writing map end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastorePartitionNameToSpecResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastorePartitionNameToSpecResult(%+v)", *p)
}

// Attributes:
//  - NewIndex_
//  - IndexTable
type ThriftHiveMetastoreAddIndexArgs struct {
  NewIndex_ *Index `thrift:"new_index,1" db:"new_index" json:"new_index"`
  IndexTable *Table `thrift:"index_table,2" db:"index_table" json:"index_table"`
}

func NewThriftHiveMetastoreAddIndexArgs() *ThriftHiveMetastoreAddIndexArgs {
  return &ThriftHiveMetastoreAddIndexArgs{}
}

var ThriftHiveMetastoreAddIndexArgs_NewIndex__DEFAULT *Index
func (p *ThriftHiveMetastoreAddIndexArgs) GetNewIndex_() *Index {
  if !p.IsSetNewIndex_() {
    return ThriftHiveMetastoreAddIndexArgs_NewIndex__DEFAULT
  }
return p.NewIndex_
}
var ThriftHiveMetastoreAddIndexArgs_IndexTable_DEFAULT *Table
func (p *ThriftHiveMetastoreAddIndexArgs) GetIndexTable() *Table {
  if !p.IsSetIndexTable() {
    return ThriftHiveMetastoreAddIndexArgs_IndexTable_DEFAULT
  }
return p.IndexTable
}
func (p *ThriftHiveMetastoreAddIndexArgs) IsSetNewIndex_() bool {
  return p.NewIndex_ != nil
}

func (p *ThriftHiveMetastoreAddIndexArgs) IsSetIndexTable() bool {
  return p.IndexTable != nil
}

func (p *ThriftHiveMetastoreAddIndexArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.NewIndex_ = &Index{}
  if err := p.NewIndex_.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewIndex_), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexArgs)  ReadField2(iprot thrift.TProtocol) error {
  p.IndexTable = &Table{}
  if err := p.IndexTable.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexTable), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("add_index_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("new_index", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:new_index: ", p), err) }
  if err := p.NewIndex_.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewIndex_), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:new_index: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAddIndexArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("index_table", thrift.STRUCT, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:index_table: ", p), err) }
  if err := p.IndexTable.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexTable), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_table: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAddIndexArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAddIndexArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
//  - O3
type ThriftHiveMetastoreAddIndexResult struct {
  Success *Index `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *InvalidObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *AlreadyExistsException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
  O3 *MetaException `thrift:"o3,3" db:"o3" json:"o3,omitempty"`
}

func NewThriftHiveMetastoreAddIndexResult() *ThriftHiveMetastoreAddIndexResult {
  return &ThriftHiveMetastoreAddIndexResult{}
}

var ThriftHiveMetastoreAddIndexResult_Success_DEFAULT *Index
func (p *ThriftHiveMetastoreAddIndexResult) GetSuccess() *Index {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreAddIndexResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreAddIndexResult_O1_DEFAULT *InvalidObjectException
func (p *ThriftHiveMetastoreAddIndexResult) GetO1() *InvalidObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAddIndexResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAddIndexResult_O2_DEFAULT *AlreadyExistsException
func (p *ThriftHiveMetastoreAddIndexResult) GetO2() *AlreadyExistsException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAddIndexResult_O2_DEFAULT
  }
return p.O2
}
var ThriftHiveMetastoreAddIndexResult_O3_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAddIndexResult) GetO3() *MetaException {
  if !p.IsSetO3() {
    return ThriftHiveMetastoreAddIndexResult_O3_DEFAULT
  }
return p.O3
}
func (p *ThriftHiveMetastoreAddIndexResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreAddIndexResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAddIndexResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAddIndexResult) IsSetO3() bool {
  return p.O3 != nil
}

func (p *ThriftHiveMetastoreAddIndexResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Index{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &AlreadyExistsException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult)  ReadField3(iprot thrift.TProtocol) error {
  p.O3 = &MetaException{}
  if err := p.O3.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O3), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("add_index_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAddIndexResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddIndexResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddIndexResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddIndexResult) writeField3(oprot thrift.TProtocol) (err error) {
  if p.IsSetO3() {
    if err := oprot.WriteFieldBegin("o3", thrift.STRUCT, 3); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:o3: ", p), err) }
    if err := p.O3.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O3), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 3:o3: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAddIndexResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAddIndexResult(%+v)", *p)
}

// Attributes:
//  - Dbname
//  - BaseTblName
//  - IdxName
//  - NewIdx_
type ThriftHiveMetastoreAlterIndexArgs struct {
  Dbname string `thrift:"dbname,1" db:"dbname" json:"dbname"`
  BaseTblName string `thrift:"base_tbl_name,2" db:"base_tbl_name" json:"base_tbl_name"`
  IdxName string `thrift:"idx_name,3" db:"idx_name" json:"idx_name"`
  NewIdx_ *Index `thrift:"new_idx,4" db:"new_idx" json:"new_idx"`
}

func NewThriftHiveMetastoreAlterIndexArgs() *ThriftHiveMetastoreAlterIndexArgs {
  return &ThriftHiveMetastoreAlterIndexArgs{}
}


func (p *ThriftHiveMetastoreAlterIndexArgs) GetDbname() string {
  return p.Dbname
}

func (p *ThriftHiveMetastoreAlterIndexArgs) GetBaseTblName() string {
  return p.BaseTblName
}

func (p *ThriftHiveMetastoreAlterIndexArgs) GetIdxName() string {
  return p.IdxName
}
var ThriftHiveMetastoreAlterIndexArgs_NewIdx__DEFAULT *Index
func (p *ThriftHiveMetastoreAlterIndexArgs) GetNewIdx_() *Index {
  if !p.IsSetNewIdx_() {
    return ThriftHiveMetastoreAlterIndexArgs_NewIdx__DEFAULT
  }
return p.NewIdx_
}
func (p *ThriftHiveMetastoreAlterIndexArgs) IsSetNewIdx_() bool {
  return p.NewIdx_ != nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.Dbname = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.BaseTblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.IdxName = v
}
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs)  ReadField4(iprot thrift.TProtocol) error {
  p.NewIdx_ = &Index{}
  if err := p.NewIdx_.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewIdx_), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_index_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("dbname", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dbname: ", p), err) }
  if err := oprot.WriteString(string(p.Dbname)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.dbname (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dbname: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("base_tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:base_tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.BaseTblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.base_tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:base_tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("idx_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:idx_name: ", p), err) }
  if err := oprot.WriteString(string(p.IdxName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.idx_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:idx_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("new_idx", thrift.STRUCT, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:new_idx: ", p), err) }
  if err := p.NewIdx_.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewIdx_), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:new_idx: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterIndexArgs(%+v)", *p)
}

// Attributes:
//  - O1
//  - O2
type ThriftHiveMetastoreAlterIndexResult struct {
  O1 *InvalidOperationException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreAlterIndexResult() *ThriftHiveMetastoreAlterIndexResult {
  return &ThriftHiveMetastoreAlterIndexResult{}
}

var ThriftHiveMetastoreAlterIndexResult_O1_DEFAULT *InvalidOperationException
func (p *ThriftHiveMetastoreAlterIndexResult) GetO1() *InvalidOperationException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreAlterIndexResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreAlterIndexResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreAlterIndexResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreAlterIndexResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreAlterIndexResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreAlterIndexResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreAlterIndexResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &InvalidOperationException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("alter_index_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreAlterIndexResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreAlterIndexResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreAlterIndexResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - IndexName
//  - DeleteData
type ThriftHiveMetastoreDropIndexByNameArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  IndexName string `thrift:"index_name,3" db:"index_name" json:"index_name"`
  DeleteData bool `thrift:"deleteData,4" db:"deleteData" json:"deleteData"`
}

func NewThriftHiveMetastoreDropIndexByNameArgs() *ThriftHiveMetastoreDropIndexByNameArgs {
  return &ThriftHiveMetastoreDropIndexByNameArgs{}
}


func (p *ThriftHiveMetastoreDropIndexByNameArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) GetIndexName() string {
  return p.IndexName
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) GetDeleteData() bool {
  return p.DeleteData
}
func (p *ThriftHiveMetastoreDropIndexByNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.IndexName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.DeleteData = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_index_by_name_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_name: ", p), err) }
  if err := oprot.WriteString(string(p.IndexName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.index_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("deleteData", thrift.BOOL, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:deleteData: ", p), err) }
  if err := oprot.WriteBool(bool(p.DeleteData)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.deleteData (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:deleteData: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropIndexByNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreDropIndexByNameResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreDropIndexByNameResult() *ThriftHiveMetastoreDropIndexByNameResult {
  return &ThriftHiveMetastoreDropIndexByNameResult{}
}

var ThriftHiveMetastoreDropIndexByNameResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreDropIndexByNameResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreDropIndexByNameResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreDropIndexByNameResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreDropIndexByNameResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropIndexByNameResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreDropIndexByNameResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropIndexByNameResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreDropIndexByNameResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreDropIndexByNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_index_by_name_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropIndexByNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropIndexByNameResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - IndexName
type ThriftHiveMetastoreGetIndexByNameArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  IndexName string `thrift:"index_name,3" db:"index_name" json:"index_name"`
}

func NewThriftHiveMetastoreGetIndexByNameArgs() *ThriftHiveMetastoreGetIndexByNameArgs {
  return &ThriftHiveMetastoreGetIndexByNameArgs{}
}


func (p *ThriftHiveMetastoreGetIndexByNameArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) GetIndexName() string {
  return p.IndexName
}
func (p *ThriftHiveMetastoreGetIndexByNameArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.IndexName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_index_by_name_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("index_name", thrift.STRING, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:index_name: ", p), err) }
  if err := oprot.WriteString(string(p.IndexName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.index_name (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexByNameArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetIndexByNameResult struct {
  Success *Index `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *NoSuchObjectException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetIndexByNameResult() *ThriftHiveMetastoreGetIndexByNameResult {
  return &ThriftHiveMetastoreGetIndexByNameResult{}
}

var ThriftHiveMetastoreGetIndexByNameResult_Success_DEFAULT *Index
func (p *ThriftHiveMetastoreGetIndexByNameResult) GetSuccess() *Index {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetIndexByNameResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetIndexByNameResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetIndexByNameResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetIndexByNameResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetIndexByNameResult_O2_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetIndexByNameResult) GetO2() *NoSuchObjectException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetIndexByNameResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetIndexByNameResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &Index{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &NoSuchObjectException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_index_by_name_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexByNameResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexByNameResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - MaxIndexes
type ThriftHiveMetastoreGetIndexesArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  MaxIndexes int16 `thrift:"max_indexes,3" db:"max_indexes" json:"max_indexes"`
}

func NewThriftHiveMetastoreGetIndexesArgs() *ThriftHiveMetastoreGetIndexesArgs {
  return &ThriftHiveMetastoreGetIndexesArgs{
MaxIndexes: -1,
}
}


func (p *ThriftHiveMetastoreGetIndexesArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetIndexesArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetIndexesArgs) GetMaxIndexes() int16 {
  return p.MaxIndexes
}
func (p *ThriftHiveMetastoreGetIndexesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxIndexes = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_indexes_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_indexes", thrift.I16, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_indexes: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxIndexes)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_indexes (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_indexes: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
//  - O2
type ThriftHiveMetastoreGetIndexesResult struct {
  Success []*Index `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *NoSuchObjectException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
  O2 *MetaException `thrift:"o2,2" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetIndexesResult() *ThriftHiveMetastoreGetIndexesResult {
  return &ThriftHiveMetastoreGetIndexesResult{}
}

var ThriftHiveMetastoreGetIndexesResult_Success_DEFAULT []*Index

func (p *ThriftHiveMetastoreGetIndexesResult) GetSuccess() []*Index {
  return p.Success
}
var ThriftHiveMetastoreGetIndexesResult_O1_DEFAULT *NoSuchObjectException
func (p *ThriftHiveMetastoreGetIndexesResult) GetO1() *NoSuchObjectException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetIndexesResult_O1_DEFAULT
  }
return p.O1
}
var ThriftHiveMetastoreGetIndexesResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetIndexesResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetIndexesResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetIndexesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetIndexesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetIndexesResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetIndexesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Index, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem175 := &Index{}
    if err := _elem175.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem175), err)
    }
    p.Success = append(p.Success, _elem175)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &NoSuchObjectException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesResult)  ReadField2(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_indexes_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesResult) writeField2(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 2); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 2:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexesResult(%+v)", *p)
}

// Attributes:
//  - DbName
//  - TblName
//  - MaxIndexes
type ThriftHiveMetastoreGetIndexNamesArgs struct {
  DbName string `thrift:"db_name,1" db:"db_name" json:"db_name"`
  TblName string `thrift:"tbl_name,2" db:"tbl_name" json:"tbl_name"`
  MaxIndexes int16 `thrift:"max_indexes,3" db:"max_indexes" json:"max_indexes"`
}

func NewThriftHiveMetastoreGetIndexNamesArgs() *ThriftHiveMetastoreGetIndexNamesArgs {
  return &ThriftHiveMetastoreGetIndexNamesArgs{
MaxIndexes: -1,
}
}


func (p *ThriftHiveMetastoreGetIndexNamesArgs) GetDbName() string {
  return p.DbName
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) GetTblName() string {
  return p.TblName
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) GetMaxIndexes() int16 {
  return p.MaxIndexes
}
func (p *ThriftHiveMetastoreGetIndexNamesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I16 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.DbName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TblName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI16(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  p.MaxIndexes = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_index_names_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("db_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:db_name: ", p), err) }
  if err := oprot.WriteString(string(p.DbName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.db_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:db_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("tbl_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tbl_name: ", p), err) }
  if err := oprot.WriteString(string(p.TblName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.tbl_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tbl_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("max_indexes", thrift.I16, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:max_indexes: ", p), err) }
  if err := oprot.WriteI16(int16(p.MaxIndexes)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.max_indexes (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:max_indexes: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetIndexNamesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexNamesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O2
type ThriftHiveMetastoreGetIndexNamesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O2 *MetaException `thrift:"o2,1" db:"o2" json:"o2,omitempty"`
}

func NewThriftHiveMetastoreGetIndexNamesResult() *ThriftHiveMetastoreGetIndexNamesResult {
  return &ThriftHiveMetastoreGetIndexNamesResult{}
}

var ThriftHiveMetastoreGetIndexNamesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetIndexNamesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetIndexNamesResult_O2_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetIndexNamesResult) GetO2() *MetaException {
  if !p.IsSetO2() {
    return ThriftHiveMetastoreGetIndexNamesResult_O2_DEFAULT
  }
return p.O2
}
func (p *ThriftHiveMetastoreGetIndexNamesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) IsSetO2() bool {
  return p.O2 != nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem176 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem176 = v
}
    p.Success = append(p.Success, _elem176)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O2 = &MetaException{}
  if err := p.O2.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O2), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_index_names_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO2() {
    if err := oprot.WriteFieldBegin("o2", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o2: ", p), err) }
    if err := p.O2.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O2), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o2: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetIndexNamesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetIndexNamesResult(%+v)", *p)
}

// Attributes:
//  - Role
type ThriftHiveMetastoreCreateRoleArgs struct {
  Role *Role `thrift:"role,1" db:"role" json:"role"`
}

func NewThriftHiveMetastoreCreateRoleArgs() *ThriftHiveMetastoreCreateRoleArgs {
  return &ThriftHiveMetastoreCreateRoleArgs{}
}

var ThriftHiveMetastoreCreateRoleArgs_Role_DEFAULT *Role
func (p *ThriftHiveMetastoreCreateRoleArgs) GetRole() *Role {
  if !p.IsSetRole() {
    return ThriftHiveMetastoreCreateRoleArgs_Role_DEFAULT
  }
return p.Role
}
func (p *ThriftHiveMetastoreCreateRoleArgs) IsSetRole() bool {
  return p.Role != nil
}

func (p *ThriftHiveMetastoreCreateRoleArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Role = &Role{}
  if err := p.Role.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Role), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_role_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("role", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) }
  if err := p.Role.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Role), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreCreateRoleArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateRoleArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreCreateRoleResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreCreateRoleResult() *ThriftHiveMetastoreCreateRoleResult {
  return &ThriftHiveMetastoreCreateRoleResult{}
}

var ThriftHiveMetastoreCreateRoleResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreCreateRoleResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreCreateRoleResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreCreateRoleResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreCreateRoleResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreCreateRoleResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreCreateRoleResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreCreateRoleResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreCreateRoleResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("create_role_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCreateRoleResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateRoleResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCreateRoleResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCreateRoleResult(%+v)", *p)
}

// Attributes:
//  - RoleName
type ThriftHiveMetastoreDropRoleArgs struct {
  RoleName string `thrift:"role_name,1" db:"role_name" json:"role_name"`
}

func NewThriftHiveMetastoreDropRoleArgs() *ThriftHiveMetastoreDropRoleArgs {
  return &ThriftHiveMetastoreDropRoleArgs{}
}


func (p *ThriftHiveMetastoreDropRoleArgs) GetRoleName() string {
  return p.RoleName
}
func (p *ThriftHiveMetastoreDropRoleArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropRoleArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RoleName = v
}
  return nil
}

func (p *ThriftHiveMetastoreDropRoleArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_role_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropRoleArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("role_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_name: ", p), err) }
  if err := oprot.WriteString(string(p.RoleName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.role_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreDropRoleArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropRoleArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreDropRoleResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreDropRoleResult() *ThriftHiveMetastoreDropRoleResult {
  return &ThriftHiveMetastoreDropRoleResult{}
}

var ThriftHiveMetastoreDropRoleResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreDropRoleResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreDropRoleResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreDropRoleResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreDropRoleResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreDropRoleResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreDropRoleResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreDropRoleResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreDropRoleResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropRoleResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreDropRoleResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreDropRoleResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("drop_role_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreDropRoleResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropRoleResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreDropRoleResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreDropRoleResult(%+v)", *p)
}

type ThriftHiveMetastoreGetRoleNamesArgs struct {
}

func NewThriftHiveMetastoreGetRoleNamesArgs() *ThriftHiveMetastoreGetRoleNamesArgs {
  return &ThriftHiveMetastoreGetRoleNamesArgs{}
}

func (p *ThriftHiveMetastoreGetRoleNamesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    if err := iprot.Skip(fieldTypeId); err != nil {
      return err
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_role_names_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetRoleNamesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetRoleNamesResult struct {
  Success []string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetRoleNamesResult() *ThriftHiveMetastoreGetRoleNamesResult {
  return &ThriftHiveMetastoreGetRoleNamesResult{}
}

var ThriftHiveMetastoreGetRoleNamesResult_Success_DEFAULT []string

func (p *ThriftHiveMetastoreGetRoleNamesResult) GetSuccess() []string {
  return p.Success
}
var ThriftHiveMetastoreGetRoleNamesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetRoleNamesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetRoleNamesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetRoleNamesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
var _elem177 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem177 = v
}
    p.Success = append(p.Success, _elem177)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_role_names_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRING, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := oprot.WriteString(string(v)); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetRoleNamesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetRoleNamesResult(%+v)", *p)
}

// Attributes:
//  - RoleName
//  - PrincipalName
//  - PrincipalType
//  - Grantor
//  - GrantorType
//  - GrantOption
type ThriftHiveMetastoreGrantRoleArgs struct {
  RoleName string `thrift:"role_name,1" db:"role_name" json:"role_name"`
  PrincipalName string `thrift:"principal_name,2" db:"principal_name" json:"principal_name"`
  PrincipalType PrincipalType `thrift:"principal_type,3" db:"principal_type" json:"principal_type"`
  Grantor string `thrift:"grantor,4" db:"grantor" json:"grantor"`
  GrantorType PrincipalType `thrift:"grantorType,5" db:"grantorType" json:"grantorType"`
  GrantOption bool `thrift:"grant_option,6" db:"grant_option" json:"grant_option"`
}

func NewThriftHiveMetastoreGrantRoleArgs() *ThriftHiveMetastoreGrantRoleArgs {
  return &ThriftHiveMetastoreGrantRoleArgs{}
}


func (p *ThriftHiveMetastoreGrantRoleArgs) GetRoleName() string {
  return p.RoleName
}

func (p *ThriftHiveMetastoreGrantRoleArgs) GetPrincipalName() string {
  return p.PrincipalName
}

func (p *ThriftHiveMetastoreGrantRoleArgs) GetPrincipalType() PrincipalType {
  return p.PrincipalType
}

func (p *ThriftHiveMetastoreGrantRoleArgs) GetGrantor() string {
  return p.Grantor
}

func (p *ThriftHiveMetastoreGrantRoleArgs) GetGrantorType() PrincipalType {
  return p.GrantorType
}

func (p *ThriftHiveMetastoreGrantRoleArgs) GetGrantOption() bool {
  return p.GrantOption
}
func (p *ThriftHiveMetastoreGrantRoleArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 4:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField4(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 5:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField5(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 6:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField6(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RoleName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.PrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := PrincipalType(v)
  p.PrincipalType = temp
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField4(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 4: ", err)
} else {
  p.Grantor = v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField5(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 5: ", err)
} else {
  temp := PrincipalType(v)
  p.GrantorType = temp
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs)  ReadField6(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 6: ", err)
} else {
  p.GrantOption = v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("grant_role_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
    if err := p.writeField4(oprot); err != nil { return err }
    if err := p.writeField5(oprot); err != nil { return err }
    if err := p.writeField6(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("role_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_name: ", p), err) }
  if err := oprot.WriteString(string(p.RoleName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.role_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.PrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_type", thrift.I32, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:principal_type: ", p), err) }
  if err := oprot.WriteI32(int32(p.PrincipalType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_type (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:principal_type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField4(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantor", thrift.STRING, 4); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:grantor: ", p), err) }
  if err := oprot.WriteString(string(p.Grantor)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grantor (4) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 4:grantor: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField5(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grantorType", thrift.I32, 5); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:grantorType: ", p), err) }
  if err := oprot.WriteI32(int32(p.GrantorType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grantorType (5) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 5:grantorType: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) writeField6(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("grant_option", thrift.BOOL, 6); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:grant_option: ", p), err) }
  if err := oprot.WriteBool(bool(p.GrantOption)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.grant_option (6) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 6:grant_option: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGrantRoleArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGrantRoleResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGrantRoleResult() *ThriftHiveMetastoreGrantRoleResult {
  return &ThriftHiveMetastoreGrantRoleResult{}
}

var ThriftHiveMetastoreGrantRoleResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreGrantRoleResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGrantRoleResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreGrantRoleResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGrantRoleResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGrantRoleResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGrantRoleResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGrantRoleResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGrantRoleResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("grant_role_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGrantRoleResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGrantRoleResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGrantRoleResult(%+v)", *p)
}

// Attributes:
//  - RoleName
//  - PrincipalName
//  - PrincipalType
type ThriftHiveMetastoreRevokeRoleArgs struct {
  RoleName string `thrift:"role_name,1" db:"role_name" json:"role_name"`
  PrincipalName string `thrift:"principal_name,2" db:"principal_name" json:"principal_name"`
  PrincipalType PrincipalType `thrift:"principal_type,3" db:"principal_type" json:"principal_type"`
}

func NewThriftHiveMetastoreRevokeRoleArgs() *ThriftHiveMetastoreRevokeRoleArgs {
  return &ThriftHiveMetastoreRevokeRoleArgs{}
}


func (p *ThriftHiveMetastoreRevokeRoleArgs) GetRoleName() string {
  return p.RoleName
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) GetPrincipalName() string {
  return p.PrincipalName
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) GetPrincipalType() PrincipalType {
  return p.PrincipalType
}
func (p *ThriftHiveMetastoreRevokeRoleArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RoleName = v
}
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.PrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleArgs)  ReadField3(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 3: ", err)
} else {
  temp := PrincipalType(v)
  p.PrincipalType = temp
}
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("revoke_role_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("role_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role_name: ", p), err) }
  if err := oprot.WriteString(string(p.RoleName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.role_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.PrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_type", thrift.I32, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:principal_type: ", p), err) }
  if err := oprot.WriteI32(int32(p.PrincipalType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_type (3) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:principal_type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreRevokeRoleArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRevokeRoleArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreRevokeRoleResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreRevokeRoleResult() *ThriftHiveMetastoreRevokeRoleResult {
  return &ThriftHiveMetastoreRevokeRoleResult{}
}

var ThriftHiveMetastoreRevokeRoleResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreRevokeRoleResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreRevokeRoleResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreRevokeRoleResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreRevokeRoleResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreRevokeRoleResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreRevokeRoleResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("revoke_role_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRevokeRoleResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRevokeRoleResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRevokeRoleResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRevokeRoleResult(%+v)", *p)
}

// Attributes:
//  - PrincipalName
//  - PrincipalType
type ThriftHiveMetastoreListRolesArgs struct {
  PrincipalName string `thrift:"principal_name,1" db:"principal_name" json:"principal_name"`
  PrincipalType PrincipalType `thrift:"principal_type,2" db:"principal_type" json:"principal_type"`
}

func NewThriftHiveMetastoreListRolesArgs() *ThriftHiveMetastoreListRolesArgs {
  return &ThriftHiveMetastoreListRolesArgs{}
}


func (p *ThriftHiveMetastoreListRolesArgs) GetPrincipalName() string {
  return p.PrincipalName
}

func (p *ThriftHiveMetastoreListRolesArgs) GetPrincipalType() PrincipalType {
  return p.PrincipalType
}
func (p *ThriftHiveMetastoreListRolesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListRolesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.PrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreListRolesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := PrincipalType(v)
  p.PrincipalType = temp
}
  return nil
}

func (p *ThriftHiveMetastoreListRolesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("list_roles_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreListRolesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.PrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreListRolesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_type", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:principal_type: ", p), err) }
  if err := oprot.WriteI32(int32(p.PrincipalType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_type (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:principal_type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreListRolesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreListRolesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreListRolesResult struct {
  Success []*Role `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreListRolesResult() *ThriftHiveMetastoreListRolesResult {
  return &ThriftHiveMetastoreListRolesResult{}
}

var ThriftHiveMetastoreListRolesResult_Success_DEFAULT []*Role

func (p *ThriftHiveMetastoreListRolesResult) GetSuccess() []*Role {
  return p.Success
}
var ThriftHiveMetastoreListRolesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreListRolesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreListRolesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreListRolesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreListRolesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreListRolesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListRolesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*Role, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem178 := &Role{}
    if err := _elem178.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem178), err)
    }
    p.Success = append(p.Success, _elem178)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListRolesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListRolesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("list_roles_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreListRolesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreListRolesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreListRolesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreListRolesResult(%+v)", *p)
}

// Attributes:
//  - HiveObject
//  - UserName
//  - GroupNames
type ThriftHiveMetastoreGetPrivilegeSetArgs struct {
  HiveObject *HiveObjectRef `thrift:"hiveObject,1" db:"hiveObject" json:"hiveObject"`
  UserName string `thrift:"user_name,2" db:"user_name" json:"user_name"`
  GroupNames []string `thrift:"group_names,3" db:"group_names" json:"group_names"`
}

func NewThriftHiveMetastoreGetPrivilegeSetArgs() *ThriftHiveMetastoreGetPrivilegeSetArgs {
  return &ThriftHiveMetastoreGetPrivilegeSetArgs{}
}

var ThriftHiveMetastoreGetPrivilegeSetArgs_HiveObject_DEFAULT *HiveObjectRef
func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) GetHiveObject() *HiveObjectRef {
  if !p.IsSetHiveObject() {
    return ThriftHiveMetastoreGetPrivilegeSetArgs_HiveObject_DEFAULT
  }
return p.HiveObject
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) GetUserName() string {
  return p.UserName
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) GetGroupNames() []string {
  return p.GroupNames
}
func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) IsSetHiveObject() bool {
  return p.HiveObject != nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.HiveObject = &HiveObjectRef{}
  if err := p.HiveObject.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HiveObject), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.UserName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs)  ReadField3(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]string, 0, size)
  p.GroupNames =  tSlice
  for i := 0; i < size; i ++ {
var _elem179 string
    if v, err := iprot.ReadString(); err != nil {
    return thrift.PrependError("error reading field 0: ", err)
} else {
    _elem179 = v
}
    p.GroupNames = append(p.GroupNames, _elem179)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_privilege_set_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("hiveObject", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hiveObject: ", p), err) }
  if err := p.HiveObject.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HiveObject), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hiveObject: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("user_name", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user_name: ", p), err) }
  if err := oprot.WriteString(string(p.UserName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.user_name (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("group_names", thrift.LIST, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:group_names: ", p), err) }
  if err := oprot.WriteListBegin(thrift.STRING, len(p.GroupNames)); err != nil {
    return thrift.PrependError("error writing list begin: ", err)
  }
  for _, v := range p.GroupNames {
    if err := oprot.WriteString(string(v)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
  }
  if err := oprot.WriteListEnd(); err != nil {
    return thrift.PrependError("error writing list end: ", err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:group_names: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetPrivilegeSetArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPrivilegeSetArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetPrivilegeSetResult struct {
  Success *PrincipalPrivilegeSet `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetPrivilegeSetResult() *ThriftHiveMetastoreGetPrivilegeSetResult {
  return &ThriftHiveMetastoreGetPrivilegeSetResult{}
}

var ThriftHiveMetastoreGetPrivilegeSetResult_Success_DEFAULT *PrincipalPrivilegeSet
func (p *ThriftHiveMetastoreGetPrivilegeSetResult) GetSuccess() *PrincipalPrivilegeSet {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetPrivilegeSetResult_Success_DEFAULT
  }
return p.Success
}
var ThriftHiveMetastoreGetPrivilegeSetResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetPrivilegeSetResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetPrivilegeSetResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetPrivilegeSetResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult)  ReadField0(iprot thrift.TProtocol) error {
  p.Success = &PrincipalPrivilegeSet{}
  if err := p.Success.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_privilege_set_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := p.Success.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetPrivilegeSetResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetPrivilegeSetResult(%+v)", *p)
}

// Attributes:
//  - PrincipalName
//  - PrincipalType
//  - HiveObject
type ThriftHiveMetastoreListPrivilegesArgs struct {
  PrincipalName string `thrift:"principal_name,1" db:"principal_name" json:"principal_name"`
  PrincipalType PrincipalType `thrift:"principal_type,2" db:"principal_type" json:"principal_type"`
  HiveObject *HiveObjectRef `thrift:"hiveObject,3" db:"hiveObject" json:"hiveObject"`
}

func NewThriftHiveMetastoreListPrivilegesArgs() *ThriftHiveMetastoreListPrivilegesArgs {
  return &ThriftHiveMetastoreListPrivilegesArgs{}
}


func (p *ThriftHiveMetastoreListPrivilegesArgs) GetPrincipalName() string {
  return p.PrincipalName
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) GetPrincipalType() PrincipalType {
  return p.PrincipalType
}
var ThriftHiveMetastoreListPrivilegesArgs_HiveObject_DEFAULT *HiveObjectRef
func (p *ThriftHiveMetastoreListPrivilegesArgs) GetHiveObject() *HiveObjectRef {
  if !p.IsSetHiveObject() {
    return ThriftHiveMetastoreListPrivilegesArgs_HiveObject_DEFAULT
  }
return p.HiveObject
}
func (p *ThriftHiveMetastoreListPrivilegesArgs) IsSetHiveObject() bool {
  return p.HiveObject != nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.I32 {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 3:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField3(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.PrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI32(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  temp := PrincipalType(v)
  p.PrincipalType = temp
}
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs)  ReadField3(iprot thrift.TProtocol) error {
  p.HiveObject = &HiveObjectRef{}
  if err := p.HiveObject.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HiveObject), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("list_privileges_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
    if err := p.writeField3(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.PrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("principal_type", thrift.I32, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:principal_type: ", p), err) }
  if err := oprot.WriteI32(int32(p.PrincipalType)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.principal_type (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:principal_type: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) writeField3(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("hiveObject", thrift.STRUCT, 3); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hiveObject: ", p), err) }
  if err := p.HiveObject.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HiveObject), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hiveObject: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreListPrivilegesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreListPrivilegesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreListPrivilegesResult struct {
  Success []*HiveObjectPrivilege `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreListPrivilegesResult() *ThriftHiveMetastoreListPrivilegesResult {
  return &ThriftHiveMetastoreListPrivilegesResult{}
}

var ThriftHiveMetastoreListPrivilegesResult_Success_DEFAULT []*HiveObjectPrivilege

func (p *ThriftHiveMetastoreListPrivilegesResult) GetSuccess() []*HiveObjectPrivilege {
  return p.Success
}
var ThriftHiveMetastoreListPrivilegesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreListPrivilegesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreListPrivilegesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreListPrivilegesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.LIST {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult)  ReadField0(iprot thrift.TProtocol) error {
  _, size, err := iprot.ReadListBegin()
  if err != nil {
    return thrift.PrependError("error reading list begin: ", err)
  }
  tSlice := make([]*HiveObjectPrivilege, 0, size)
  p.Success =  tSlice
  for i := 0; i < size; i ++ {
    _elem180 := &HiveObjectPrivilege{}
    if err := _elem180.Read(iprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem180), err)
    }
    p.Success = append(p.Success, _elem180)
  }
  if err := iprot.ReadListEnd(); err != nil {
    return thrift.PrependError("error reading list end: ", err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("list_privileges_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreListPrivilegesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.LIST, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Success)); err != nil {
      return thrift.PrependError("error writing list begin: ", err)
    }
    for _, v := range p.Success {
      if err := v.Write(oprot); err != nil {
        return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
      }
    }
    if err := oprot.WriteListEnd(); err != nil {
      return thrift.PrependError("error writing list end: ", err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreListPrivilegesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreListPrivilegesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreListPrivilegesResult(%+v)", *p)
}

// Attributes:
//  - Privileges
type ThriftHiveMetastoreGrantPrivilegesArgs struct {
  Privileges *PrivilegeBag `thrift:"privileges,1" db:"privileges" json:"privileges"`
}

func NewThriftHiveMetastoreGrantPrivilegesArgs() *ThriftHiveMetastoreGrantPrivilegesArgs {
  return &ThriftHiveMetastoreGrantPrivilegesArgs{}
}

var ThriftHiveMetastoreGrantPrivilegesArgs_Privileges_DEFAULT *PrivilegeBag
func (p *ThriftHiveMetastoreGrantPrivilegesArgs) GetPrivileges() *PrivilegeBag {
  if !p.IsSetPrivileges() {
    return ThriftHiveMetastoreGrantPrivilegesArgs_Privileges_DEFAULT
  }
return p.Privileges
}
func (p *ThriftHiveMetastoreGrantPrivilegesArgs) IsSetPrivileges() bool {
  return p.Privileges != nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Privileges = &PrivilegeBag{}
  if err := p.Privileges.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Privileges), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("grant_privileges_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("privileges", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:privileges: ", p), err) }
  if err := p.Privileges.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Privileges), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:privileges: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGrantPrivilegesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGrantPrivilegesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGrantPrivilegesResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGrantPrivilegesResult() *ThriftHiveMetastoreGrantPrivilegesResult {
  return &ThriftHiveMetastoreGrantPrivilegesResult{}
}

var ThriftHiveMetastoreGrantPrivilegesResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreGrantPrivilegesResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGrantPrivilegesResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreGrantPrivilegesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGrantPrivilegesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGrantPrivilegesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGrantPrivilegesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("grant_privileges_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGrantPrivilegesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGrantPrivilegesResult(%+v)", *p)
}

// Attributes:
//  - Privileges
type ThriftHiveMetastoreRevokePrivilegesArgs struct {
  Privileges *PrivilegeBag `thrift:"privileges,1" db:"privileges" json:"privileges"`
}

func NewThriftHiveMetastoreRevokePrivilegesArgs() *ThriftHiveMetastoreRevokePrivilegesArgs {
  return &ThriftHiveMetastoreRevokePrivilegesArgs{}
}

var ThriftHiveMetastoreRevokePrivilegesArgs_Privileges_DEFAULT *PrivilegeBag
func (p *ThriftHiveMetastoreRevokePrivilegesArgs) GetPrivileges() *PrivilegeBag {
  if !p.IsSetPrivileges() {
    return ThriftHiveMetastoreRevokePrivilegesArgs_Privileges_DEFAULT
  }
return p.Privileges
}
func (p *ThriftHiveMetastoreRevokePrivilegesArgs) IsSetPrivileges() bool {
  return p.Privileges != nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesArgs)  ReadField1(iprot thrift.TProtocol) error {
  p.Privileges = &PrivilegeBag{}
  if err := p.Privileges.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Privileges), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("revoke_privileges_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("privileges", thrift.STRUCT, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:privileges: ", p), err) }
  if err := p.Privileges.Write(oprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Privileges), err)
  }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:privileges: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreRevokePrivilegesArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRevokePrivilegesArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreRevokePrivilegesResult struct {
  Success *bool `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreRevokePrivilegesResult() *ThriftHiveMetastoreRevokePrivilegesResult {
  return &ThriftHiveMetastoreRevokePrivilegesResult{}
}

var ThriftHiveMetastoreRevokePrivilegesResult_Success_DEFAULT bool
func (p *ThriftHiveMetastoreRevokePrivilegesResult) GetSuccess() bool {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreRevokePrivilegesResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreRevokePrivilegesResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreRevokePrivilegesResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreRevokePrivilegesResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreRevokePrivilegesResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.BOOL {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadBool(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("revoke_privileges_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.BOOL, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteBool(bool(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRevokePrivilegesResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRevokePrivilegesResult(%+v)", *p)
}

// Attributes:
//  - RenewerKerberosPrincipalName
type ThriftHiveMetastoreGetDelegationTokenArgs struct {
  RenewerKerberosPrincipalName string `thrift:"renewer_kerberos_principal_name,1" db:"renewer_kerberos_principal_name" json:"renewer_kerberos_principal_name"`
}

func NewThriftHiveMetastoreGetDelegationTokenArgs() *ThriftHiveMetastoreGetDelegationTokenArgs {
  return &ThriftHiveMetastoreGetDelegationTokenArgs{}
}


func (p *ThriftHiveMetastoreGetDelegationTokenArgs) GetRenewerKerberosPrincipalName() string {
  return p.RenewerKerberosPrincipalName
}
func (p *ThriftHiveMetastoreGetDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RenewerKerberosPrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_delegation_token_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("renewer_kerberos_principal_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:renewer_kerberos_principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.RenewerKerberosPrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.renewer_kerberos_principal_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:renewer_kerberos_principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetDelegationTokenResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetDelegationTokenResult() *ThriftHiveMetastoreGetDelegationTokenResult {
  return &ThriftHiveMetastoreGetDelegationTokenResult{}
}

var ThriftHiveMetastoreGetDelegationTokenResult_Success_DEFAULT string
func (p *ThriftHiveMetastoreGetDelegationTokenResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetDelegationTokenResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreGetDelegationTokenResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetDelegationTokenResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetDelegationTokenResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetDelegationTokenResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_delegation_token_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDelegationTokenResult(%+v)", *p)
}

// Attributes:
//  - RenewerKerberosPrincipalName
//  - TokenSignature
type ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs struct {
  RenewerKerberosPrincipalName string `thrift:"renewer_kerberos_principal_name,1" db:"renewer_kerberos_principal_name" json:"renewer_kerberos_principal_name"`
  TokenSignature string `thrift:"token_signature,2" db:"token_signature" json:"token_signature"`
}

func NewThriftHiveMetastoreGetDelegationTokenWithSignatureArgs() *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs {
  return &ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs{}
}


func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) GetRenewerKerberosPrincipalName() string {
  return p.RenewerKerberosPrincipalName
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) GetTokenSignature() string {
  return p.TokenSignature
}
func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 2:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField2(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.RenewerKerberosPrincipalName = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs)  ReadField2(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 2: ", err)
} else {
  p.TokenSignature = v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_delegation_token_with_signature_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
    if err := p.writeField2(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("renewer_kerberos_principal_name", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:renewer_kerberos_principal_name: ", p), err) }
  if err := oprot.WriteString(string(p.RenewerKerberosPrincipalName)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.renewer_kerberos_principal_name (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:renewer_kerberos_principal_name: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) writeField2(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("token_signature", thrift.STRING, 2); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:token_signature: ", p), err) }
  if err := oprot.WriteString(string(p.TokenSignature)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.token_signature (2) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 2:token_signature: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDelegationTokenWithSignatureArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreGetDelegationTokenWithSignatureResult struct {
  Success *string `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreGetDelegationTokenWithSignatureResult() *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult {
  return &ThriftHiveMetastoreGetDelegationTokenWithSignatureResult{}
}

var ThriftHiveMetastoreGetDelegationTokenWithSignatureResult_Success_DEFAULT string
func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) GetSuccess() string {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreGetDelegationTokenWithSignatureResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreGetDelegationTokenWithSignatureResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreGetDelegationTokenWithSignatureResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("get_delegation_token_with_signature_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.STRING, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteString(string(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreGetDelegationTokenWithSignatureResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreGetDelegationTokenWithSignatureResult(%+v)", *p)
}

// Attributes:
//  - TokenStrForm
type ThriftHiveMetastoreRenewDelegationTokenArgs struct {
  TokenStrForm string `thrift:"token_str_form,1" db:"token_str_form" json:"token_str_form"`
}

func NewThriftHiveMetastoreRenewDelegationTokenArgs() *ThriftHiveMetastoreRenewDelegationTokenArgs {
  return &ThriftHiveMetastoreRenewDelegationTokenArgs{}
}


func (p *ThriftHiveMetastoreRenewDelegationTokenArgs) GetTokenStrForm() string {
  return p.TokenStrForm
}
func (p *ThriftHiveMetastoreRenewDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.TokenStrForm = v
}
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("renew_delegation_token_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("token_str_form", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:token_str_form: ", p), err) }
  if err := oprot.WriteString(string(p.TokenStrForm)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.token_str_form (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:token_str_form: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreRenewDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRenewDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - Success
//  - O1
type ThriftHiveMetastoreRenewDelegationTokenResult struct {
  Success *int64 `thrift:"success,0" db:"success" json:"success,omitempty"`
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreRenewDelegationTokenResult() *ThriftHiveMetastoreRenewDelegationTokenResult {
  return &ThriftHiveMetastoreRenewDelegationTokenResult{}
}

var ThriftHiveMetastoreRenewDelegationTokenResult_Success_DEFAULT int64
func (p *ThriftHiveMetastoreRenewDelegationTokenResult) GetSuccess() int64 {
  if !p.IsSetSuccess() {
    return ThriftHiveMetastoreRenewDelegationTokenResult_Success_DEFAULT
  }
return *p.Success
}
var ThriftHiveMetastoreRenewDelegationTokenResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreRenewDelegationTokenResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreRenewDelegationTokenResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreRenewDelegationTokenResult) IsSetSuccess() bool {
  return p.Success != nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 0:
      if fieldTypeId == thrift.I64 {
        if err := p.ReadField0(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult)  ReadField0(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadI64(); err != nil {
  return thrift.PrependError("error reading field 0: ", err)
} else {
  p.Success = &v
}
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("renew_delegation_token_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField0(oprot); err != nil { return err }
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) {
  if p.IsSetSuccess() {
    if err := oprot.WriteFieldBegin("success", thrift.I64, 0); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) }
    if err := oprot.WriteI64(int64(*p.Success)); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreRenewDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreRenewDelegationTokenResult(%+v)", *p)
}

// Attributes:
//  - TokenStrForm
type ThriftHiveMetastoreCancelDelegationTokenArgs struct {
  TokenStrForm string `thrift:"token_str_form,1" db:"token_str_form" json:"token_str_form"`
}

func NewThriftHiveMetastoreCancelDelegationTokenArgs() *ThriftHiveMetastoreCancelDelegationTokenArgs {
  return &ThriftHiveMetastoreCancelDelegationTokenArgs{}
}


func (p *ThriftHiveMetastoreCancelDelegationTokenArgs) GetTokenStrForm() string {
  return p.TokenStrForm
}
func (p *ThriftHiveMetastoreCancelDelegationTokenArgs) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRING {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenArgs)  ReadField1(iprot thrift.TProtocol) error {
  if v, err := iprot.ReadString(); err != nil {
  return thrift.PrependError("error reading field 1: ", err)
} else {
  p.TokenStrForm = v
}
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenArgs) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("cancel_delegation_token_args"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) {
  if err := oprot.WriteFieldBegin("token_str_form", thrift.STRING, 1); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:token_str_form: ", p), err) }
  if err := oprot.WriteString(string(p.TokenStrForm)); err != nil {
  return thrift.PrependError(fmt.Sprintf("%T.token_str_form (1) field write error: ", p), err) }
  if err := oprot.WriteFieldEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write field end error 1:token_str_form: ", p), err) }
  return err
}

func (p *ThriftHiveMetastoreCancelDelegationTokenArgs) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCancelDelegationTokenArgs(%+v)", *p)
}

// Attributes:
//  - O1
type ThriftHiveMetastoreCancelDelegationTokenResult struct {
  O1 *MetaException `thrift:"o1,1" db:"o1" json:"o1,omitempty"`
}

func NewThriftHiveMetastoreCancelDelegationTokenResult() *ThriftHiveMetastoreCancelDelegationTokenResult {
  return &ThriftHiveMetastoreCancelDelegationTokenResult{}
}

var ThriftHiveMetastoreCancelDelegationTokenResult_O1_DEFAULT *MetaException
func (p *ThriftHiveMetastoreCancelDelegationTokenResult) GetO1() *MetaException {
  if !p.IsSetO1() {
    return ThriftHiveMetastoreCancelDelegationTokenResult_O1_DEFAULT
  }
return p.O1
}
func (p *ThriftHiveMetastoreCancelDelegationTokenResult) IsSetO1() bool {
  return p.O1 != nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenResult) Read(iprot thrift.TProtocol) error {
  if _, err := iprot.ReadStructBegin(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
  }


  for {
    _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()
    if err != nil {
      return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err)
    }
    if fieldTypeId == thrift.STOP { break; }
    switch fieldId {
    case 1:
      if fieldTypeId == thrift.STRUCT {
        if err := p.ReadField1(iprot); err != nil {
          return err
        }
      } else {
        if err := iprot.Skip(fieldTypeId); err != nil {
          return err
        }
      }
    default:
      if err := iprot.Skip(fieldTypeId); err != nil {
        return err
      }
    }
    if err := iprot.ReadFieldEnd(); err != nil {
      return err
    }
  }
  if err := iprot.ReadStructEnd(); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenResult)  ReadField1(iprot thrift.TProtocol) error {
  p.O1 = &MetaException{}
  if err := p.O1.Read(iprot); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.O1), err)
  }
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenResult) Write(oprot thrift.TProtocol) error {
  if err := oprot.WriteStructBegin("cancel_delegation_token_result"); err != nil {
    return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
  if p != nil {
    if err := p.writeField1(oprot); err != nil { return err }
  }
  if err := oprot.WriteFieldStop(); err != nil {
    return thrift.PrependError("write field stop error: ", err) }
  if err := oprot.WriteStructEnd(); err != nil {
    return thrift.PrependError("write struct stop error: ", err) }
  return nil
}

func (p *ThriftHiveMetastoreCancelDelegationTokenResult) writeField1(oprot thrift.TProtocol) (err error) {
  if p.IsSetO1() {
    if err := oprot.WriteFieldBegin("o1", thrift.STRUCT, 1); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:o1: ", p), err) }
    if err := p.O1.Write(oprot); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.O1), err)
    }
    if err := oprot.WriteFieldEnd(); err != nil {
      return thrift.PrependError(fmt.Sprintf("%T write field end error 1:o1: ", p), err) }
  }
  return err
}

func (p *ThriftHiveMetastoreCancelDelegationTokenResult) String() string {
  if p == nil {
    return "<nil>"
  }
  return fmt.Sprintf("ThriftHiveMetastoreCancelDelegationTokenResult(%+v)", *p)
}


