blob: e001f8656efe564bd94537884023ef5ceebb386d [file] [log] [blame]
// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT.
package rpc
import(
"bytes"
"context"
"database/sql/driver"
"errors"
"fmt"
"time"
"github.com/apache/thrift/lib/go/thrift"
)
// (needed to ensure safety because of naive import list construction.)
var _ = thrift.ZERO
var _ = fmt.Printf
var _ = context.Background
var _ = time.Now
var _ = bytes.Equal
type TSProtocolVersion int64
const (
TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1 TSProtocolVersion = 0
TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2 TSProtocolVersion = 1
TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3 TSProtocolVersion = 2
)
func (p TSProtocolVersion) String() string {
switch p {
case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1: return "IOTDB_SERVICE_PROTOCOL_V1"
case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2: return "IOTDB_SERVICE_PROTOCOL_V2"
case TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3: return "IOTDB_SERVICE_PROTOCOL_V3"
}
return "<UNSET>"
}
func TSProtocolVersionFromString(s string) (TSProtocolVersion, error) {
switch s {
case "IOTDB_SERVICE_PROTOCOL_V1": return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V1, nil
case "IOTDB_SERVICE_PROTOCOL_V2": return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V2, nil
case "IOTDB_SERVICE_PROTOCOL_V3": return TSProtocolVersion_IOTDB_SERVICE_PROTOCOL_V3, nil
}
return TSProtocolVersion(0), fmt.Errorf("not a valid TSProtocolVersion string")
}
func TSProtocolVersionPtr(v TSProtocolVersion) *TSProtocolVersion { return &v }
func (p TSProtocolVersion) MarshalText() ([]byte, error) {
return []byte(p.String()), nil
}
func (p *TSProtocolVersion) UnmarshalText(text []byte) error {
q, err := TSProtocolVersionFromString(string(text))
if (err != nil) {
return err
}
*p = q
return nil
}
func (p *TSProtocolVersion) Scan(value interface{}) error {
v, ok := value.(int64)
if !ok {
return errors.New("Scan value is not int64")
}
*p = TSProtocolVersion(v)
return nil
}
func (p * TSProtocolVersion) Value() (driver.Value, error) {
if p == nil {
return nil, nil
}
return int64(*p), nil
}
// Attributes:
// - IP
// - Port
type EndPoint struct {
IP string `thrift:"ip,1,required" db:"ip" json:"ip"`
Port int32 `thrift:"port,2,required" db:"port" json:"port"`
}
func NewEndPoint() *EndPoint {
return &EndPoint{}
}
func (p *EndPoint) GetIP() string {
return p.IP
}
func (p *EndPoint) GetPort() int32 {
return p.Port
}
func (p *EndPoint) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetIP bool = false;
var issetPort bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetIP = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I32 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetPort = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetIP{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IP is not set"));
}
if !issetPort{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Port is not set"));
}
return nil
}
func (p *EndPoint) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.IP = v
}
return nil
}
func (p *EndPoint) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Port = v
}
return nil
}
func (p *EndPoint) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "EndPoint"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *EndPoint) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "ip", thrift.STRING, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ip: ", p), err) }
if err := oprot.WriteString(ctx, string(p.IP)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.ip (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ip: ", p), err) }
return err
}
func (p *EndPoint) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "port", thrift.I32, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) }
if err := oprot.WriteI32(ctx, int32(p.Port)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) }
return err
}
func (p *EndPoint) Equals(other *EndPoint) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.IP != other.IP { return false }
if p.Port != other.Port { return false }
return true
}
func (p *EndPoint) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("EndPoint(%+v)", *p)
}
// Attributes:
// - Code
// - Message
// - SubStatus
// - RedirectNode
type TSStatus struct {
Code int32 `thrift:"code,1,required" db:"code" json:"code"`
Message *string `thrift:"message,2" db:"message" json:"message,omitempty"`
SubStatus []*TSStatus `thrift:"subStatus,3" db:"subStatus" json:"subStatus,omitempty"`
RedirectNode *EndPoint `thrift:"redirectNode,4" db:"redirectNode" json:"redirectNode,omitempty"`
}
func NewTSStatus() *TSStatus {
return &TSStatus{}
}
func (p *TSStatus) GetCode() int32 {
return p.Code
}
var TSStatus_Message_DEFAULT string
func (p *TSStatus) GetMessage() string {
if !p.IsSetMessage() {
return TSStatus_Message_DEFAULT
}
return *p.Message
}
var TSStatus_SubStatus_DEFAULT []*TSStatus
func (p *TSStatus) GetSubStatus() []*TSStatus {
return p.SubStatus
}
var TSStatus_RedirectNode_DEFAULT *EndPoint
func (p *TSStatus) GetRedirectNode() *EndPoint {
if !p.IsSetRedirectNode() {
return TSStatus_RedirectNode_DEFAULT
}
return p.RedirectNode
}
func (p *TSStatus) IsSetMessage() bool {
return p.Message != nil
}
func (p *TSStatus) IsSetSubStatus() bool {
return p.SubStatus != nil
}
func (p *TSStatus) IsSetRedirectNode() bool {
return p.RedirectNode != nil
}
func (p *TSStatus) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetCode bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetCode = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.LIST {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.STRUCT {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetCode{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set"));
}
return nil
}
func (p *TSStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.Code = v
}
return nil
}
func (p *TSStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Message = &v
}
return nil
}
func (p *TSStatus) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]*TSStatus, 0, size)
p.SubStatus = tSlice
for i := 0; i < size; i ++ {
_elem0 := &TSStatus{}
if err := _elem0.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err)
}
p.SubStatus = append(p.SubStatus, _elem0)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSStatus) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
p.RedirectNode = &EndPoint{}
if err := p.RedirectNode.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RedirectNode), err)
}
return nil
}
func (p *TSStatus) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSStatus"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) }
if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) }
return err
}
func (p *TSStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetMessage() {
if err := oprot.WriteFieldBegin(ctx, "message", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:message: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.Message)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.message (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:message: ", p), err) }
}
return err
}
func (p *TSStatus) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetSubStatus() {
if err := oprot.WriteFieldBegin(ctx, "subStatus", thrift.LIST, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:subStatus: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.SubStatus)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.SubStatus {
if err := v.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err)
}
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:subStatus: ", p), err) }
}
return err
}
func (p *TSStatus) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetRedirectNode() {
if err := oprot.WriteFieldBegin(ctx, "redirectNode", thrift.STRUCT, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:redirectNode: ", p), err) }
if err := p.RedirectNode.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RedirectNode), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:redirectNode: ", p), err) }
}
return err
}
func (p *TSStatus) Equals(other *TSStatus) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.Code != other.Code { return false }
if p.Message != other.Message {
if p.Message == nil || other.Message == nil {
return false
}
if (*p.Message) != (*other.Message) { return false }
}
if len(p.SubStatus) != len(other.SubStatus) { return false }
for i, _tgt := range p.SubStatus {
_src1 := other.SubStatus[i]
if !_tgt.Equals(_src1) { return false }
}
if !p.RedirectNode.Equals(other.RedirectNode) { return false }
return true
}
func (p *TSStatus) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSStatus(%+v)", *p)
}
// Attributes:
// - Time
// - ValueList
// - BitmapList
type TSQueryDataSet struct {
Time []byte `thrift:"time,1,required" db:"time" json:"time"`
ValueList [][]byte `thrift:"valueList,2,required" db:"valueList" json:"valueList"`
BitmapList [][]byte `thrift:"bitmapList,3,required" db:"bitmapList" json:"bitmapList"`
}
func NewTSQueryDataSet() *TSQueryDataSet {
return &TSQueryDataSet{}
}
func (p *TSQueryDataSet) GetTime() []byte {
return p.Time
}
func (p *TSQueryDataSet) GetValueList() [][]byte {
return p.ValueList
}
func (p *TSQueryDataSet) GetBitmapList() [][]byte {
return p.BitmapList
}
func (p *TSQueryDataSet) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetTime bool = false;
var issetValueList bool = false;
var issetBitmapList bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetTime = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.LIST {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetValueList = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.LIST {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
issetBitmapList = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetTime{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Time is not set"));
}
if !issetValueList{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueList is not set"));
}
if !issetBitmapList{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field BitmapList is not set"));
}
return nil
}
func (p *TSQueryDataSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBinary(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.Time = v
}
return nil
}
func (p *TSQueryDataSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([][]byte, 0, size)
p.ValueList = tSlice
for i := 0; i < size; i ++ {
var _elem2 []byte
if v, err := iprot.ReadBinary(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem2 = v
}
p.ValueList = append(p.ValueList, _elem2)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSQueryDataSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([][]byte, 0, size)
p.BitmapList = tSlice
for i := 0; i < size; i ++ {
var _elem3 []byte
if v, err := iprot.ReadBinary(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem3 = v
}
p.BitmapList = append(p.BitmapList, _elem3)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSQueryDataSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSQueryDataSet"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSQueryDataSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "time", thrift.STRING, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:time: ", p), err) }
if err := oprot.WriteBinary(ctx, p.Time); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.time (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:time: ", p), err) }
return err
}
func (p *TSQueryDataSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "valueList", thrift.LIST, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.ValueList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.ValueList {
if err := oprot.WriteBinary(ctx, v); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueList: ", p), err) }
return err
}
func (p *TSQueryDataSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "bitmapList", thrift.LIST, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bitmapList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.BitmapList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.BitmapList {
if err := oprot.WriteBinary(ctx, v); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bitmapList: ", p), err) }
return err
}
func (p *TSQueryDataSet) Equals(other *TSQueryDataSet) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if bytes.Compare(p.Time, other.Time) != 0 { return false }
if len(p.ValueList) != len(other.ValueList) { return false }
for i, _tgt := range p.ValueList {
_src4 := other.ValueList[i]
if bytes.Compare(_tgt, _src4) != 0 { return false }
}
if len(p.BitmapList) != len(other.BitmapList) { return false }
for i, _tgt := range p.BitmapList {
_src5 := other.BitmapList[i]
if bytes.Compare(_tgt, _src5) != 0 { return false }
}
return true
}
func (p *TSQueryDataSet) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSQueryDataSet(%+v)", *p)
}
// Attributes:
// - TimeList
// - ValueList
type TSQueryNonAlignDataSet struct {
TimeList [][]byte `thrift:"timeList,1,required" db:"timeList" json:"timeList"`
ValueList [][]byte `thrift:"valueList,2,required" db:"valueList" json:"valueList"`
}
func NewTSQueryNonAlignDataSet() *TSQueryNonAlignDataSet {
return &TSQueryNonAlignDataSet{}
}
func (p *TSQueryNonAlignDataSet) GetTimeList() [][]byte {
return p.TimeList
}
func (p *TSQueryNonAlignDataSet) GetValueList() [][]byte {
return p.ValueList
}
func (p *TSQueryNonAlignDataSet) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetTimeList bool = false;
var issetValueList bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetTimeList = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.LIST {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetValueList = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetTimeList{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TimeList is not set"));
}
if !issetValueList{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ValueList is not set"));
}
return nil
}
func (p *TSQueryNonAlignDataSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([][]byte, 0, size)
p.TimeList = tSlice
for i := 0; i < size; i ++ {
var _elem6 []byte
if v, err := iprot.ReadBinary(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem6 = v
}
p.TimeList = append(p.TimeList, _elem6)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSQueryNonAlignDataSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([][]byte, 0, size)
p.ValueList = tSlice
for i := 0; i < size; i ++ {
var _elem7 []byte
if v, err := iprot.ReadBinary(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem7 = v
}
p.ValueList = append(p.ValueList, _elem7)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSQueryNonAlignDataSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSQueryNonAlignDataSet"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSQueryNonAlignDataSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "timeList", thrift.LIST, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:timeList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TimeList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.TimeList {
if err := oprot.WriteBinary(ctx, v); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:timeList: ", p), err) }
return err
}
func (p *TSQueryNonAlignDataSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "valueList", thrift.LIST, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.ValueList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.ValueList {
if err := oprot.WriteBinary(ctx, v); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueList: ", p), err) }
return err
}
func (p *TSQueryNonAlignDataSet) Equals(other *TSQueryNonAlignDataSet) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if len(p.TimeList) != len(other.TimeList) { return false }
for i, _tgt := range p.TimeList {
_src8 := other.TimeList[i]
if bytes.Compare(_tgt, _src8) != 0 { return false }
}
if len(p.ValueList) != len(other.ValueList) { return false }
for i, _tgt := range p.ValueList {
_src9 := other.ValueList[i]
if bytes.Compare(_tgt, _src9) != 0 { return false }
}
return true
}
func (p *TSQueryNonAlignDataSet) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSQueryNonAlignDataSet(%+v)", *p)
}
// Attributes:
// - Status
// - QueryId
// - Columns
// - OperationType
// - IgnoreTimeStamp
// - DataTypeList
// - QueryDataSet
// - NonAlignQueryDataSet
// - ColumnNameIndexMap
type TSExecuteStatementResp struct {
Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"`
QueryId *int64 `thrift:"queryId,2" db:"queryId" json:"queryId,omitempty"`
Columns []string `thrift:"columns,3" db:"columns" json:"columns,omitempty"`
OperationType *string `thrift:"operationType,4" db:"operationType" json:"operationType,omitempty"`
IgnoreTimeStamp *bool `thrift:"ignoreTimeStamp,5" db:"ignoreTimeStamp" json:"ignoreTimeStamp,omitempty"`
DataTypeList []string `thrift:"dataTypeList,6" db:"dataTypeList" json:"dataTypeList,omitempty"`
QueryDataSet *TSQueryDataSet `thrift:"queryDataSet,7" db:"queryDataSet" json:"queryDataSet,omitempty"`
NonAlignQueryDataSet *TSQueryNonAlignDataSet `thrift:"nonAlignQueryDataSet,8" db:"nonAlignQueryDataSet" json:"nonAlignQueryDataSet,omitempty"`
ColumnNameIndexMap map[string]int32 `thrift:"columnNameIndexMap,9" db:"columnNameIndexMap" json:"columnNameIndexMap,omitempty"`
}
func NewTSExecuteStatementResp() *TSExecuteStatementResp {
return &TSExecuteStatementResp{}
}
var TSExecuteStatementResp_Status_DEFAULT *TSStatus
func (p *TSExecuteStatementResp) GetStatus() *TSStatus {
if !p.IsSetStatus() {
return TSExecuteStatementResp_Status_DEFAULT
}
return p.Status
}
var TSExecuteStatementResp_QueryId_DEFAULT int64
func (p *TSExecuteStatementResp) GetQueryId() int64 {
if !p.IsSetQueryId() {
return TSExecuteStatementResp_QueryId_DEFAULT
}
return *p.QueryId
}
var TSExecuteStatementResp_Columns_DEFAULT []string
func (p *TSExecuteStatementResp) GetColumns() []string {
return p.Columns
}
var TSExecuteStatementResp_OperationType_DEFAULT string
func (p *TSExecuteStatementResp) GetOperationType() string {
if !p.IsSetOperationType() {
return TSExecuteStatementResp_OperationType_DEFAULT
}
return *p.OperationType
}
var TSExecuteStatementResp_IgnoreTimeStamp_DEFAULT bool
func (p *TSExecuteStatementResp) GetIgnoreTimeStamp() bool {
if !p.IsSetIgnoreTimeStamp() {
return TSExecuteStatementResp_IgnoreTimeStamp_DEFAULT
}
return *p.IgnoreTimeStamp
}
var TSExecuteStatementResp_DataTypeList_DEFAULT []string
func (p *TSExecuteStatementResp) GetDataTypeList() []string {
return p.DataTypeList
}
var TSExecuteStatementResp_QueryDataSet_DEFAULT *TSQueryDataSet
func (p *TSExecuteStatementResp) GetQueryDataSet() *TSQueryDataSet {
if !p.IsSetQueryDataSet() {
return TSExecuteStatementResp_QueryDataSet_DEFAULT
}
return p.QueryDataSet
}
var TSExecuteStatementResp_NonAlignQueryDataSet_DEFAULT *TSQueryNonAlignDataSet
func (p *TSExecuteStatementResp) GetNonAlignQueryDataSet() *TSQueryNonAlignDataSet {
if !p.IsSetNonAlignQueryDataSet() {
return TSExecuteStatementResp_NonAlignQueryDataSet_DEFAULT
}
return p.NonAlignQueryDataSet
}
var TSExecuteStatementResp_ColumnNameIndexMap_DEFAULT map[string]int32
func (p *TSExecuteStatementResp) GetColumnNameIndexMap() map[string]int32 {
return p.ColumnNameIndexMap
}
func (p *TSExecuteStatementResp) IsSetStatus() bool {
return p.Status != nil
}
func (p *TSExecuteStatementResp) IsSetQueryId() bool {
return p.QueryId != nil
}
func (p *TSExecuteStatementResp) IsSetColumns() bool {
return p.Columns != nil
}
func (p *TSExecuteStatementResp) IsSetOperationType() bool {
return p.OperationType != nil
}
func (p *TSExecuteStatementResp) IsSetIgnoreTimeStamp() bool {
return p.IgnoreTimeStamp != nil
}
func (p *TSExecuteStatementResp) IsSetDataTypeList() bool {
return p.DataTypeList != nil
}
func (p *TSExecuteStatementResp) IsSetQueryDataSet() bool {
return p.QueryDataSet != nil
}
func (p *TSExecuteStatementResp) IsSetNonAlignQueryDataSet() bool {
return p.NonAlignQueryDataSet != nil
}
func (p *TSExecuteStatementResp) IsSetColumnNameIndexMap() bool {
return p.ColumnNameIndexMap != nil
}
func (p *TSExecuteStatementResp) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetStatus bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetStatus = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I64 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.LIST {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.STRING {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 5:
if fieldTypeId == thrift.BOOL {
if err := p.ReadField5(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 6:
if fieldTypeId == thrift.LIST {
if err := p.ReadField6(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 7:
if fieldTypeId == thrift.STRUCT {
if err := p.ReadField7(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 8:
if fieldTypeId == thrift.STRUCT {
if err := p.ReadField8(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 9:
if fieldTypeId == thrift.MAP {
if err := p.ReadField9(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetStatus{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
}
return nil
}
func (p *TSExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
p.Status = &TSStatus{}
if err := p.Status.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
}
return nil
}
func (p *TSExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.QueryId = &v
}
return nil
}
func (p *TSExecuteStatementResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]string, 0, size)
p.Columns = tSlice
for i := 0; i < size; i ++ {
var _elem10 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem10 = v
}
p.Columns = append(p.Columns, _elem10)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSExecuteStatementResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 4: ", err)
} else {
p.OperationType = &v
}
return nil
}
func (p *TSExecuteStatementResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(ctx); err != nil {
return thrift.PrependError("error reading field 5: ", err)
} else {
p.IgnoreTimeStamp = &v
}
return nil
}
func (p *TSExecuteStatementResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]string, 0, size)
p.DataTypeList = tSlice
for i := 0; i < size; i ++ {
var _elem11 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem11 = v
}
p.DataTypeList = append(p.DataTypeList, _elem11)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSExecuteStatementResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error {
p.QueryDataSet = &TSQueryDataSet{}
if err := p.QueryDataSet.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.QueryDataSet), err)
}
return nil
}
func (p *TSExecuteStatementResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error {
p.NonAlignQueryDataSet = &TSQueryNonAlignDataSet{}
if err := p.NonAlignQueryDataSet.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonAlignQueryDataSet), err)
}
return nil
}
func (p *TSExecuteStatementResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error {
_, _, size, err := iprot.ReadMapBegin(ctx)
if err != nil {
return thrift.PrependError("error reading map begin: ", err)
}
tMap := make(map[string]int32, size)
p.ColumnNameIndexMap = tMap
for i := 0; i < size; i ++ {
var _key12 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_key12 = v
}
var _val13 int32
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_val13 = v
}
p.ColumnNameIndexMap[_key12] = _val13
}
if err := iprot.ReadMapEnd(ctx); err != nil {
return thrift.PrependError("error reading map end: ", err)
}
return nil
}
func (p *TSExecuteStatementResp) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSExecuteStatementResp"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
if err := p.writeField5(ctx, oprot); err != nil { return err }
if err := p.writeField6(ctx, oprot); err != nil { return err }
if err := p.writeField7(ctx, oprot); err != nil { return err }
if err := p.writeField8(ctx, oprot); err != nil { return err }
if err := p.writeField9(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSExecuteStatementResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
if err := p.Status.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
return err
}
func (p *TSExecuteStatementResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetQueryId() {
if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.I64, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.QueryId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetColumns() {
if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Columns)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Columns {
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetOperationType() {
if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.STRING, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:operationType: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.OperationType)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.operationType (4) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:operationType: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetIgnoreTimeStamp() {
if err := oprot.WriteFieldBegin(ctx, "ignoreTimeStamp", thrift.BOOL, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignoreTimeStamp: ", p), err) }
if err := oprot.WriteBool(ctx, bool(*p.IgnoreTimeStamp)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.ignoreTimeStamp (5) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignoreTimeStamp: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetDataTypeList() {
if err := oprot.WriteFieldBegin(ctx, "dataTypeList", thrift.LIST, 6); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dataTypeList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.DataTypeList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.DataTypeList {
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dataTypeList: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetQueryDataSet() {
if err := oprot.WriteFieldBegin(ctx, "queryDataSet", thrift.STRUCT, 7); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:queryDataSet: ", p), err) }
if err := p.QueryDataSet.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.QueryDataSet), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 7:queryDataSet: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetNonAlignQueryDataSet() {
if err := oprot.WriteFieldBegin(ctx, "nonAlignQueryDataSet", thrift.STRUCT, 8); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:nonAlignQueryDataSet: ", p), err) }
if err := p.NonAlignQueryDataSet.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonAlignQueryDataSet), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 8:nonAlignQueryDataSet: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetColumnNameIndexMap() {
if err := oprot.WriteFieldBegin(ctx, "columnNameIndexMap", thrift.MAP, 9); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:columnNameIndexMap: ", p), err) }
if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.ColumnNameIndexMap)); err != nil {
return thrift.PrependError("error writing map begin: ", err)
}
for k, v := range p.ColumnNameIndexMap {
if err := oprot.WriteString(ctx, string(k)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
if err := oprot.WriteI32(ctx, int32(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteMapEnd(ctx); err != nil {
return thrift.PrependError("error writing map end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 9:columnNameIndexMap: ", p), err) }
}
return err
}
func (p *TSExecuteStatementResp) Equals(other *TSExecuteStatementResp) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if !p.Status.Equals(other.Status) { return false }
if p.QueryId != other.QueryId {
if p.QueryId == nil || other.QueryId == nil {
return false
}
if (*p.QueryId) != (*other.QueryId) { return false }
}
if len(p.Columns) != len(other.Columns) { return false }
for i, _tgt := range p.Columns {
_src14 := other.Columns[i]
if _tgt != _src14 { return false }
}
if p.OperationType != other.OperationType {
if p.OperationType == nil || other.OperationType == nil {
return false
}
if (*p.OperationType) != (*other.OperationType) { return false }
}
if p.IgnoreTimeStamp != other.IgnoreTimeStamp {
if p.IgnoreTimeStamp == nil || other.IgnoreTimeStamp == nil {
return false
}
if (*p.IgnoreTimeStamp) != (*other.IgnoreTimeStamp) { return false }
}
if len(p.DataTypeList) != len(other.DataTypeList) { return false }
for i, _tgt := range p.DataTypeList {
_src15 := other.DataTypeList[i]
if _tgt != _src15 { return false }
}
if !p.QueryDataSet.Equals(other.QueryDataSet) { return false }
if !p.NonAlignQueryDataSet.Equals(other.NonAlignQueryDataSet) { return false }
if len(p.ColumnNameIndexMap) != len(other.ColumnNameIndexMap) { return false }
for k, _tgt := range p.ColumnNameIndexMap {
_src16 := other.ColumnNameIndexMap[k]
if _tgt != _src16 { return false }
}
return true
}
func (p *TSExecuteStatementResp) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSExecuteStatementResp(%+v)", *p)
}
// Attributes:
// - Status
// - ServerProtocolVersion
// - SessionId
// - Configuration
type TSOpenSessionResp struct {
Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"`
ServerProtocolVersion TSProtocolVersion `thrift:"serverProtocolVersion,2,required" db:"serverProtocolVersion" json:"serverProtocolVersion"`
SessionId *int64 `thrift:"sessionId,3" db:"sessionId" json:"sessionId,omitempty"`
Configuration map[string]string `thrift:"configuration,4" db:"configuration" json:"configuration,omitempty"`
}
func NewTSOpenSessionResp() *TSOpenSessionResp {
return &TSOpenSessionResp{
ServerProtocolVersion: 0,
}
}
var TSOpenSessionResp_Status_DEFAULT *TSStatus
func (p *TSOpenSessionResp) GetStatus() *TSStatus {
if !p.IsSetStatus() {
return TSOpenSessionResp_Status_DEFAULT
}
return p.Status
}
func (p *TSOpenSessionResp) GetServerProtocolVersion() TSProtocolVersion {
return p.ServerProtocolVersion
}
var TSOpenSessionResp_SessionId_DEFAULT int64
func (p *TSOpenSessionResp) GetSessionId() int64 {
if !p.IsSetSessionId() {
return TSOpenSessionResp_SessionId_DEFAULT
}
return *p.SessionId
}
var TSOpenSessionResp_Configuration_DEFAULT map[string]string
func (p *TSOpenSessionResp) GetConfiguration() map[string]string {
return p.Configuration
}
func (p *TSOpenSessionResp) IsSetStatus() bool {
return p.Status != nil
}
func (p *TSOpenSessionResp) IsSetSessionId() bool {
return p.SessionId != nil
}
func (p *TSOpenSessionResp) IsSetConfiguration() bool {
return p.Configuration != nil
}
func (p *TSOpenSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetStatus bool = false;
var issetServerProtocolVersion bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetStatus = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I32 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetServerProtocolVersion = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.I64 {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.MAP {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetStatus{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
}
if !issetServerProtocolVersion{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ServerProtocolVersion is not set"));
}
return nil
}
func (p *TSOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
p.Status = &TSStatus{}
if err := p.Status.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
}
return nil
}
func (p *TSOpenSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
temp := TSProtocolVersion(v)
p.ServerProtocolVersion = temp
}
return nil
}
func (p *TSOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.SessionId = &v
}
return nil
}
func (p *TSOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
_, _, size, err := iprot.ReadMapBegin(ctx)
if err != nil {
return thrift.PrependError("error reading map begin: ", err)
}
tMap := make(map[string]string, size)
p.Configuration = tMap
for i := 0; i < size; i ++ {
var _key17 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_key17 = v
}
var _val18 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_val18 = v
}
p.Configuration[_key17] = _val18
}
if err := iprot.ReadMapEnd(ctx); err != nil {
return thrift.PrependError("error reading map end: ", err)
}
return nil
}
func (p *TSOpenSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSOpenSessionResp"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSOpenSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
if err := p.Status.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
return err
}
func (p *TSOpenSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) }
if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) }
return err
}
func (p *TSOpenSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetSessionId() {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionId: ", p), err) }
}
return err
}
func (p *TSOpenSessionResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetConfiguration() {
if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) }
if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil {
return thrift.PrependError("error writing map begin: ", err)
}
for k, v := range p.Configuration {
if err := oprot.WriteString(ctx, string(k)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteMapEnd(ctx); err != nil {
return thrift.PrependError("error writing map end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) }
}
return err
}
func (p *TSOpenSessionResp) Equals(other *TSOpenSessionResp) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if !p.Status.Equals(other.Status) { return false }
if p.ServerProtocolVersion != other.ServerProtocolVersion { return false }
if p.SessionId != other.SessionId {
if p.SessionId == nil || other.SessionId == nil {
return false
}
if (*p.SessionId) != (*other.SessionId) { return false }
}
if len(p.Configuration) != len(other.Configuration) { return false }
for k, _tgt := range p.Configuration {
_src19 := other.Configuration[k]
if _tgt != _src19 { return false }
}
return true
}
func (p *TSOpenSessionResp) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSOpenSessionResp(%+v)", *p)
}
// Attributes:
// - ClientProtocol
// - ZoneId
// - Username
// - Password
// - Configuration
type TSOpenSessionReq struct {
ClientProtocol TSProtocolVersion `thrift:"client_protocol,1,required" db:"client_protocol" json:"client_protocol"`
ZoneId string `thrift:"zoneId,2,required" db:"zoneId" json:"zoneId"`
Username *string `thrift:"username,3" db:"username" json:"username,omitempty"`
Password *string `thrift:"password,4" db:"password" json:"password,omitempty"`
Configuration map[string]string `thrift:"configuration,5" db:"configuration" json:"configuration,omitempty"`
}
func NewTSOpenSessionReq() *TSOpenSessionReq {
return &TSOpenSessionReq{
ClientProtocol: 2,
}
}
func (p *TSOpenSessionReq) GetClientProtocol() TSProtocolVersion {
return p.ClientProtocol
}
func (p *TSOpenSessionReq) GetZoneId() string {
return p.ZoneId
}
var TSOpenSessionReq_Username_DEFAULT string
func (p *TSOpenSessionReq) GetUsername() string {
if !p.IsSetUsername() {
return TSOpenSessionReq_Username_DEFAULT
}
return *p.Username
}
var TSOpenSessionReq_Password_DEFAULT string
func (p *TSOpenSessionReq) GetPassword() string {
if !p.IsSetPassword() {
return TSOpenSessionReq_Password_DEFAULT
}
return *p.Password
}
var TSOpenSessionReq_Configuration_DEFAULT map[string]string
func (p *TSOpenSessionReq) GetConfiguration() map[string]string {
return p.Configuration
}
func (p *TSOpenSessionReq) IsSetUsername() bool {
return p.Username != nil
}
func (p *TSOpenSessionReq) IsSetPassword() bool {
return p.Password != nil
}
func (p *TSOpenSessionReq) IsSetConfiguration() bool {
return p.Configuration != nil
}
func (p *TSOpenSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetClientProtocol bool = false;
var issetZoneId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetClientProtocol = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetZoneId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.STRING {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.STRING {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 5:
if fieldTypeId == thrift.MAP {
if err := p.ReadField5(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetClientProtocol{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientProtocol is not set"));
}
if !issetZoneId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ZoneId is not set"));
}
return nil
}
func (p *TSOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
temp := TSProtocolVersion(v)
p.ClientProtocol = temp
}
return nil
}
func (p *TSOpenSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.ZoneId = v
}
return nil
}
func (p *TSOpenSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.Username = &v
}
return nil
}
func (p *TSOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 4: ", err)
} else {
p.Password = &v
}
return nil
}
func (p *TSOpenSessionReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
_, _, size, err := iprot.ReadMapBegin(ctx)
if err != nil {
return thrift.PrependError("error reading map begin: ", err)
}
tMap := make(map[string]string, size)
p.Configuration = tMap
for i := 0; i < size; i ++ {
var _key20 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_key20 = v
}
var _val21 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_val21 = v
}
p.Configuration[_key20] = _val21
}
if err := iprot.ReadMapEnd(ctx); err != nil {
return thrift.PrependError("error reading map end: ", err)
}
return nil
}
func (p *TSOpenSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSOpenSessionReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
if err := p.writeField5(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSOpenSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) }
if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) }
return err
}
func (p *TSOpenSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "zoneId", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zoneId: ", p), err) }
if err := oprot.WriteString(ctx, string(p.ZoneId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.zoneId (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zoneId: ", p), err) }
return err
}
func (p *TSOpenSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetUsername() {
if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:username: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.Username)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.username (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:username: ", p), err) }
}
return err
}
func (p *TSOpenSessionReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetPassword() {
if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:password: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.Password)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.password (4) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:password: ", p), err) }
}
return err
}
func (p *TSOpenSessionReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetConfiguration() {
if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:configuration: ", p), err) }
if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil {
return thrift.PrependError("error writing map begin: ", err)
}
for k, v := range p.Configuration {
if err := oprot.WriteString(ctx, string(k)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteMapEnd(ctx); err != nil {
return thrift.PrependError("error writing map end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:configuration: ", p), err) }
}
return err
}
func (p *TSOpenSessionReq) Equals(other *TSOpenSessionReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.ClientProtocol != other.ClientProtocol { return false }
if p.ZoneId != other.ZoneId { return false }
if p.Username != other.Username {
if p.Username == nil || other.Username == nil {
return false
}
if (*p.Username) != (*other.Username) { return false }
}
if p.Password != other.Password {
if p.Password == nil || other.Password == nil {
return false
}
if (*p.Password) != (*other.Password) { return false }
}
if len(p.Configuration) != len(other.Configuration) { return false }
for k, _tgt := range p.Configuration {
_src22 := other.Configuration[k]
if _tgt != _src22 { return false }
}
return true
}
func (p *TSOpenSessionReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSOpenSessionReq(%+v)", *p)
}
// Attributes:
// - SessionId
type TSCloseSessionReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
}
func NewTSCloseSessionReq() *TSCloseSessionReq {
return &TSCloseSessionReq{}
}
func (p *TSCloseSessionReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSCloseSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
return nil
}
func (p *TSCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSCloseSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSCloseSessionReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSCloseSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSCloseSessionReq) Equals(other *TSCloseSessionReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
return true
}
func (p *TSCloseSessionReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSCloseSessionReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - Statement
// - StatementId
// - FetchSize
// - Timeout
// - EnableRedirectQuery
type TSExecuteStatementReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
Statement string `thrift:"statement,2,required" db:"statement" json:"statement"`
StatementId int64 `thrift:"statementId,3,required" db:"statementId" json:"statementId"`
FetchSize *int32 `thrift:"fetchSize,4" db:"fetchSize" json:"fetchSize,omitempty"`
Timeout *int64 `thrift:"timeout,5" db:"timeout" json:"timeout,omitempty"`
EnableRedirectQuery *bool `thrift:"enableRedirectQuery,6" db:"enableRedirectQuery" json:"enableRedirectQuery,omitempty"`
}
func NewTSExecuteStatementReq() *TSExecuteStatementReq {
return &TSExecuteStatementReq{}
}
func (p *TSExecuteStatementReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSExecuteStatementReq) GetStatement() string {
return p.Statement
}
func (p *TSExecuteStatementReq) GetStatementId() int64 {
return p.StatementId
}
var TSExecuteStatementReq_FetchSize_DEFAULT int32
func (p *TSExecuteStatementReq) GetFetchSize() int32 {
if !p.IsSetFetchSize() {
return TSExecuteStatementReq_FetchSize_DEFAULT
}
return *p.FetchSize
}
var TSExecuteStatementReq_Timeout_DEFAULT int64
func (p *TSExecuteStatementReq) GetTimeout() int64 {
if !p.IsSetTimeout() {
return TSExecuteStatementReq_Timeout_DEFAULT
}
return *p.Timeout
}
var TSExecuteStatementReq_EnableRedirectQuery_DEFAULT bool
func (p *TSExecuteStatementReq) GetEnableRedirectQuery() bool {
if !p.IsSetEnableRedirectQuery() {
return TSExecuteStatementReq_EnableRedirectQuery_DEFAULT
}
return *p.EnableRedirectQuery
}
func (p *TSExecuteStatementReq) IsSetFetchSize() bool {
return p.FetchSize != nil
}
func (p *TSExecuteStatementReq) IsSetTimeout() bool {
return p.Timeout != nil
}
func (p *TSExecuteStatementReq) IsSetEnableRedirectQuery() bool {
return p.EnableRedirectQuery != nil
}
func (p *TSExecuteStatementReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetStatement bool = false;
var issetStatementId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetStatement = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.I64 {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
issetStatementId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.I32 {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 5:
if fieldTypeId == thrift.I64 {
if err := p.ReadField5(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 6:
if fieldTypeId == thrift.BOOL {
if err := p.ReadField6(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetStatement{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set"));
}
if !issetStatementId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StatementId is not set"));
}
return nil
}
func (p *TSExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Statement = v
}
return nil
}
func (p *TSExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.StatementId = v
}
return nil
}
func (p *TSExecuteStatementReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 4: ", err)
} else {
p.FetchSize = &v
}
return nil
}
func (p *TSExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 5: ", err)
} else {
p.Timeout = &v
}
return nil
}
func (p *TSExecuteStatementReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(ctx); err != nil {
return thrift.PrependError("error reading field 6: ", err)
} else {
p.EnableRedirectQuery = &v
}
return nil
}
func (p *TSExecuteStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSExecuteStatementReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
if err := p.writeField5(ctx, oprot); err != nil { return err }
if err := p.writeField6(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSExecuteStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSExecuteStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) }
if err := oprot.WriteString(ctx, string(p.Statement)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) }
return err
}
func (p *TSExecuteStatementReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "statementId", thrift.I64, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statementId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.StatementId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.statementId (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statementId: ", p), err) }
return err
}
func (p *TSExecuteStatementReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetFetchSize() {
if err := oprot.WriteFieldBegin(ctx, "fetchSize", thrift.I32, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchSize: ", p), err) }
if err := oprot.WriteI32(ctx, int32(*p.FetchSize)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.fetchSize (4) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchSize: ", p), err) }
}
return err
}
func (p *TSExecuteStatementReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetTimeout() {
if err := oprot.WriteFieldBegin(ctx, "timeout", thrift.I64, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:timeout: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.Timeout)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.timeout (5) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:timeout: ", p), err) }
}
return err
}
func (p *TSExecuteStatementReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetEnableRedirectQuery() {
if err := oprot.WriteFieldBegin(ctx, "enableRedirectQuery", thrift.BOOL, 6); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:enableRedirectQuery: ", p), err) }
if err := oprot.WriteBool(ctx, bool(*p.EnableRedirectQuery)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.enableRedirectQuery (6) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 6:enableRedirectQuery: ", p), err) }
}
return err
}
func (p *TSExecuteStatementReq) Equals(other *TSExecuteStatementReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if p.Statement != other.Statement { return false }
if p.StatementId != other.StatementId { return false }
if p.FetchSize != other.FetchSize {
if p.FetchSize == nil || other.FetchSize == nil {
return false
}
if (*p.FetchSize) != (*other.FetchSize) { return false }
}
if p.Timeout != other.Timeout {
if p.Timeout == nil || other.Timeout == nil {
return false
}
if (*p.Timeout) != (*other.Timeout) { return false }
}
if p.EnableRedirectQuery != other.EnableRedirectQuery {
if p.EnableRedirectQuery == nil || other.EnableRedirectQuery == nil {
return false
}
if (*p.EnableRedirectQuery) != (*other.EnableRedirectQuery) { return false }
}
return true
}
func (p *TSExecuteStatementReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSExecuteStatementReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - Statements
type TSExecuteBatchStatementReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
Statements []string `thrift:"statements,2,required" db:"statements" json:"statements"`
}
func NewTSExecuteBatchStatementReq() *TSExecuteBatchStatementReq {
return &TSExecuteBatchStatementReq{}
}
func (p *TSExecuteBatchStatementReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSExecuteBatchStatementReq) GetStatements() []string {
return p.Statements
}
func (p *TSExecuteBatchStatementReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetStatements bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.LIST {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetStatements = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetStatements{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statements is not set"));
}
return nil
}
func (p *TSExecuteBatchStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSExecuteBatchStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]string, 0, size)
p.Statements = tSlice
for i := 0; i < size; i ++ {
var _elem23 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem23 = v
}
p.Statements = append(p.Statements, _elem23)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSExecuteBatchStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSExecuteBatchStatementReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSExecuteBatchStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSExecuteBatchStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "statements", thrift.LIST, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statements: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Statements)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.Statements {
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statements: ", p), err) }
return err
}
func (p *TSExecuteBatchStatementReq) Equals(other *TSExecuteBatchStatementReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if len(p.Statements) != len(other.Statements) { return false }
for i, _tgt := range p.Statements {
_src24 := other.Statements[i]
if _tgt != _src24 { return false }
}
return true
}
func (p *TSExecuteBatchStatementReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSExecuteBatchStatementReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - QueryId
type TSGetOperationStatusReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
QueryId int64 `thrift:"queryId,2,required" db:"queryId" json:"queryId"`
}
func NewTSGetOperationStatusReq() *TSGetOperationStatusReq {
return &TSGetOperationStatusReq{}
}
func (p *TSGetOperationStatusReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSGetOperationStatusReq) GetQueryId() int64 {
return p.QueryId
}
func (p *TSGetOperationStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetQueryId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I64 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetQueryId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetQueryId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set"));
}
return nil
}
func (p *TSGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSGetOperationStatusReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.QueryId = v
}
return nil
}
func (p *TSGetOperationStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSGetOperationStatusReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSGetOperationStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSGetOperationStatusReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.I64, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.QueryId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) }
return err
}
func (p *TSGetOperationStatusReq) Equals(other *TSGetOperationStatusReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if p.QueryId != other.QueryId { return false }
return true
}
func (p *TSGetOperationStatusReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSGetOperationStatusReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - QueryId
type TSCancelOperationReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
QueryId int64 `thrift:"queryId,2,required" db:"queryId" json:"queryId"`
}
func NewTSCancelOperationReq() *TSCancelOperationReq {
return &TSCancelOperationReq{}
}
func (p *TSCancelOperationReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSCancelOperationReq) GetQueryId() int64 {
return p.QueryId
}
func (p *TSCancelOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetQueryId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I64 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetQueryId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetQueryId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set"));
}
return nil
}
func (p *TSCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSCancelOperationReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.QueryId = v
}
return nil
}
func (p *TSCancelOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSCancelOperationReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSCancelOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSCancelOperationReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.I64, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.QueryId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) }
return err
}
func (p *TSCancelOperationReq) Equals(other *TSCancelOperationReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if p.QueryId != other.QueryId { return false }
return true
}
func (p *TSCancelOperationReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSCancelOperationReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - QueryId
// - StatementId
type TSCloseOperationReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
QueryId *int64 `thrift:"queryId,2" db:"queryId" json:"queryId,omitempty"`
StatementId *int64 `thrift:"statementId,3" db:"statementId" json:"statementId,omitempty"`
}
func NewTSCloseOperationReq() *TSCloseOperationReq {
return &TSCloseOperationReq{}
}
func (p *TSCloseOperationReq) GetSessionId() int64 {
return p.SessionId
}
var TSCloseOperationReq_QueryId_DEFAULT int64
func (p *TSCloseOperationReq) GetQueryId() int64 {
if !p.IsSetQueryId() {
return TSCloseOperationReq_QueryId_DEFAULT
}
return *p.QueryId
}
var TSCloseOperationReq_StatementId_DEFAULT int64
func (p *TSCloseOperationReq) GetStatementId() int64 {
if !p.IsSetStatementId() {
return TSCloseOperationReq_StatementId_DEFAULT
}
return *p.StatementId
}
func (p *TSCloseOperationReq) IsSetQueryId() bool {
return p.QueryId != nil
}
func (p *TSCloseOperationReq) IsSetStatementId() bool {
return p.StatementId != nil
}
func (p *TSCloseOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.I64 {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.I64 {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
return nil
}
func (p *TSCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSCloseOperationReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.QueryId = &v
}
return nil
}
func (p *TSCloseOperationReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.StatementId = &v
}
return nil
}
func (p *TSCloseOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSCloseOperationReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSCloseOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSCloseOperationReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetQueryId() {
if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.I64, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:queryId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.QueryId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.queryId (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:queryId: ", p), err) }
}
return err
}
func (p *TSCloseOperationReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetStatementId() {
if err := oprot.WriteFieldBegin(ctx, "statementId", thrift.I64, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statementId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.StatementId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.statementId (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statementId: ", p), err) }
}
return err
}
func (p *TSCloseOperationReq) Equals(other *TSCloseOperationReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if p.QueryId != other.QueryId {
if p.QueryId == nil || other.QueryId == nil {
return false
}
if (*p.QueryId) != (*other.QueryId) { return false }
}
if p.StatementId != other.StatementId {
if p.StatementId == nil || other.StatementId == nil {
return false
}
if (*p.StatementId) != (*other.StatementId) { return false }
}
return true
}
func (p *TSCloseOperationReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSCloseOperationReq(%+v)", *p)
}
// Attributes:
// - SessionId
// - Statement
// - FetchSize
// - QueryId
// - IsAlign
// - Timeout
type TSFetchResultsReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
Statement string `thrift:"statement,2,required" db:"statement" json:"statement"`
FetchSize int32 `thrift:"fetchSize,3,required" db:"fetchSize" json:"fetchSize"`
QueryId int64 `thrift:"queryId,4,required" db:"queryId" json:"queryId"`
IsAlign bool `thrift:"isAlign,5,required" db:"isAlign" json:"isAlign"`
Timeout *int64 `thrift:"timeout,6" db:"timeout" json:"timeout,omitempty"`
}
func NewTSFetchResultsReq() *TSFetchResultsReq {
return &TSFetchResultsReq{}
}
func (p *TSFetchResultsReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSFetchResultsReq) GetStatement() string {
return p.Statement
}
func (p *TSFetchResultsReq) GetFetchSize() int32 {
return p.FetchSize
}
func (p *TSFetchResultsReq) GetQueryId() int64 {
return p.QueryId
}
func (p *TSFetchResultsReq) GetIsAlign() bool {
return p.IsAlign
}
var TSFetchResultsReq_Timeout_DEFAULT int64
func (p *TSFetchResultsReq) GetTimeout() int64 {
if !p.IsSetTimeout() {
return TSFetchResultsReq_Timeout_DEFAULT
}
return *p.Timeout
}
func (p *TSFetchResultsReq) IsSetTimeout() bool {
return p.Timeout != nil
}
func (p *TSFetchResultsReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetStatement bool = false;
var issetFetchSize bool = false;
var issetQueryId bool = false;
var issetIsAlign bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetStatement = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.I32 {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
issetFetchSize = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.I64 {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
issetQueryId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 5:
if fieldTypeId == thrift.BOOL {
if err := p.ReadField5(ctx, iprot); err != nil {
return err
}
issetIsAlign = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 6:
if fieldTypeId == thrift.I64 {
if err := p.ReadField6(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetStatement{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Statement is not set"));
}
if !issetFetchSize{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FetchSize is not set"));
}
if !issetQueryId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set"));
}
if !issetIsAlign{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsAlign is not set"));
}
return nil
}
func (p *TSFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSFetchResultsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Statement = v
}
return nil
}
func (p *TSFetchResultsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI32(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.FetchSize = v
}
return nil
}
func (p *TSFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 4: ", err)
} else {
p.QueryId = v
}
return nil
}
func (p *TSFetchResultsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(ctx); err != nil {
return thrift.PrependError("error reading field 5: ", err)
} else {
p.IsAlign = v
}
return nil
}
func (p *TSFetchResultsReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 6: ", err)
} else {
p.Timeout = &v
}
return nil
}
func (p *TSFetchResultsReq) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSFetchResultsReq"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
if err := p.writeField5(ctx, oprot); err != nil { return err }
if err := p.writeField6(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSFetchResultsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) }
return err
}
func (p *TSFetchResultsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) }
if err := oprot.WriteString(ctx, string(p.Statement)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) }
return err
}
func (p *TSFetchResultsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "fetchSize", thrift.I32, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fetchSize: ", p), err) }
if err := oprot.WriteI32(ctx, int32(p.FetchSize)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.fetchSize (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fetchSize: ", p), err) }
return err
}
func (p *TSFetchResultsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.I64, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:queryId: ", p), err) }
if err := oprot.WriteI64(ctx, int64(p.QueryId)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.queryId (4) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:queryId: ", p), err) }
return err
}
func (p *TSFetchResultsReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "isAlign", thrift.BOOL, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:isAlign: ", p), err) }
if err := oprot.WriteBool(ctx, bool(p.IsAlign)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.isAlign (5) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:isAlign: ", p), err) }
return err
}
func (p *TSFetchResultsReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetTimeout() {
if err := oprot.WriteFieldBegin(ctx, "timeout", thrift.I64, 6); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:timeout: ", p), err) }
if err := oprot.WriteI64(ctx, int64(*p.Timeout)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.timeout (6) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 6:timeout: ", p), err) }
}
return err
}
func (p *TSFetchResultsReq) Equals(other *TSFetchResultsReq) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if p.SessionId != other.SessionId { return false }
if p.Statement != other.Statement { return false }
if p.FetchSize != other.FetchSize { return false }
if p.QueryId != other.QueryId { return false }
if p.IsAlign != other.IsAlign { return false }
if p.Timeout != other.Timeout {
if p.Timeout == nil || other.Timeout == nil {
return false
}
if (*p.Timeout) != (*other.Timeout) { return false }
}
return true
}
func (p *TSFetchResultsReq) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSFetchResultsReq(%+v)", *p)
}
// Attributes:
// - Status
// - HasResultSet
// - IsAlign
// - QueryDataSet
// - NonAlignQueryDataSet
type TSFetchResultsResp struct {
Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"`
HasResultSet bool `thrift:"hasResultSet,2,required" db:"hasResultSet" json:"hasResultSet"`
IsAlign bool `thrift:"isAlign,3,required" db:"isAlign" json:"isAlign"`
QueryDataSet *TSQueryDataSet `thrift:"queryDataSet,4" db:"queryDataSet" json:"queryDataSet,omitempty"`
NonAlignQueryDataSet *TSQueryNonAlignDataSet `thrift:"nonAlignQueryDataSet,5" db:"nonAlignQueryDataSet" json:"nonAlignQueryDataSet,omitempty"`
}
func NewTSFetchResultsResp() *TSFetchResultsResp {
return &TSFetchResultsResp{}
}
var TSFetchResultsResp_Status_DEFAULT *TSStatus
func (p *TSFetchResultsResp) GetStatus() *TSStatus {
if !p.IsSetStatus() {
return TSFetchResultsResp_Status_DEFAULT
}
return p.Status
}
func (p *TSFetchResultsResp) GetHasResultSet() bool {
return p.HasResultSet
}
func (p *TSFetchResultsResp) GetIsAlign() bool {
return p.IsAlign
}
var TSFetchResultsResp_QueryDataSet_DEFAULT *TSQueryDataSet
func (p *TSFetchResultsResp) GetQueryDataSet() *TSQueryDataSet {
if !p.IsSetQueryDataSet() {
return TSFetchResultsResp_QueryDataSet_DEFAULT
}
return p.QueryDataSet
}
var TSFetchResultsResp_NonAlignQueryDataSet_DEFAULT *TSQueryNonAlignDataSet
func (p *TSFetchResultsResp) GetNonAlignQueryDataSet() *TSQueryNonAlignDataSet {
if !p.IsSetNonAlignQueryDataSet() {
return TSFetchResultsResp_NonAlignQueryDataSet_DEFAULT
}
return p.NonAlignQueryDataSet
}
func (p *TSFetchResultsResp) IsSetStatus() bool {
return p.Status != nil
}
func (p *TSFetchResultsResp) IsSetQueryDataSet() bool {
return p.QueryDataSet != nil
}
func (p *TSFetchResultsResp) IsSetNonAlignQueryDataSet() bool {
return p.NonAlignQueryDataSet != nil
}
func (p *TSFetchResultsResp) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetStatus bool = false;
var issetHasResultSet bool = false;
var issetIsAlign bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetStatus = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.BOOL {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetHasResultSet = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.BOOL {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
issetIsAlign = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.STRUCT {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 5:
if fieldTypeId == thrift.STRUCT {
if err := p.ReadField5(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetStatus{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
}
if !issetHasResultSet{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HasResultSet is not set"));
}
if !issetIsAlign{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsAlign is not set"));
}
return nil
}
func (p *TSFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
p.Status = &TSStatus{}
if err := p.Status.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
}
return nil
}
func (p *TSFetchResultsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.HasResultSet = v
}
return nil
}
func (p *TSFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadBool(ctx); err != nil {
return thrift.PrependError("error reading field 3: ", err)
} else {
p.IsAlign = v
}
return nil
}
func (p *TSFetchResultsResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
p.QueryDataSet = &TSQueryDataSet{}
if err := p.QueryDataSet.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.QueryDataSet), err)
}
return nil
}
func (p *TSFetchResultsResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
p.NonAlignQueryDataSet = &TSQueryNonAlignDataSet{}
if err := p.NonAlignQueryDataSet.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NonAlignQueryDataSet), err)
}
return nil
}
func (p *TSFetchResultsResp) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSFetchResultsResp"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
if err := p.writeField5(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSFetchResultsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
if err := p.Status.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
return err
}
func (p *TSFetchResultsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasResultSet: ", p), err) }
if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasResultSet: ", p), err) }
return err
}
func (p *TSFetchResultsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "isAlign", thrift.BOOL, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:isAlign: ", p), err) }
if err := oprot.WriteBool(ctx, bool(p.IsAlign)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.isAlign (3) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:isAlign: ", p), err) }
return err
}
func (p *TSFetchResultsResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetQueryDataSet() {
if err := oprot.WriteFieldBegin(ctx, "queryDataSet", thrift.STRUCT, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:queryDataSet: ", p), err) }
if err := p.QueryDataSet.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.QueryDataSet), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:queryDataSet: ", p), err) }
}
return err
}
func (p *TSFetchResultsResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetNonAlignQueryDataSet() {
if err := oprot.WriteFieldBegin(ctx, "nonAlignQueryDataSet", thrift.STRUCT, 5); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nonAlignQueryDataSet: ", p), err) }
if err := p.NonAlignQueryDataSet.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NonAlignQueryDataSet), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nonAlignQueryDataSet: ", p), err) }
}
return err
}
func (p *TSFetchResultsResp) Equals(other *TSFetchResultsResp) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if !p.Status.Equals(other.Status) { return false }
if p.HasResultSet != other.HasResultSet { return false }
if p.IsAlign != other.IsAlign { return false }
if !p.QueryDataSet.Equals(other.QueryDataSet) { return false }
if !p.NonAlignQueryDataSet.Equals(other.NonAlignQueryDataSet) { return false }
return true
}
func (p *TSFetchResultsResp) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSFetchResultsResp(%+v)", *p)
}
// Attributes:
// - Status
// - MetadataInJson
// - ColumnsList
// - DataType
type TSFetchMetadataResp struct {
Status *TSStatus `thrift:"status,1,required" db:"status" json:"status"`
MetadataInJson *string `thrift:"metadataInJson,2" db:"metadataInJson" json:"metadataInJson,omitempty"`
ColumnsList []string `thrift:"columnsList,3" db:"columnsList" json:"columnsList,omitempty"`
DataType *string `thrift:"dataType,4" db:"dataType" json:"dataType,omitempty"`
}
func NewTSFetchMetadataResp() *TSFetchMetadataResp {
return &TSFetchMetadataResp{}
}
var TSFetchMetadataResp_Status_DEFAULT *TSStatus
func (p *TSFetchMetadataResp) GetStatus() *TSStatus {
if !p.IsSetStatus() {
return TSFetchMetadataResp_Status_DEFAULT
}
return p.Status
}
var TSFetchMetadataResp_MetadataInJson_DEFAULT string
func (p *TSFetchMetadataResp) GetMetadataInJson() string {
if !p.IsSetMetadataInJson() {
return TSFetchMetadataResp_MetadataInJson_DEFAULT
}
return *p.MetadataInJson
}
var TSFetchMetadataResp_ColumnsList_DEFAULT []string
func (p *TSFetchMetadataResp) GetColumnsList() []string {
return p.ColumnsList
}
var TSFetchMetadataResp_DataType_DEFAULT string
func (p *TSFetchMetadataResp) GetDataType() string {
if !p.IsSetDataType() {
return TSFetchMetadataResp_DataType_DEFAULT
}
return *p.DataType
}
func (p *TSFetchMetadataResp) IsSetStatus() bool {
return p.Status != nil
}
func (p *TSFetchMetadataResp) IsSetMetadataInJson() bool {
return p.MetadataInJson != nil
}
func (p *TSFetchMetadataResp) IsSetColumnsList() bool {
return p.ColumnsList != nil
}
func (p *TSFetchMetadataResp) IsSetDataType() bool {
return p.DataType != nil
}
func (p *TSFetchMetadataResp) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetStatus bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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(ctx, iprot); err != nil {
return err
}
issetStatus = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.LIST {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 4:
if fieldTypeId == thrift.STRING {
if err := p.ReadField4(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetStatus{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set"));
}
return nil
}
func (p *TSFetchMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
p.Status = &TSStatus{}
if err := p.Status.Read(ctx, iprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err)
}
return nil
}
func (p *TSFetchMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.MetadataInJson = &v
}
return nil
}
func (p *TSFetchMetadataResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
_, size, err := iprot.ReadListBegin(ctx)
if err != nil {
return thrift.PrependError("error reading list begin: ", err)
}
tSlice := make([]string, 0, size)
p.ColumnsList = tSlice
for i := 0; i < size; i ++ {
var _elem25 string
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 0: ", err)
} else {
_elem25 = v
}
p.ColumnsList = append(p.ColumnsList, _elem25)
}
if err := iprot.ReadListEnd(ctx); err != nil {
return thrift.PrependError("error reading list end: ", err)
}
return nil
}
func (p *TSFetchMetadataResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 4: ", err)
} else {
p.DataType = &v
}
return nil
}
func (p *TSFetchMetadataResp) Write(ctx context.Context, oprot thrift.TProtocol) error {
if err := oprot.WriteStructBegin(ctx, "TSFetchMetadataResp"); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) }
if p != nil {
if err := p.writeField1(ctx, oprot); err != nil { return err }
if err := p.writeField2(ctx, oprot); err != nil { return err }
if err := p.writeField3(ctx, oprot); err != nil { return err }
if err := p.writeField4(ctx, oprot); err != nil { return err }
}
if err := oprot.WriteFieldStop(ctx); err != nil {
return thrift.PrependError("write field stop error: ", err) }
if err := oprot.WriteStructEnd(ctx); err != nil {
return thrift.PrependError("write struct stop error: ", err) }
return nil
}
func (p *TSFetchMetadataResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) }
if err := p.Status.Write(ctx, oprot); err != nil {
return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) }
return err
}
func (p *TSFetchMetadataResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetMetadataInJson() {
if err := oprot.WriteFieldBegin(ctx, "metadataInJson", thrift.STRING, 2); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:metadataInJson: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.MetadataInJson)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.metadataInJson (2) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 2:metadataInJson: ", p), err) }
}
return err
}
func (p *TSFetchMetadataResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetColumnsList() {
if err := oprot.WriteFieldBegin(ctx, "columnsList", thrift.LIST, 3); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columnsList: ", p), err) }
if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.ColumnsList)); err != nil {
return thrift.PrependError("error writing list begin: ", err)
}
for _, v := range p.ColumnsList {
if err := oprot.WriteString(ctx, string(v)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) }
}
if err := oprot.WriteListEnd(ctx); err != nil {
return thrift.PrependError("error writing list end: ", err)
}
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columnsList: ", p), err) }
}
return err
}
func (p *TSFetchMetadataResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
if p.IsSetDataType() {
if err := oprot.WriteFieldBegin(ctx, "dataType", thrift.STRING, 4); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:dataType: ", p), err) }
if err := oprot.WriteString(ctx, string(*p.DataType)); err != nil {
return thrift.PrependError(fmt.Sprintf("%T.dataType (4) field write error: ", p), err) }
if err := oprot.WriteFieldEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dataType: ", p), err) }
}
return err
}
func (p *TSFetchMetadataResp) Equals(other *TSFetchMetadataResp) bool {
if p == other {
return true
} else if p == nil || other == nil {
return false
}
if !p.Status.Equals(other.Status) { return false }
if p.MetadataInJson != other.MetadataInJson {
if p.MetadataInJson == nil || other.MetadataInJson == nil {
return false
}
if (*p.MetadataInJson) != (*other.MetadataInJson) { return false }
}
if len(p.ColumnsList) != len(other.ColumnsList) { return false }
for i, _tgt := range p.ColumnsList {
_src26 := other.ColumnsList[i]
if _tgt != _src26 { return false }
}
if p.DataType != other.DataType {
if p.DataType == nil || other.DataType == nil {
return false
}
if (*p.DataType) != (*other.DataType) { return false }
}
return true
}
func (p *TSFetchMetadataResp) String() string {
if p == nil {
return "<nil>"
}
return fmt.Sprintf("TSFetchMetadataResp(%+v)", *p)
}
// Attributes:
// - SessionId
// - Type
// - ColumnPath
type TSFetchMetadataReq struct {
SessionId int64 `thrift:"sessionId,1,required" db:"sessionId" json:"sessionId"`
Type string `thrift:"type,2,required" db:"type" json:"type"`
ColumnPath *string `thrift:"columnPath,3" db:"columnPath" json:"columnPath,omitempty"`
}
func NewTSFetchMetadataReq() *TSFetchMetadataReq {
return &TSFetchMetadataReq{}
}
func (p *TSFetchMetadataReq) GetSessionId() int64 {
return p.SessionId
}
func (p *TSFetchMetadataReq) GetType() string {
return p.Type
}
var TSFetchMetadataReq_ColumnPath_DEFAULT string
func (p *TSFetchMetadataReq) GetColumnPath() string {
if !p.IsSetColumnPath() {
return TSFetchMetadataReq_ColumnPath_DEFAULT
}
return *p.ColumnPath
}
func (p *TSFetchMetadataReq) IsSetColumnPath() bool {
return p.ColumnPath != nil
}
func (p *TSFetchMetadataReq) Read(ctx context.Context, iprot thrift.TProtocol) error {
if _, err := iprot.ReadStructBegin(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err)
}
var issetSessionId bool = false;
var issetType bool = false;
for {
_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx)
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.I64 {
if err := p.ReadField1(ctx, iprot); err != nil {
return err
}
issetSessionId = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 2:
if fieldTypeId == thrift.STRING {
if err := p.ReadField2(ctx, iprot); err != nil {
return err
}
issetType = true
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
case 3:
if fieldTypeId == thrift.STRING {
if err := p.ReadField3(ctx, iprot); err != nil {
return err
}
} else {
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
default:
if err := iprot.Skip(ctx, fieldTypeId); err != nil {
return err
}
}
if err := iprot.ReadFieldEnd(ctx); err != nil {
return err
}
}
if err := iprot.ReadStructEnd(ctx); err != nil {
return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}
if !issetSessionId{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionId is not set"));
}
if !issetType{
return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set"));
}
return nil
}
func (p *TSFetchMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadI64(ctx); err != nil {
return thrift.PrependError("error reading field 1: ", err)
} else {
p.SessionId = v
}
return nil
}
func (p *TSFetchMetadataReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
if v, err := iprot.ReadString(ctx); err != nil {
return thrift.PrependError("error reading field 2: ", err)
} else {
p.Type = v
}