// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT.

package trino

import (
	"bytes"
	"context"
	"database/sql/driver"
	"errors"
	"fmt"
	thrift "github.com/apache/thrift/lib/go/thrift"
	"regexp"
	"strings"
	"time"
)

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

// (needed by validator.)
var _ = strings.Contains
var _ = regexp.MatchString

type TrinoThriftBound int64

const (
	TrinoThriftBound_BELOW   TrinoThriftBound = 1
	TrinoThriftBound_EXACTLY TrinoThriftBound = 2
	TrinoThriftBound_ABOVE   TrinoThriftBound = 3
)

func (p TrinoThriftBound) String() string {
	switch p {
	case TrinoThriftBound_BELOW:
		return "BELOW"
	case TrinoThriftBound_EXACTLY:
		return "EXACTLY"
	case TrinoThriftBound_ABOVE:
		return "ABOVE"
	}
	return "<UNSET>"
}

func TrinoThriftBoundFromString(s string) (TrinoThriftBound, error) {
	switch s {
	case "BELOW":
		return TrinoThriftBound_BELOW, nil
	case "EXACTLY":
		return TrinoThriftBound_EXACTLY, nil
	case "ABOVE":
		return TrinoThriftBound_ABOVE, nil
	}
	return TrinoThriftBound(0), fmt.Errorf("not a valid TrinoThriftBound string")
}

func TrinoThriftBoundPtr(v TrinoThriftBound) *TrinoThriftBound { return &v }

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

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

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

func (p *TrinoThriftBound) Value() (driver.Value, error) {
	if p == nil {
		return nil, nil
	}
	return int64(*p), nil
}

// Attributes:
//   - Message
//   - Retryable
type TrinoThriftServiceException struct {
	Message   string `thrift:"message,1" db:"message" json:"message"`
	Retryable bool   `thrift:"retryable,2" db:"retryable" json:"retryable"`
}

func NewTrinoThriftServiceException() *TrinoThriftServiceException {
	return &TrinoThriftServiceException{}
}

func (p *TrinoThriftServiceException) GetMessage() string {
	return p.Message
}

func (p *TrinoThriftServiceException) GetRetryable() bool {
	return p.Retryable
}
func (p *TrinoThriftServiceException) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftServiceException) 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.Message = v
	}
	return nil
}

func (p *TrinoThriftServiceException) 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.Retryable = v
	}
	return nil
}

func (p *TrinoThriftServiceException) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftServiceException"); 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 *TrinoThriftServiceException) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "message", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:message: ", p), err)
	}
	if err := oprot.WriteString(ctx, string(p.Message)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.message (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:message: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftServiceException) Equals(other *TrinoThriftServiceException) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.Message != other.Message {
		return false
	}
	if p.Retryable != other.Retryable {
		return false
	}
	return true
}

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

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

func (TrinoThriftServiceException) TExceptionType() thrift.TExceptionType {
	return thrift.TExceptionTypeCompiled
}

var _ thrift.TException = (*TrinoThriftServiceException)(nil)

func (p *TrinoThriftServiceException) Validate() error {
	return nil
}

// Attributes:
//   - SchemaName
type TrinoThriftNullableSchemaName struct {
	SchemaName *string `thrift:"schemaName,1" db:"schemaName" json:"schemaName,omitempty"`
}

func NewTrinoThriftNullableSchemaName() *TrinoThriftNullableSchemaName {
	return &TrinoThriftNullableSchemaName{}
}

var TrinoThriftNullableSchemaName_SchemaName_DEFAULT string

func (p *TrinoThriftNullableSchemaName) GetSchemaName() string {
	if !p.IsSetSchemaName() {
		return TrinoThriftNullableSchemaName_SchemaName_DEFAULT
	}
	return *p.SchemaName
}
func (p *TrinoThriftNullableSchemaName) IsSetSchemaName() bool {
	return p.SchemaName != nil
}

func (p *TrinoThriftNullableSchemaName) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftNullableSchemaName) 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.SchemaName = &v
	}
	return nil
}

func (p *TrinoThriftNullableSchemaName) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftNullableSchemaName"); 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 *TrinoThriftNullableSchemaName) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSchemaName() {
		if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaName: ", p), err)
		}
		if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.schemaName (1) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaName: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftNullableSchemaName) Equals(other *TrinoThriftNullableSchemaName) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.SchemaName != other.SchemaName {
		if p.SchemaName == nil || other.SchemaName == nil {
			return false
		}
		if (*p.SchemaName) != (*other.SchemaName) {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftNullableSchemaName) Validate() error {
	return nil
}

// Attributes:
//   - SchemaName
//   - TableName
type TrinoThriftSchemaTableName struct {
	SchemaName string `thrift:"schemaName,1" db:"schemaName" json:"schemaName"`
	TableName  string `thrift:"tableName,2" db:"tableName" json:"tableName"`
}

func NewTrinoThriftSchemaTableName() *TrinoThriftSchemaTableName {
	return &TrinoThriftSchemaTableName{}
}

func (p *TrinoThriftSchemaTableName) GetSchemaName() string {
	return p.SchemaName
}

func (p *TrinoThriftSchemaTableName) GetTableName() string {
	return p.TableName
}
func (p *TrinoThriftSchemaTableName) 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)
	}

	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
				}
			} 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
				}
			}
		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)
	}
	return nil
}

func (p *TrinoThriftSchemaTableName) 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.SchemaName = v
	}
	return nil
}

func (p *TrinoThriftSchemaTableName) 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.TableName = v
	}
	return nil
}

func (p *TrinoThriftSchemaTableName) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftSchemaTableName"); 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 *TrinoThriftSchemaTableName) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaName: ", p), err)
	}
	if err := oprot.WriteString(ctx, string(p.SchemaName)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.schemaName (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaName: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftSchemaTableName) Equals(other *TrinoThriftSchemaTableName) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.SchemaName != other.SchemaName {
		return false
	}
	if p.TableName != other.TableName {
		return false
	}
	return true
}

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

func (p *TrinoThriftSchemaTableName) Validate() error {
	return nil
}

// Attributes:
//   - SchemaTableName
//   - Columns
//   - Comment
//   - IndexableKeys: Returns a list of key sets which can be used for index lookups.
//
// The list is expected to have only unique key sets.
// {@code set<set<string>>} is not used here because some languages (like php) don't support it.
type TrinoThriftTableMetadata struct {
	SchemaTableName *TrinoThriftSchemaTableName  `thrift:"schemaTableName,1" db:"schemaTableName" json:"schemaTableName"`
	Columns         []*TrinoThriftColumnMetadata `thrift:"columns,2" db:"columns" json:"columns"`
	Comment         *string                      `thrift:"comment,3" db:"comment" json:"comment,omitempty"`
	IndexableKeys   [][]string                   `thrift:"indexableKeys,4" db:"indexableKeys" json:"indexableKeys,omitempty"`
}

func NewTrinoThriftTableMetadata() *TrinoThriftTableMetadata {
	return &TrinoThriftTableMetadata{}
}

var TrinoThriftTableMetadata_SchemaTableName_DEFAULT *TrinoThriftSchemaTableName

func (p *TrinoThriftTableMetadata) GetSchemaTableName() *TrinoThriftSchemaTableName {
	if !p.IsSetSchemaTableName() {
		return TrinoThriftTableMetadata_SchemaTableName_DEFAULT
	}
	return p.SchemaTableName
}

func (p *TrinoThriftTableMetadata) GetColumns() []*TrinoThriftColumnMetadata {
	return p.Columns
}

var TrinoThriftTableMetadata_Comment_DEFAULT string

func (p *TrinoThriftTableMetadata) GetComment() string {
	if !p.IsSetComment() {
		return TrinoThriftTableMetadata_Comment_DEFAULT
	}
	return *p.Comment
}

var TrinoThriftTableMetadata_IndexableKeys_DEFAULT [][]string

func (p *TrinoThriftTableMetadata) GetIndexableKeys() [][]string {
	return p.IndexableKeys
}
func (p *TrinoThriftTableMetadata) IsSetSchemaTableName() bool {
	return p.SchemaTableName != nil
}

func (p *TrinoThriftTableMetadata) IsSetComment() bool {
	return p.Comment != nil
}

func (p *TrinoThriftTableMetadata) IsSetIndexableKeys() bool {
	return p.IndexableKeys != nil
}

func (p *TrinoThriftTableMetadata) 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)
	}

	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
				}
			} 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
				}
			} 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.LIST {
				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)
	}
	return nil
}

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

func (p *TrinoThriftTableMetadata) 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([]*TrinoThriftColumnMetadata, 0, size)
	p.Columns = tSlice
	for i := 0; i < size; i++ {
		_elem0 := &TrinoThriftColumnMetadata{}
		if err := _elem0.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err)
		}
		p.Columns = append(p.Columns, _elem0)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftTableMetadata) 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.Comment = &v
	}
	return nil
}

func (p *TrinoThriftTableMetadata) ReadField4(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.IndexableKeys = tSlice
	for i := 0; i < size; i++ {
		_, size, err := iprot.ReadSetBegin(ctx)
		if err != nil {
			return thrift.PrependError("error reading set begin: ", err)
		}
		tSet := make([]string, 0, size)
		_elem1 := tSet
		for i := 0; i < size; i++ {
			var _elem2 string
			if v, err := iprot.ReadString(ctx); err != nil {
				return thrift.PrependError("error reading field 0: ", err)
			} else {
				_elem2 = v
			}
			_elem1 = append(_elem1, _elem2)
		}
		if err := iprot.ReadSetEnd(ctx); err != nil {
			return thrift.PrependError("error reading set end: ", err)
		}
		p.IndexableKeys = append(p.IndexableKeys, _elem1)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftTableMetadata) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftTableMetadata"); 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 *TrinoThriftTableMetadata) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaTableName", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaTableName: ", p), err)
	}
	if err := p.SchemaTableName.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaTableName), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaTableName: ", p), err)
	}
	return err
}

func (p *TrinoThriftTableMetadata) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:columns: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Columns {
		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 2:columns: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftTableMetadata) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetIndexableKeys() {
		if err := oprot.WriteFieldBegin(ctx, "indexableKeys", thrift.LIST, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:indexableKeys: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.SET, len(p.IndexableKeys)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.IndexableKeys {
			if err := oprot.WriteSetBegin(ctx, thrift.STRING, len(v)); err != nil {
				return thrift.PrependError("error writing set begin: ", err)
			}
			for i := 0; i < len(v); i++ {
				for j := i + 1; j < len(v); j++ {
					if func(tgt, src string) bool {
						if tgt != src {
							return false
						}
						return true
					}(v[i], v[j]) {
						return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", v))
					}
				}
			}
			for _, v := range v {
				if err := oprot.WriteString(ctx, string(v)); err != nil {
					return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
				}
			}
			if err := oprot.WriteSetEnd(ctx); err != nil {
				return thrift.PrependError("error writing set end: ", 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 4:indexableKeys: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftTableMetadata) Equals(other *TrinoThriftTableMetadata) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.SchemaTableName.Equals(other.SchemaTableName) {
		return false
	}
	if len(p.Columns) != len(other.Columns) {
		return false
	}
	for i, _tgt := range p.Columns {
		_src3 := other.Columns[i]
		if !_tgt.Equals(_src3) {
			return false
		}
	}
	if p.Comment != other.Comment {
		if p.Comment == nil || other.Comment == nil {
			return false
		}
		if (*p.Comment) != (*other.Comment) {
			return false
		}
	}
	if len(p.IndexableKeys) != len(other.IndexableKeys) {
		return false
	}
	for i, _tgt := range p.IndexableKeys {
		_src4 := other.IndexableKeys[i]
		if len(_tgt) != len(_src4) {
			return false
		}
		for i, _tgt := range _tgt {
			_src5 := _src4[i]
			if _tgt != _src5 {
				return false
			}
		}
	}
	return true
}

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

func (p *TrinoThriftTableMetadata) Validate() error {
	return nil
}

// Attributes:
//   - Name
//   - Type
//   - Comment
//   - Hidden
type TrinoThriftColumnMetadata struct {
	Name    string  `thrift:"name,1" db:"name" json:"name"`
	Type    string  `thrift:"type,2" db:"type" json:"type"`
	Comment *string `thrift:"comment,3" db:"comment" json:"comment,omitempty"`
	Meta    any     `json:"meta,omitempty"`
	Hidden  bool    `thrift:"hidden,4" db:"hidden" json:"hidden"`
}

func NewTrinoThriftColumnMetadata() *TrinoThriftColumnMetadata {
	return &TrinoThriftColumnMetadata{}
}

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

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

var TrinoThriftColumnMetadata_Comment_DEFAULT string

func (p *TrinoThriftColumnMetadata) GetComment() string {
	if !p.IsSetComment() {
		return TrinoThriftColumnMetadata_Comment_DEFAULT
	}
	return *p.Comment
}

func (p *TrinoThriftColumnMetadata) GetHidden() bool {
	return p.Hidden
}
func (p *TrinoThriftColumnMetadata) IsSetComment() bool {
	return p.Comment != nil
}

func (p *TrinoThriftColumnMetadata) 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)
	}

	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
				}
			} 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.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.BOOL {
				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)
	}
	return nil
}

func (p *TrinoThriftColumnMetadata) 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.Name = v
	}
	return nil
}

func (p *TrinoThriftColumnMetadata) 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
	}
	return nil
}

func (p *TrinoThriftColumnMetadata) 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.Comment = &v
	}
	return nil
}

func (p *TrinoThriftColumnMetadata) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(ctx); err != nil {
		return thrift.PrependError("error reading field 4: ", err)
	} else {
		p.Hidden = v
	}
	return nil
}

func (p *TrinoThriftColumnMetadata) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftColumnMetadata"); 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 *TrinoThriftColumnMetadata) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err)
	}
	if err := oprot.WriteString(ctx, string(p.Name)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err)
	}
	return err
}

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

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

func (p *TrinoThriftColumnMetadata) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "hidden", thrift.BOOL, 4); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hidden: ", p), err)
	}
	if err := oprot.WriteBool(ctx, bool(p.Hidden)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.hidden (4) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hidden: ", p), err)
	}
	return err
}

func (p *TrinoThriftColumnMetadata) Equals(other *TrinoThriftColumnMetadata) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.Name != other.Name {
		return false
	}
	if p.Type != other.Type {
		return false
	}
	if p.Comment != other.Comment {
		if p.Comment == nil || other.Comment == nil {
			return false
		}
		if (*p.Comment) != (*other.Comment) {
			return false
		}
	}
	if p.Hidden != other.Hidden {
		return false
	}
	return true
}

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

func (p *TrinoThriftColumnMetadata) Validate() error {
	return nil
}

// Attributes:
//   - Columns
type TrinoThriftNullableColumnSet struct {
	Columns []string `thrift:"columns,1" db:"columns" json:"columns,omitempty"`
}

func NewTrinoThriftNullableColumnSet() *TrinoThriftNullableColumnSet {
	return &TrinoThriftNullableColumnSet{}
}

var TrinoThriftNullableColumnSet_Columns_DEFAULT []string

func (p *TrinoThriftNullableColumnSet) GetColumns() []string {
	return p.Columns
}
func (p *TrinoThriftNullableColumnSet) IsSetColumns() bool {
	return p.Columns != nil
}

func (p *TrinoThriftNullableColumnSet) 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)
	}

	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.SET {
				if err := p.ReadField1(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)
	}
	return nil
}

func (p *TrinoThriftNullableColumnSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
	_, size, err := iprot.ReadSetBegin(ctx)
	if err != nil {
		return thrift.PrependError("error reading set begin: ", err)
	}
	tSet := make([]string, 0, size)
	p.Columns = tSet
	for i := 0; i < size; i++ {
		var _elem6 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem6 = v
		}
		p.Columns = append(p.Columns, _elem6)
	}
	if err := iprot.ReadSetEnd(ctx); err != nil {
		return thrift.PrependError("error reading set end: ", err)
	}
	return nil
}

func (p *TrinoThriftNullableColumnSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftNullableColumnSet"); 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 *TrinoThriftNullableColumnSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetColumns() {
		if err := oprot.WriteFieldBegin(ctx, "columns", thrift.SET, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err)
		}
		if err := oprot.WriteSetBegin(ctx, thrift.STRING, len(p.Columns)); err != nil {
			return thrift.PrependError("error writing set begin: ", err)
		}
		for i := 0; i < len(p.Columns); i++ {
			for j := i + 1; j < len(p.Columns); j++ {
				if func(tgt, src string) bool {
					if tgt != src {
						return false
					}
					return true
				}(p.Columns[i], p.Columns[j]) {
					return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Columns))
				}
			}
		}
		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.WriteSetEnd(ctx); err != nil {
			return thrift.PrependError("error writing set end: ", err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftNullableColumnSet) Equals(other *TrinoThriftNullableColumnSet) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Columns) != len(other.Columns) {
		return false
	}
	for i, _tgt := range p.Columns {
		_src7 := other.Columns[i]
		if _tgt != _src7 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftNullableColumnSet) Validate() error {
	return nil
}

// Attributes:
//   - Domains: Return a map of column names to constraints.
type TrinoThriftTupleDomain struct {
	Domains map[string]*TrinoThriftDomain `thrift:"domains,1" db:"domains" json:"domains,omitempty"`
}

func NewTrinoThriftTupleDomain() *TrinoThriftTupleDomain {
	return &TrinoThriftTupleDomain{}
}

var TrinoThriftTupleDomain_Domains_DEFAULT map[string]*TrinoThriftDomain

func (p *TrinoThriftTupleDomain) GetDomains() map[string]*TrinoThriftDomain {
	return p.Domains
}
func (p *TrinoThriftTupleDomain) IsSetDomains() bool {
	return p.Domains != nil
}

func (p *TrinoThriftTupleDomain) 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)
	}

	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.MAP {
				if err := p.ReadField1(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)
	}
	return nil
}

func (p *TrinoThriftTupleDomain) ReadField1(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]*TrinoThriftDomain, size)
	p.Domains = tMap
	for i := 0; i < size; i++ {
		var _key8 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_key8 = v
		}
		_val9 := &TrinoThriftDomain{}
		if err := _val9.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val9), err)
		}
		p.Domains[_key8] = _val9
	}
	if err := iprot.ReadMapEnd(ctx); err != nil {
		return thrift.PrependError("error reading map end: ", err)
	}
	return nil
}

func (p *TrinoThriftTupleDomain) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftTupleDomain"); 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 *TrinoThriftTupleDomain) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetDomains() {
		if err := oprot.WriteFieldBegin(ctx, "domains", thrift.MAP, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:domains: ", p), err)
		}
		if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Domains)); err != nil {
			return thrift.PrependError("error writing map begin: ", err)
		}
		for k, v := range p.Domains {
			if err := oprot.WriteString(ctx, string(k)); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err)
			}
			if err := v.Write(ctx, oprot); err != nil {
				return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), 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 1:domains: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftTupleDomain) Equals(other *TrinoThriftTupleDomain) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Domains) != len(other.Domains) {
		return false
	}
	for k, _tgt := range p.Domains {
		_src10 := other.Domains[k]
		if !_tgt.Equals(_src10) {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftTupleDomain) Validate() error {
	return nil
}

// Set that either includes all values, or excludes all values.
//
// Attributes:
//   - All
type TrinoThriftAllOrNoneValueSet struct {
	All bool `thrift:"all,1" db:"all" json:"all"`
}

func NewTrinoThriftAllOrNoneValueSet() *TrinoThriftAllOrNoneValueSet {
	return &TrinoThriftAllOrNoneValueSet{}
}

func (p *TrinoThriftAllOrNoneValueSet) GetAll() bool {
	return p.All
}
func (p *TrinoThriftAllOrNoneValueSet) 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)
	}

	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.BOOL {
				if err := p.ReadField1(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)
	}
	return nil
}

func (p *TrinoThriftAllOrNoneValueSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(ctx); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.All = v
	}
	return nil
}

func (p *TrinoThriftAllOrNoneValueSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftAllOrNoneValueSet"); 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 *TrinoThriftAllOrNoneValueSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "all", thrift.BOOL, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:all: ", p), err)
	}
	if err := oprot.WriteBool(ctx, bool(p.All)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.all (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:all: ", p), err)
	}
	return err
}

func (p *TrinoThriftAllOrNoneValueSet) Equals(other *TrinoThriftAllOrNoneValueSet) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.All != other.All {
		return false
	}
	return true
}

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

func (p *TrinoThriftAllOrNoneValueSet) Validate() error {
	return nil
}

// A set containing values that are uniquely identifiable.
// Assumes an infinite number of possible values. The values may be collectively included
// or collectively excluded.
// This structure is used with comparable, but not orderable types like "json", "map".
//
// Attributes:
//   - Inclusive
//   - Values
type TrinoThriftEquatableValueSet struct {
	Inclusive bool                `thrift:"inclusive,1" db:"inclusive" json:"inclusive"`
	Values    []*TrinoThriftBlock `thrift:"values,2" db:"values" json:"values"`
}

func NewTrinoThriftEquatableValueSet() *TrinoThriftEquatableValueSet {
	return &TrinoThriftEquatableValueSet{}
}

func (p *TrinoThriftEquatableValueSet) GetInclusive() bool {
	return p.Inclusive
}

func (p *TrinoThriftEquatableValueSet) GetValues() []*TrinoThriftBlock {
	return p.Values
}
func (p *TrinoThriftEquatableValueSet) 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)
	}

	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.BOOL {
				if err := p.ReadField1(ctx, iprot); err != nil {
					return err
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftEquatableValueSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBool(ctx); err != nil {
		return thrift.PrependError("error reading field 1: ", err)
	} else {
		p.Inclusive = v
	}
	return nil
}

func (p *TrinoThriftEquatableValueSet) 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([]*TrinoThriftBlock, 0, size)
	p.Values = tSlice
	for i := 0; i < size; i++ {
		_elem11 := &TrinoThriftBlock{}
		if err := _elem11.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err)
		}
		p.Values = append(p.Values, _elem11)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftEquatableValueSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftEquatableValueSet"); 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 *TrinoThriftEquatableValueSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "inclusive", thrift.BOOL, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:inclusive: ", p), err)
	}
	if err := oprot.WriteBool(ctx, bool(p.Inclusive)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.inclusive (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:inclusive: ", p), err)
	}
	return err
}

func (p *TrinoThriftEquatableValueSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:values: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Values)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Values {
		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 2:values: ", p), err)
	}
	return err
}

func (p *TrinoThriftEquatableValueSet) Equals(other *TrinoThriftEquatableValueSet) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.Inclusive != other.Inclusive {
		return false
	}
	if len(p.Values) != len(other.Values) {
		return false
	}
	for i, _tgt := range p.Values {
		_src12 := other.Values[i]
		if !_tgt.Equals(_src12) {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftEquatableValueSet) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code ints} array are values for each row. If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Ints
type TrinoThriftInteger struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Ints  []int32 `thrift:"ints,2" db:"ints" json:"ints,omitempty"`
}

func NewTrinoThriftInteger() *TrinoThriftInteger {
	return &TrinoThriftInteger{}
}

var TrinoThriftInteger_Nulls_DEFAULT []bool

func (p *TrinoThriftInteger) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftInteger_Ints_DEFAULT []int32

func (p *TrinoThriftInteger) GetInts() []int32 {
	return p.Ints
}
func (p *TrinoThriftInteger) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftInteger) IsSetInts() bool {
	return p.Ints != nil
}

func (p *TrinoThriftInteger) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftInteger) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem13 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem13 = v
		}
		p.Nulls = append(p.Nulls, _elem13)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftInteger) 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([]int32, 0, size)
	p.Ints = tSlice
	for i := 0; i < size; i++ {
		var _elem14 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem14 = v
		}
		p.Ints = append(p.Ints, _elem14)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftInteger) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftInteger"); 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 *TrinoThriftInteger) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftInteger) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetInts() {
		if err := oprot.WriteFieldBegin(ctx, "ints", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:ints: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Ints)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Ints {
			if err := oprot.WriteI32(ctx, int32(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:ints: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftInteger) Equals(other *TrinoThriftInteger) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src15 := other.Nulls[i]
		if _tgt != _src15 {
			return false
		}
	}
	if len(p.Ints) != len(other.Ints) {
		return false
	}
	for i, _tgt := range p.Ints {
		_src16 := other.Ints[i]
		if _tgt != _src16 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftInteger) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code longs} array are values for each row. If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Longs
type TrinoThriftBigint struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Longs []int64 `thrift:"longs,2" db:"longs" json:"longs,omitempty"`
}

func NewTrinoThriftBigint() *TrinoThriftBigint {
	return &TrinoThriftBigint{}
}

var TrinoThriftBigint_Nulls_DEFAULT []bool

func (p *TrinoThriftBigint) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftBigint_Longs_DEFAULT []int64

func (p *TrinoThriftBigint) GetLongs() []int64 {
	return p.Longs
}
func (p *TrinoThriftBigint) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftBigint) IsSetLongs() bool {
	return p.Longs != nil
}

func (p *TrinoThriftBigint) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftBigint) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem17 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem17 = v
		}
		p.Nulls = append(p.Nulls, _elem17)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBigint) 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([]int64, 0, size)
	p.Longs = tSlice
	for i := 0; i < size; i++ {
		var _elem18 int64
		if v, err := iprot.ReadI64(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem18 = v
		}
		p.Longs = append(p.Longs, _elem18)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBigint) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftBigint"); 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 *TrinoThriftBigint) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBigint) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetLongs() {
		if err := oprot.WriteFieldBegin(ctx, "longs", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:longs: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Longs)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Longs {
			if err := oprot.WriteI64(ctx, int64(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:longs: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBigint) Equals(other *TrinoThriftBigint) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src19 := other.Nulls[i]
		if _tgt != _src19 {
			return false
		}
	}
	if len(p.Longs) != len(other.Longs) {
		return false
	}
	for i, _tgt := range p.Longs {
		_src20 := other.Longs[i]
		if _tgt != _src20 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftBigint) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code doubles} array are values for each row. If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Doubles
type TrinoThriftDouble struct {
	Nulls   []bool    `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Doubles []float64 `thrift:"doubles,2" db:"doubles" json:"doubles,omitempty"`
}

func NewTrinoThriftDouble() *TrinoThriftDouble {
	return &TrinoThriftDouble{}
}

var TrinoThriftDouble_Nulls_DEFAULT []bool

func (p *TrinoThriftDouble) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftDouble_Doubles_DEFAULT []float64

func (p *TrinoThriftDouble) GetDoubles() []float64 {
	return p.Doubles
}
func (p *TrinoThriftDouble) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftDouble) IsSetDoubles() bool {
	return p.Doubles != nil
}

func (p *TrinoThriftDouble) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftDouble) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem21 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem21 = v
		}
		p.Nulls = append(p.Nulls, _elem21)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftDouble) 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([]float64, 0, size)
	p.Doubles = tSlice
	for i := 0; i < size; i++ {
		var _elem22 float64
		if v, err := iprot.ReadDouble(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem22 = v
		}
		p.Doubles = append(p.Doubles, _elem22)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftDouble) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftDouble"); 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 *TrinoThriftDouble) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftDouble) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetDoubles() {
		if err := oprot.WriteFieldBegin(ctx, "doubles", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:doubles: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Doubles)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Doubles {
			if err := oprot.WriteDouble(ctx, float64(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:doubles: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftDouble) Equals(other *TrinoThriftDouble) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src23 := other.Nulls[i]
		if _tgt != _src23 {
			return false
		}
	}
	if len(p.Doubles) != len(other.Doubles) {
		return false
	}
	for i, _tgt := range p.Doubles {
		_src24 := other.Doubles[i]
		if _tgt != _src24 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftDouble) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Each elements of {@code sizes} array contains the length in bytes for the corresponding element.
// If row is null then the corresponding element in {@code sizes} is ignored.
// {@code bytes} array contains UTF-8 encoded byte values.
// Values for all rows are written to {@code bytes} array one after another.
// The total number of bytes must be equal to the sum of all sizes.
//
// Attributes:
//   - Nulls
//   - Sizes
//   - Bytes
type TrinoThriftVarchar struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Sizes []int32 `thrift:"sizes,2" db:"sizes" json:"sizes,omitempty"`
	Bytes []byte  `thrift:"bytes,3" db:"bytes" json:"bytes,omitempty"`
}

func NewTrinoThriftVarchar() *TrinoThriftVarchar {
	return &TrinoThriftVarchar{}
}

var TrinoThriftVarchar_Nulls_DEFAULT []bool

func (p *TrinoThriftVarchar) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftVarchar_Sizes_DEFAULT []int32

func (p *TrinoThriftVarchar) GetSizes() []int32 {
	return p.Sizes
}

var TrinoThriftVarchar_Bytes_DEFAULT []byte

func (p *TrinoThriftVarchar) GetBytes() []byte {
	return p.Bytes
}
func (p *TrinoThriftVarchar) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftVarchar) IsSetSizes() bool {
	return p.Sizes != nil
}

func (p *TrinoThriftVarchar) IsSetBytes() bool {
	return p.Bytes != nil
}

func (p *TrinoThriftVarchar) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftVarchar) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem25 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem25 = v
		}
		p.Nulls = append(p.Nulls, _elem25)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftVarchar) 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([]int32, 0, size)
	p.Sizes = tSlice
	for i := 0; i < size; i++ {
		var _elem26 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem26 = v
		}
		p.Sizes = append(p.Sizes, _elem26)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftVarchar) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(ctx); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Bytes = v
	}
	return nil
}

func (p *TrinoThriftVarchar) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftVarchar"); 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 *TrinoThriftVarchar) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftVarchar) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSizes() {
		if err := oprot.WriteFieldBegin(ctx, "sizes", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sizes: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Sizes)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Sizes {
			if err := oprot.WriteI32(ctx, int32(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:sizes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftVarchar) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBytes() {
		if err := oprot.WriteFieldBegin(ctx, "bytes", thrift.STRING, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bytes: ", p), err)
		}
		if err := oprot.WriteBinary(ctx, p.Bytes); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.bytes (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bytes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftVarchar) Equals(other *TrinoThriftVarchar) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src27 := other.Nulls[i]
		if _tgt != _src27 {
			return false
		}
	}
	if len(p.Sizes) != len(other.Sizes) {
		return false
	}
	for i, _tgt := range p.Sizes {
		_src28 := other.Sizes[i]
		if _tgt != _src28 {
			return false
		}
	}
	if bytes.Compare(p.Bytes, other.Bytes) != 0 {
		return false
	}
	return true
}

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

func (p *TrinoThriftVarchar) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code booleans} array are values for each row. If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Booleans
type TrinoThriftBoolean struct {
	Nulls    []bool `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Booleans []bool `thrift:"booleans,2" db:"booleans" json:"booleans,omitempty"`
}

func NewTrinoThriftBoolean() *TrinoThriftBoolean {
	return &TrinoThriftBoolean{}
}

var TrinoThriftBoolean_Nulls_DEFAULT []bool

func (p *TrinoThriftBoolean) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftBoolean_Booleans_DEFAULT []bool

func (p *TrinoThriftBoolean) GetBooleans() []bool {
	return p.Booleans
}
func (p *TrinoThriftBoolean) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftBoolean) IsSetBooleans() bool {
	return p.Booleans != nil
}

func (p *TrinoThriftBoolean) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftBoolean) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem29 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem29 = v
		}
		p.Nulls = append(p.Nulls, _elem29)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBoolean) 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([]bool, 0, size)
	p.Booleans = tSlice
	for i := 0; i < size; i++ {
		var _elem30 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem30 = v
		}
		p.Booleans = append(p.Booleans, _elem30)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBoolean) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftBoolean"); 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 *TrinoThriftBoolean) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBoolean) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBooleans() {
		if err := oprot.WriteFieldBegin(ctx, "booleans", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:booleans: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Booleans)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Booleans {
			if err := oprot.WriteBool(ctx, bool(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:booleans: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBoolean) Equals(other *TrinoThriftBoolean) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src31 := other.Nulls[i]
		if _tgt != _src31 {
			return false
		}
	}
	if len(p.Booleans) != len(other.Booleans) {
		return false
	}
	for i, _tgt := range p.Booleans {
		_src32 := other.Booleans[i]
		if _tgt != _src32 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftBoolean) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code dates} array are date values for each row represented as the number
// of days passed since 1970-01-01.
// If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Dates
type TrinoThriftDate struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Dates []int32 `thrift:"dates,2" db:"dates" json:"dates,omitempty"`
}

func NewTrinoThriftDate() *TrinoThriftDate {
	return &TrinoThriftDate{}
}

var TrinoThriftDate_Nulls_DEFAULT []bool

func (p *TrinoThriftDate) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftDate_Dates_DEFAULT []int32

func (p *TrinoThriftDate) GetDates() []int32 {
	return p.Dates
}
func (p *TrinoThriftDate) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftDate) IsSetDates() bool {
	return p.Dates != nil
}

func (p *TrinoThriftDate) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftDate) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem33 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem33 = v
		}
		p.Nulls = append(p.Nulls, _elem33)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftDate) 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([]int32, 0, size)
	p.Dates = tSlice
	for i := 0; i < size; i++ {
		var _elem34 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem34 = v
		}
		p.Dates = append(p.Dates, _elem34)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftDate) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftDate"); 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 *TrinoThriftDate) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftDate) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetDates() {
		if err := oprot.WriteFieldBegin(ctx, "dates", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dates: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Dates)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Dates {
			if err := oprot.WriteI32(ctx, int32(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:dates: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftDate) Equals(other *TrinoThriftDate) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src35 := other.Nulls[i]
		if _tgt != _src35 {
			return false
		}
	}
	if len(p.Dates) != len(other.Dates) {
		return false
	}
	for i, _tgt := range p.Dates {
		_src36 := other.Dates[i]
		if _tgt != _src36 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftDate) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Elements of {@code timestamps} array are values for each row represented as the number
// of milliseconds passed since 1970-01-01T00:00:00 UTC.
// If row is null then value is ignored.
//
// Attributes:
//   - Nulls
//   - Timestamps
type TrinoThriftTimestamp struct {
	Nulls      []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Timestamps []int64 `thrift:"timestamps,2" db:"timestamps" json:"timestamps,omitempty"`
}

func NewTrinoThriftTimestamp() *TrinoThriftTimestamp {
	return &TrinoThriftTimestamp{}
}

var TrinoThriftTimestamp_Nulls_DEFAULT []bool

func (p *TrinoThriftTimestamp) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftTimestamp_Timestamps_DEFAULT []int64

func (p *TrinoThriftTimestamp) GetTimestamps() []int64 {
	return p.Timestamps
}
func (p *TrinoThriftTimestamp) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftTimestamp) IsSetTimestamps() bool {
	return p.Timestamps != nil
}

func (p *TrinoThriftTimestamp) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftTimestamp) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem37 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem37 = v
		}
		p.Nulls = append(p.Nulls, _elem37)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftTimestamp) 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([]int64, 0, size)
	p.Timestamps = tSlice
	for i := 0; i < size; i++ {
		var _elem38 int64
		if v, err := iprot.ReadI64(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem38 = v
		}
		p.Timestamps = append(p.Timestamps, _elem38)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftTimestamp) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftTimestamp"); 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 *TrinoThriftTimestamp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftTimestamp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetTimestamps() {
		if err := oprot.WriteFieldBegin(ctx, "timestamps", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:timestamps: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Timestamps)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Timestamps {
			if err := oprot.WriteI64(ctx, int64(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:timestamps: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftTimestamp) Equals(other *TrinoThriftTimestamp) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src39 := other.Nulls[i]
		if _tgt != _src39 {
			return false
		}
	}
	if len(p.Timestamps) != len(other.Timestamps) {
		return false
	}
	for i, _tgt := range p.Timestamps {
		_src40 := other.Timestamps[i]
		if _tgt != _src40 {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftTimestamp) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Each elements of {@code sizes} array contains the length in bytes for the corresponding element.
// If row is null then the corresponding element in {@code sizes} is ignored.
// {@code bytes} array contains UTF-8 encoded byte values for string representation of json.
// Values for all rows are written to {@code bytes} array one after another.
// The total number of bytes must be equal to the sum of all sizes.
//
// Attributes:
//   - Nulls
//   - Sizes
//   - Bytes
type TrinoThriftJson struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Sizes []int32 `thrift:"sizes,2" db:"sizes" json:"sizes,omitempty"`
	Bytes []byte  `thrift:"bytes,3" db:"bytes" json:"bytes,omitempty"`
}

func NewTrinoThriftJson() *TrinoThriftJson {
	return &TrinoThriftJson{}
}

var TrinoThriftJson_Nulls_DEFAULT []bool

func (p *TrinoThriftJson) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftJson_Sizes_DEFAULT []int32

func (p *TrinoThriftJson) GetSizes() []int32 {
	return p.Sizes
}

var TrinoThriftJson_Bytes_DEFAULT []byte

func (p *TrinoThriftJson) GetBytes() []byte {
	return p.Bytes
}
func (p *TrinoThriftJson) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftJson) IsSetSizes() bool {
	return p.Sizes != nil
}

func (p *TrinoThriftJson) IsSetBytes() bool {
	return p.Bytes != nil
}

func (p *TrinoThriftJson) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftJson) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem41 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem41 = v
		}
		p.Nulls = append(p.Nulls, _elem41)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftJson) 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([]int32, 0, size)
	p.Sizes = tSlice
	for i := 0; i < size; i++ {
		var _elem42 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem42 = v
		}
		p.Sizes = append(p.Sizes, _elem42)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftJson) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(ctx); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Bytes = v
	}
	return nil
}

func (p *TrinoThriftJson) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftJson"); 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 *TrinoThriftJson) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftJson) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSizes() {
		if err := oprot.WriteFieldBegin(ctx, "sizes", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sizes: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Sizes)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Sizes {
			if err := oprot.WriteI32(ctx, int32(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:sizes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftJson) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBytes() {
		if err := oprot.WriteFieldBegin(ctx, "bytes", thrift.STRING, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bytes: ", p), err)
		}
		if err := oprot.WriteBinary(ctx, p.Bytes); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.bytes (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bytes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftJson) Equals(other *TrinoThriftJson) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src43 := other.Nulls[i]
		if _tgt != _src43 {
			return false
		}
	}
	if len(p.Sizes) != len(other.Sizes) {
		return false
	}
	for i, _tgt := range p.Sizes {
		_src44 := other.Sizes[i]
		if _tgt != _src44 {
			return false
		}
	}
	if bytes.Compare(p.Bytes, other.Bytes) != 0 {
		return false
	}
	return true
}

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

func (p *TrinoThriftJson) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Each elements of {@code sizes} array contains the length in bytes for the corresponding element.
// If row is null then the corresponding element in {@code sizes} is ignored.
// {@code bytes} array contains encoded byte values for HyperLogLog representation as defined in
// Airlift specification: href="https://github.com/airlift/airlift/blob/master/stats/docs/hll.md
// Values for all rows are written to {@code bytes} array one after another.
// The total number of bytes must be equal to the sum of all sizes.
//
// Attributes:
//   - Nulls
//   - Sizes
//   - Bytes
type TrinoThriftHyperLogLog struct {
	Nulls []bool  `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Sizes []int32 `thrift:"sizes,2" db:"sizes" json:"sizes,omitempty"`
	Bytes []byte  `thrift:"bytes,3" db:"bytes" json:"bytes,omitempty"`
}

func NewTrinoThriftHyperLogLog() *TrinoThriftHyperLogLog {
	return &TrinoThriftHyperLogLog{}
}

var TrinoThriftHyperLogLog_Nulls_DEFAULT []bool

func (p *TrinoThriftHyperLogLog) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftHyperLogLog_Sizes_DEFAULT []int32

func (p *TrinoThriftHyperLogLog) GetSizes() []int32 {
	return p.Sizes
}

var TrinoThriftHyperLogLog_Bytes_DEFAULT []byte

func (p *TrinoThriftHyperLogLog) GetBytes() []byte {
	return p.Bytes
}
func (p *TrinoThriftHyperLogLog) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftHyperLogLog) IsSetSizes() bool {
	return p.Sizes != nil
}

func (p *TrinoThriftHyperLogLog) IsSetBytes() bool {
	return p.Bytes != nil
}

func (p *TrinoThriftHyperLogLog) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftHyperLogLog) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem45 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem45 = v
		}
		p.Nulls = append(p.Nulls, _elem45)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftHyperLogLog) 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([]int32, 0, size)
	p.Sizes = tSlice
	for i := 0; i < size; i++ {
		var _elem46 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem46 = v
		}
		p.Sizes = append(p.Sizes, _elem46)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftHyperLogLog) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	if v, err := iprot.ReadBinary(ctx); err != nil {
		return thrift.PrependError("error reading field 3: ", err)
	} else {
		p.Bytes = v
	}
	return nil
}

func (p *TrinoThriftHyperLogLog) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftHyperLogLog"); 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 *TrinoThriftHyperLogLog) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftHyperLogLog) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSizes() {
		if err := oprot.WriteFieldBegin(ctx, "sizes", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sizes: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Sizes)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Sizes {
			if err := oprot.WriteI32(ctx, int32(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:sizes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftHyperLogLog) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBytes() {
		if err := oprot.WriteFieldBegin(ctx, "bytes", thrift.STRING, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:bytes: ", p), err)
		}
		if err := oprot.WriteBinary(ctx, p.Bytes); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T.bytes (3) field write error: ", p), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:bytes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftHyperLogLog) Equals(other *TrinoThriftHyperLogLog) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src47 := other.Nulls[i]
		if _tgt != _src47 {
			return false
		}
	}
	if len(p.Sizes) != len(other.Sizes) {
		return false
	}
	for i, _tgt := range p.Sizes {
		_src48 := other.Sizes[i]
		if _tgt != _src48 {
			return false
		}
	}
	if bytes.Compare(p.Bytes, other.Bytes) != 0 {
		return false
	}
	return true
}

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

func (p *TrinoThriftHyperLogLog) Validate() error {
	return nil
}

// Elements of {@code nulls} array determine if a value for a corresponding row is null.
// Each elements of {@code sizes} array contains the number of elements in the corresponding values array.
// If row is null then the corresponding element in {@code sizes} is ignored.
// {@code values} is a bigint block containing array elements one after another for all rows.
// The total number of elements in bigint block must be equal to the sum of all sizes.
//
// Attributes:
//   - Nulls
//   - Sizes
//   - Values
type TrinoThriftBigintArray struct {
	Nulls  []bool             `thrift:"nulls,1" db:"nulls" json:"nulls,omitempty"`
	Sizes  []int32            `thrift:"sizes,2" db:"sizes" json:"sizes,omitempty"`
	Values *TrinoThriftBigint `thrift:"values,3" db:"values" json:"values,omitempty"`
}

func NewTrinoThriftBigintArray() *TrinoThriftBigintArray {
	return &TrinoThriftBigintArray{}
}

var TrinoThriftBigintArray_Nulls_DEFAULT []bool

func (p *TrinoThriftBigintArray) GetNulls() []bool {
	return p.Nulls
}

var TrinoThriftBigintArray_Sizes_DEFAULT []int32

func (p *TrinoThriftBigintArray) GetSizes() []int32 {
	return p.Sizes
}

var TrinoThriftBigintArray_Values_DEFAULT *TrinoThriftBigint

func (p *TrinoThriftBigintArray) GetValues() *TrinoThriftBigint {
	if !p.IsSetValues() {
		return TrinoThriftBigintArray_Values_DEFAULT
	}
	return p.Values
}
func (p *TrinoThriftBigintArray) IsSetNulls() bool {
	return p.Nulls != nil
}

func (p *TrinoThriftBigintArray) IsSetSizes() bool {
	return p.Sizes != nil
}

func (p *TrinoThriftBigintArray) IsSetValues() bool {
	return p.Values != nil
}

func (p *TrinoThriftBigintArray) 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)
	}

	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
				}
			} 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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				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)
	}
	return nil
}

func (p *TrinoThriftBigintArray) 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([]bool, 0, size)
	p.Nulls = tSlice
	for i := 0; i < size; i++ {
		var _elem49 bool
		if v, err := iprot.ReadBool(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem49 = v
		}
		p.Nulls = append(p.Nulls, _elem49)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBigintArray) 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([]int32, 0, size)
	p.Sizes = tSlice
	for i := 0; i < size; i++ {
		var _elem50 int32
		if v, err := iprot.ReadI32(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem50 = v
		}
		p.Sizes = append(p.Sizes, _elem50)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftBigintArray) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	p.Values = &TrinoThriftBigint{}
	if err := p.Values.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Values), err)
	}
	return nil
}

func (p *TrinoThriftBigintArray) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftBigintArray"); 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 *TrinoThriftBigintArray) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNulls() {
		if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.LIST, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nulls: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Nulls)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Nulls {
			if err := oprot.WriteBool(ctx, bool(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:nulls: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBigintArray) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSizes() {
		if err := oprot.WriteFieldBegin(ctx, "sizes", thrift.LIST, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sizes: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Sizes)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Sizes {
			if err := oprot.WriteI32(ctx, int32(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:sizes: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBigintArray) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetValues() {
		if err := oprot.WriteFieldBegin(ctx, "values", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:values: ", p), err)
		}
		if err := p.Values.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Values), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:values: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBigintArray) Equals(other *TrinoThriftBigintArray) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Nulls) != len(other.Nulls) {
		return false
	}
	for i, _tgt := range p.Nulls {
		_src51 := other.Nulls[i]
		if _tgt != _src51 {
			return false
		}
	}
	if len(p.Sizes) != len(other.Sizes) {
		return false
	}
	for i, _tgt := range p.Sizes {
		_src52 := other.Sizes[i]
		if _tgt != _src52 {
			return false
		}
	}
	if !p.Values.Equals(other.Values) {
		return false
	}
	return true
}

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

func (p *TrinoThriftBigintArray) Validate() error {
	return nil
}

// A set containing zero or more Ranges of the same type over a continuous space of possible values.
// Ranges are coalesced into the most compact representation of non-overlapping Ranges.
// This structure is used with comparable and orderable types like bigint, integer, double, varchar, etc.
//
// Attributes:
//   - Ranges
type TrinoThriftRangeValueSet struct {
	Ranges []*TrinoThriftRange `thrift:"ranges,1" db:"ranges" json:"ranges"`
}

func NewTrinoThriftRangeValueSet() *TrinoThriftRangeValueSet {
	return &TrinoThriftRangeValueSet{}
}

func (p *TrinoThriftRangeValueSet) GetRanges() []*TrinoThriftRange {
	return p.Ranges
}
func (p *TrinoThriftRangeValueSet) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftRangeValueSet) 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([]*TrinoThriftRange, 0, size)
	p.Ranges = tSlice
	for i := 0; i < size; i++ {
		_elem53 := &TrinoThriftRange{}
		if err := _elem53.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err)
		}
		p.Ranges = append(p.Ranges, _elem53)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftRangeValueSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftRangeValueSet"); 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 *TrinoThriftRangeValueSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "ranges", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ranges: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Ranges)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Ranges {
		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 1:ranges: ", p), err)
	}
	return err
}

func (p *TrinoThriftRangeValueSet) Equals(other *TrinoThriftRangeValueSet) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Ranges) != len(other.Ranges) {
		return false
	}
	for i, _tgt := range p.Ranges {
		_src54 := other.Ranges[i]
		if !_tgt.Equals(_src54) {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftRangeValueSet) Validate() error {
	return nil
}

// Attributes:
//   - ID
type TrinoThriftId struct {
	ID []byte `thrift:"id,1" db:"id" json:"id"`
}

func NewTrinoThriftId() *TrinoThriftId {
	return &TrinoThriftId{}
}

func (p *TrinoThriftId) GetID() []byte {
	return p.ID
}
func (p *TrinoThriftId) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftId) 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.ID = v
	}
	return nil
}

func (p *TrinoThriftId) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftId"); 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 *TrinoThriftId) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "id", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err)
	}
	if err := oprot.WriteBinary(ctx, p.ID); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err)
	}
	return err
}

func (p *TrinoThriftId) Equals(other *TrinoThriftId) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if bytes.Compare(p.ID, other.ID) != 0 {
		return false
	}
	return true
}

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

func (p *TrinoThriftId) Validate() error {
	return nil
}

// Attributes:
//   - Splits
//   - NextToken
type TrinoThriftSplitBatch struct {
	Splits    []*TrinoThriftSplit `thrift:"splits,1" db:"splits" json:"splits"`
	NextToken *TrinoThriftId      `thrift:"nextToken,2" db:"nextToken" json:"nextToken,omitempty"`
}

func NewTrinoThriftSplitBatch() *TrinoThriftSplitBatch {
	return &TrinoThriftSplitBatch{}
}

func (p *TrinoThriftSplitBatch) GetSplits() []*TrinoThriftSplit {
	return p.Splits
}

var TrinoThriftSplitBatch_NextToken_DEFAULT *TrinoThriftId

func (p *TrinoThriftSplitBatch) GetNextToken() *TrinoThriftId {
	if !p.IsSetNextToken() {
		return TrinoThriftSplitBatch_NextToken_DEFAULT
	}
	return p.NextToken
}
func (p *TrinoThriftSplitBatch) IsSetNextToken() bool {
	return p.NextToken != nil
}

func (p *TrinoThriftSplitBatch) 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)
	}

	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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(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)
	}
	return nil
}

func (p *TrinoThriftSplitBatch) 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([]*TrinoThriftSplit, 0, size)
	p.Splits = tSlice
	for i := 0; i < size; i++ {
		_elem55 := &TrinoThriftSplit{}
		if err := _elem55.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err)
		}
		p.Splits = append(p.Splits, _elem55)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftSplitBatch) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
	p.NextToken = &TrinoThriftId{}
	if err := p.NextToken.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NextToken), err)
	}
	return nil
}

func (p *TrinoThriftSplitBatch) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftSplitBatch"); 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 *TrinoThriftSplitBatch) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "splits", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:splits: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Splits)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Splits {
		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 1:splits: ", p), err)
	}
	return err
}

func (p *TrinoThriftSplitBatch) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNextToken() {
		if err := oprot.WriteFieldBegin(ctx, "nextToken", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nextToken: ", p), err)
		}
		if err := p.NextToken.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NextToken), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nextToken: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftSplitBatch) Equals(other *TrinoThriftSplitBatch) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.Splits) != len(other.Splits) {
		return false
	}
	for i, _tgt := range p.Splits {
		_src56 := other.Splits[i]
		if !_tgt.Equals(_src56) {
			return false
		}
	}
	if !p.NextToken.Equals(other.NextToken) {
		return false
	}
	return true
}

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

func (p *TrinoThriftSplitBatch) Validate() error {
	return nil
}

// Attributes:
//   - SplitId: Encodes all the information needed to identify a batch of rows to return to Trino.
//
// For a basic scan, includes schema name, table name, and output constraint.
// For an index scan, includes schema name, table name, set of keys to lookup and output constraint.
//   - Hosts: Identifies the set of hosts on which the rows are available. If empty, then the rows
//
// are expected to be available on any host. The hosts in this list may be independent
// from the hosts used to serve metadata requests.
type TrinoThriftSplit struct {
	SplitId *TrinoThriftId            `thrift:"splitId,1" db:"splitId" json:"splitId"`
	Hosts   []*TrinoThriftHostAddress `thrift:"hosts,2" db:"hosts" json:"hosts"`
}

func NewTrinoThriftSplit() *TrinoThriftSplit {
	return &TrinoThriftSplit{}
}

var TrinoThriftSplit_SplitId_DEFAULT *TrinoThriftId

func (p *TrinoThriftSplit) GetSplitId() *TrinoThriftId {
	if !p.IsSetSplitId() {
		return TrinoThriftSplit_SplitId_DEFAULT
	}
	return p.SplitId
}

func (p *TrinoThriftSplit) GetHosts() []*TrinoThriftHostAddress {
	return p.Hosts
}
func (p *TrinoThriftSplit) IsSetSplitId() bool {
	return p.SplitId != nil
}

func (p *TrinoThriftSplit) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftSplit) 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([]*TrinoThriftHostAddress, 0, size)
	p.Hosts = tSlice
	for i := 0; i < size; i++ {
		_elem57 := &TrinoThriftHostAddress{}
		if err := _elem57.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err)
		}
		p.Hosts = append(p.Hosts, _elem57)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftSplit) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftSplit"); 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 *TrinoThriftSplit) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "splitId", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:splitId: ", p), err)
	}
	if err := p.SplitId.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SplitId), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:splitId: ", p), err)
	}
	return err
}

func (p *TrinoThriftSplit) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hosts: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.Hosts {
		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 2:hosts: ", p), err)
	}
	return err
}

func (p *TrinoThriftSplit) Equals(other *TrinoThriftSplit) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.SplitId.Equals(other.SplitId) {
		return false
	}
	if len(p.Hosts) != len(other.Hosts) {
		return false
	}
	for i, _tgt := range p.Hosts {
		_src58 := other.Hosts[i]
		if !_tgt.Equals(_src58) {
			return false
		}
	}
	return true
}

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

func (p *TrinoThriftSplit) Validate() error {
	return nil
}

// Attributes:
//   - Host
//   - Port
type TrinoThriftHostAddress struct {
	Host string `thrift:"host,1" db:"host" json:"host"`
	Port int32  `thrift:"port,2" db:"port" json:"port"`
}

func NewTrinoThriftHostAddress() *TrinoThriftHostAddress {
	return &TrinoThriftHostAddress{}
}

func (p *TrinoThriftHostAddress) GetHost() string {
	return p.Host
}

func (p *TrinoThriftHostAddress) GetPort() int32 {
	return p.Port
}
func (p *TrinoThriftHostAddress) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

func (p *TrinoThriftHostAddress) 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.Host = v
	}
	return nil
}

func (p *TrinoThriftHostAddress) 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 *TrinoThriftHostAddress) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftHostAddress"); 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 *TrinoThriftHostAddress) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRING, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err)
	}
	if err := oprot.WriteString(ctx, string(p.Host)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err)
	}
	return err
}

func (p *TrinoThriftHostAddress) 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 *TrinoThriftHostAddress) Equals(other *TrinoThriftHostAddress) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if p.Host != other.Host {
		return false
	}
	if p.Port != other.Port {
		return false
	}
	return true
}

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

func (p *TrinoThriftHostAddress) Validate() error {
	return nil
}

// Attributes:
//   - ColumnBlocks: Returns data in a columnar format.
//
// Columns in this list must be in the order they were requested by the engine.
//   - RowCount
//   - NextToken
type TrinoThriftPageResult_ struct {
	ColumnBlocks []*TrinoThriftBlock `thrift:"columnBlocks,1" db:"columnBlocks" json:"columnBlocks"`
	RowCount     int32               `thrift:"rowCount,2" db:"rowCount" json:"rowCount"`
	NextToken    *TrinoThriftId      `thrift:"nextToken,3" db:"nextToken" json:"nextToken,omitempty"`
}

func NewTrinoThriftPageResult_() *TrinoThriftPageResult_ {
	return &TrinoThriftPageResult_{}
}

func (p *TrinoThriftPageResult_) GetColumnBlocks() []*TrinoThriftBlock {
	return p.ColumnBlocks
}

func (p *TrinoThriftPageResult_) GetRowCount() int32 {
	return p.RowCount
}

var TrinoThriftPageResult__NextToken_DEFAULT *TrinoThriftId

func (p *TrinoThriftPageResult_) GetNextToken() *TrinoThriftId {
	if !p.IsSetNextToken() {
		return TrinoThriftPageResult__NextToken_DEFAULT
	}
	return p.NextToken
}
func (p *TrinoThriftPageResult_) IsSetNextToken() bool {
	return p.NextToken != nil
}

func (p *TrinoThriftPageResult_) 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)
	}

	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
				}
			} 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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 3:
			if fieldTypeId == thrift.STRUCT {
				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)
	}
	return nil
}

func (p *TrinoThriftPageResult_) 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([]*TrinoThriftBlock, 0, size)
	p.ColumnBlocks = tSlice
	for i := 0; i < size; i++ {
		_elem59 := &TrinoThriftBlock{}
		if err := _elem59.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err)
		}
		p.ColumnBlocks = append(p.ColumnBlocks, _elem59)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftPageResult_) 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.RowCount = v
	}
	return nil
}

func (p *TrinoThriftPageResult_) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	p.NextToken = &TrinoThriftId{}
	if err := p.NextToken.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NextToken), err)
	}
	return nil
}

func (p *TrinoThriftPageResult_) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftPageResult"); 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 *TrinoThriftPageResult_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "columnBlocks", thrift.LIST, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnBlocks: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColumnBlocks)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.ColumnBlocks {
		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 1:columnBlocks: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftPageResult_) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetNextToken() {
		if err := oprot.WriteFieldBegin(ctx, "nextToken", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:nextToken: ", p), err)
		}
		if err := p.NextToken.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NextToken), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:nextToken: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftPageResult_) Equals(other *TrinoThriftPageResult_) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if len(p.ColumnBlocks) != len(other.ColumnBlocks) {
		return false
	}
	for i, _tgt := range p.ColumnBlocks {
		_src60 := other.ColumnBlocks[i]
		if !_tgt.Equals(_src60) {
			return false
		}
	}
	if p.RowCount != other.RowCount {
		return false
	}
	if !p.NextToken.Equals(other.NextToken) {
		return false
	}
	return true
}

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

func (p *TrinoThriftPageResult_) Validate() error {
	return nil
}

// Attributes:
//   - TableMetadata
type TrinoThriftNullableTableMetadata struct {
	TableMetadata *TrinoThriftTableMetadata `thrift:"tableMetadata,1" db:"tableMetadata" json:"tableMetadata,omitempty"`
}

func NewTrinoThriftNullableTableMetadata() *TrinoThriftNullableTableMetadata {
	return &TrinoThriftNullableTableMetadata{}
}

var TrinoThriftNullableTableMetadata_TableMetadata_DEFAULT *TrinoThriftTableMetadata

func (p *TrinoThriftNullableTableMetadata) GetTableMetadata() *TrinoThriftTableMetadata {
	if !p.IsSetTableMetadata() {
		return TrinoThriftNullableTableMetadata_TableMetadata_DEFAULT
	}
	return p.TableMetadata
}
func (p *TrinoThriftNullableTableMetadata) IsSetTableMetadata() bool {
	return p.TableMetadata != nil
}

func (p *TrinoThriftNullableTableMetadata) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftNullableTableMetadata) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftNullableTableMetadata"); 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 *TrinoThriftNullableTableMetadata) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetTableMetadata() {
		if err := oprot.WriteFieldBegin(ctx, "tableMetadata", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tableMetadata: ", p), err)
		}
		if err := p.TableMetadata.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TableMetadata), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tableMetadata: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftNullableTableMetadata) Equals(other *TrinoThriftNullableTableMetadata) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.TableMetadata.Equals(other.TableMetadata) {
		return false
	}
	return true
}

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

func (p *TrinoThriftNullableTableMetadata) Validate() error {
	return nil
}

// Attributes:
//   - AllOrNoneValueSet
//   - EquatableValueSet
//   - RangeValueSet
type TrinoThriftValueSet struct {
	AllOrNoneValueSet *TrinoThriftAllOrNoneValueSet `thrift:"allOrNoneValueSet,1" db:"allOrNoneValueSet" json:"allOrNoneValueSet,omitempty"`
	EquatableValueSet *TrinoThriftEquatableValueSet `thrift:"equatableValueSet,2" db:"equatableValueSet" json:"equatableValueSet,omitempty"`
	RangeValueSet     *TrinoThriftRangeValueSet     `thrift:"rangeValueSet,3" db:"rangeValueSet" json:"rangeValueSet,omitempty"`
}

func NewTrinoThriftValueSet() *TrinoThriftValueSet {
	return &TrinoThriftValueSet{}
}

var TrinoThriftValueSet_AllOrNoneValueSet_DEFAULT *TrinoThriftAllOrNoneValueSet

func (p *TrinoThriftValueSet) GetAllOrNoneValueSet() *TrinoThriftAllOrNoneValueSet {
	if !p.IsSetAllOrNoneValueSet() {
		return TrinoThriftValueSet_AllOrNoneValueSet_DEFAULT
	}
	return p.AllOrNoneValueSet
}

var TrinoThriftValueSet_EquatableValueSet_DEFAULT *TrinoThriftEquatableValueSet

func (p *TrinoThriftValueSet) GetEquatableValueSet() *TrinoThriftEquatableValueSet {
	if !p.IsSetEquatableValueSet() {
		return TrinoThriftValueSet_EquatableValueSet_DEFAULT
	}
	return p.EquatableValueSet
}

var TrinoThriftValueSet_RangeValueSet_DEFAULT *TrinoThriftRangeValueSet

func (p *TrinoThriftValueSet) GetRangeValueSet() *TrinoThriftRangeValueSet {
	if !p.IsSetRangeValueSet() {
		return TrinoThriftValueSet_RangeValueSet_DEFAULT
	}
	return p.RangeValueSet
}
func (p *TrinoThriftValueSet) IsSetAllOrNoneValueSet() bool {
	return p.AllOrNoneValueSet != nil
}

func (p *TrinoThriftValueSet) IsSetEquatableValueSet() bool {
	return p.EquatableValueSet != nil
}

func (p *TrinoThriftValueSet) IsSetRangeValueSet() bool {
	return p.RangeValueSet != nil
}

func (p *TrinoThriftValueSet) 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)
	}

	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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				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.STRUCT {
				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)
	}
	return nil
}

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

func (p *TrinoThriftValueSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
	p.EquatableValueSet = &TrinoThriftEquatableValueSet{}
	if err := p.EquatableValueSet.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EquatableValueSet), err)
	}
	return nil
}

func (p *TrinoThriftValueSet) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	p.RangeValueSet = &TrinoThriftRangeValueSet{}
	if err := p.RangeValueSet.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RangeValueSet), err)
	}
	return nil
}

func (p *TrinoThriftValueSet) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftValueSet"); 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 *TrinoThriftValueSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetAllOrNoneValueSet() {
		if err := oprot.WriteFieldBegin(ctx, "allOrNoneValueSet", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:allOrNoneValueSet: ", p), err)
		}
		if err := p.AllOrNoneValueSet.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.AllOrNoneValueSet), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:allOrNoneValueSet: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftValueSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEquatableValueSet() {
		if err := oprot.WriteFieldBegin(ctx, "equatableValueSet", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:equatableValueSet: ", p), err)
		}
		if err := p.EquatableValueSet.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EquatableValueSet), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:equatableValueSet: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftValueSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetRangeValueSet() {
		if err := oprot.WriteFieldBegin(ctx, "rangeValueSet", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:rangeValueSet: ", p), err)
		}
		if err := p.RangeValueSet.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RangeValueSet), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:rangeValueSet: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftValueSet) Equals(other *TrinoThriftValueSet) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.AllOrNoneValueSet.Equals(other.AllOrNoneValueSet) {
		return false
	}
	if !p.EquatableValueSet.Equals(other.EquatableValueSet) {
		return false
	}
	if !p.RangeValueSet.Equals(other.RangeValueSet) {
		return false
	}
	return true
}

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

func (p *TrinoThriftValueSet) Validate() error {
	return nil
}

// Attributes:
//   - IntegerData
//   - BigintData
//   - DoubleData
//   - VarcharData
//   - BooleanData
//   - DateData
//   - TimestampData
//   - JsonData
//   - HyperLogLogData
//   - BigintArrayData
type TrinoThriftBlock struct {
	IntegerData     *TrinoThriftInteger     `thrift:"integerData,1" db:"integerData" json:"integerData,omitempty"`
	BigintData      *TrinoThriftBigint      `thrift:"bigintData,2" db:"bigintData" json:"bigintData,omitempty"`
	DoubleData      *TrinoThriftDouble      `thrift:"doubleData,3" db:"doubleData" json:"doubleData,omitempty"`
	VarcharData     *TrinoThriftVarchar     `thrift:"varcharData,4" db:"varcharData" json:"varcharData,omitempty"`
	BooleanData     *TrinoThriftBoolean     `thrift:"booleanData,5" db:"booleanData" json:"booleanData,omitempty"`
	DateData        *TrinoThriftDate        `thrift:"dateData,6" db:"dateData" json:"dateData,omitempty"`
	TimestampData   *TrinoThriftTimestamp   `thrift:"timestampData,7" db:"timestampData" json:"timestampData,omitempty"`
	JsonData        *TrinoThriftJson        `thrift:"jsonData,8" db:"jsonData" json:"jsonData,omitempty"`
	HyperLogLogData *TrinoThriftHyperLogLog `thrift:"hyperLogLogData,9" db:"hyperLogLogData" json:"hyperLogLogData,omitempty"`
	BigintArrayData *TrinoThriftBigintArray `thrift:"bigintArrayData,10" db:"bigintArrayData" json:"bigintArrayData,omitempty"`
}

func NewTrinoThriftBlock() *TrinoThriftBlock {
	return &TrinoThriftBlock{}
}

var TrinoThriftBlock_IntegerData_DEFAULT *TrinoThriftInteger

func (p *TrinoThriftBlock) GetIntegerData() *TrinoThriftInteger {
	if !p.IsSetIntegerData() {
		return TrinoThriftBlock_IntegerData_DEFAULT
	}
	return p.IntegerData
}

var TrinoThriftBlock_BigintData_DEFAULT *TrinoThriftBigint

func (p *TrinoThriftBlock) GetBigintData() *TrinoThriftBigint {
	if !p.IsSetBigintData() {
		return TrinoThriftBlock_BigintData_DEFAULT
	}
	return p.BigintData
}

var TrinoThriftBlock_DoubleData_DEFAULT *TrinoThriftDouble

func (p *TrinoThriftBlock) GetDoubleData() *TrinoThriftDouble {
	if !p.IsSetDoubleData() {
		return TrinoThriftBlock_DoubleData_DEFAULT
	}
	return p.DoubleData
}

var TrinoThriftBlock_VarcharData_DEFAULT *TrinoThriftVarchar

func (p *TrinoThriftBlock) GetVarcharData() *TrinoThriftVarchar {
	if !p.IsSetVarcharData() {
		return TrinoThriftBlock_VarcharData_DEFAULT
	}
	return p.VarcharData
}

var TrinoThriftBlock_BooleanData_DEFAULT *TrinoThriftBoolean

func (p *TrinoThriftBlock) GetBooleanData() *TrinoThriftBoolean {
	if !p.IsSetBooleanData() {
		return TrinoThriftBlock_BooleanData_DEFAULT
	}
	return p.BooleanData
}

var TrinoThriftBlock_DateData_DEFAULT *TrinoThriftDate

func (p *TrinoThriftBlock) GetDateData() *TrinoThriftDate {
	if !p.IsSetDateData() {
		return TrinoThriftBlock_DateData_DEFAULT
	}
	return p.DateData
}

var TrinoThriftBlock_TimestampData_DEFAULT *TrinoThriftTimestamp

func (p *TrinoThriftBlock) GetTimestampData() *TrinoThriftTimestamp {
	if !p.IsSetTimestampData() {
		return TrinoThriftBlock_TimestampData_DEFAULT
	}
	return p.TimestampData
}

var TrinoThriftBlock_JsonData_DEFAULT *TrinoThriftJson

func (p *TrinoThriftBlock) GetJsonData() *TrinoThriftJson {
	if !p.IsSetJsonData() {
		return TrinoThriftBlock_JsonData_DEFAULT
	}
	return p.JsonData
}

var TrinoThriftBlock_HyperLogLogData_DEFAULT *TrinoThriftHyperLogLog

func (p *TrinoThriftBlock) GetHyperLogLogData() *TrinoThriftHyperLogLog {
	if !p.IsSetHyperLogLogData() {
		return TrinoThriftBlock_HyperLogLogData_DEFAULT
	}
	return p.HyperLogLogData
}

var TrinoThriftBlock_BigintArrayData_DEFAULT *TrinoThriftBigintArray

func (p *TrinoThriftBlock) GetBigintArrayData() *TrinoThriftBigintArray {
	if !p.IsSetBigintArrayData() {
		return TrinoThriftBlock_BigintArrayData_DEFAULT
	}
	return p.BigintArrayData
}
func (p *TrinoThriftBlock) IsSetIntegerData() bool {
	return p.IntegerData != nil
}

func (p *TrinoThriftBlock) IsSetBigintData() bool {
	return p.BigintData != nil
}

func (p *TrinoThriftBlock) IsSetDoubleData() bool {
	return p.DoubleData != nil
}

func (p *TrinoThriftBlock) IsSetVarcharData() bool {
	return p.VarcharData != nil
}

func (p *TrinoThriftBlock) IsSetBooleanData() bool {
	return p.BooleanData != nil
}

func (p *TrinoThriftBlock) IsSetDateData() bool {
	return p.DateData != nil
}

func (p *TrinoThriftBlock) IsSetTimestampData() bool {
	return p.TimestampData != nil
}

func (p *TrinoThriftBlock) IsSetJsonData() bool {
	return p.JsonData != nil
}

func (p *TrinoThriftBlock) IsSetHyperLogLogData() bool {
	return p.HyperLogLogData != nil
}

func (p *TrinoThriftBlock) IsSetBigintArrayData() bool {
	return p.BigintArrayData != nil
}

func (p *TrinoThriftBlock) 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)
	}

	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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				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.STRUCT {
				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
				}
			}
		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
				}
			}
		case 6:
			if fieldTypeId == thrift.STRUCT {
				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.STRUCT {
				if err := p.ReadField9(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 10:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField10(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)
	}
	return nil
}

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

func (p *TrinoThriftBlock) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
	p.BigintData = &TrinoThriftBigint{}
	if err := p.BigintData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BigintData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	p.DoubleData = &TrinoThriftDouble{}
	if err := p.DoubleData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
	p.VarcharData = &TrinoThriftVarchar{}
	if err := p.VarcharData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VarcharData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
	p.BooleanData = &TrinoThriftBoolean{}
	if err := p.BooleanData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BooleanData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField6(ctx context.Context, iprot thrift.TProtocol) error {
	p.DateData = &TrinoThriftDate{}
	if err := p.DateData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DateData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField7(ctx context.Context, iprot thrift.TProtocol) error {
	p.TimestampData = &TrinoThriftTimestamp{}
	if err := p.TimestampData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TimestampData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField8(ctx context.Context, iprot thrift.TProtocol) error {
	p.JsonData = &TrinoThriftJson{}
	if err := p.JsonData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.JsonData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField9(ctx context.Context, iprot thrift.TProtocol) error {
	p.HyperLogLogData = &TrinoThriftHyperLogLog{}
	if err := p.HyperLogLogData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HyperLogLogData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) ReadField10(ctx context.Context, iprot thrift.TProtocol) error {
	p.BigintArrayData = &TrinoThriftBigintArray{}
	if err := p.BigintArrayData.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BigintArrayData), err)
	}
	return nil
}

func (p *TrinoThriftBlock) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftBlock"); 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 := p.writeField10(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 *TrinoThriftBlock) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetIntegerData() {
		if err := oprot.WriteFieldBegin(ctx, "integerData", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:integerData: ", p), err)
		}
		if err := p.IntegerData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IntegerData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:integerData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBigintData() {
		if err := oprot.WriteFieldBegin(ctx, "bigintData", thrift.STRUCT, 2); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bigintData: ", p), err)
		}
		if err := p.BigintData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BigintData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bigintData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetDoubleData() {
		if err := oprot.WriteFieldBegin(ctx, "doubleData", thrift.STRUCT, 3); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:doubleData: ", p), err)
		}
		if err := p.DoubleData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 3:doubleData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetVarcharData() {
		if err := oprot.WriteFieldBegin(ctx, "varcharData", thrift.STRUCT, 4); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:varcharData: ", p), err)
		}
		if err := p.VarcharData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VarcharData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 4:varcharData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBooleanData() {
		if err := oprot.WriteFieldBegin(ctx, "booleanData", thrift.STRUCT, 5); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:booleanData: ", p), err)
		}
		if err := p.BooleanData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BooleanData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 5:booleanData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetDateData() {
		if err := oprot.WriteFieldBegin(ctx, "dateData", thrift.STRUCT, 6); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dateData: ", p), err)
		}
		if err := p.DateData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DateData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dateData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetTimestampData() {
		if err := oprot.WriteFieldBegin(ctx, "timestampData", thrift.STRUCT, 7); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timestampData: ", p), err)
		}
		if err := p.TimestampData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TimestampData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timestampData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetJsonData() {
		if err := oprot.WriteFieldBegin(ctx, "jsonData", thrift.STRUCT, 8); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:jsonData: ", p), err)
		}
		if err := p.JsonData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.JsonData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 8:jsonData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetHyperLogLogData() {
		if err := oprot.WriteFieldBegin(ctx, "hyperLogLogData", thrift.STRUCT, 9); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hyperLogLogData: ", p), err)
		}
		if err := p.HyperLogLogData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HyperLogLogData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hyperLogLogData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetBigintArrayData() {
		if err := oprot.WriteFieldBegin(ctx, "bigintArrayData", thrift.STRUCT, 10); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:bigintArrayData: ", p), err)
		}
		if err := p.BigintArrayData.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BigintArrayData), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 10:bigintArrayData: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftBlock) Equals(other *TrinoThriftBlock) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.IntegerData.Equals(other.IntegerData) {
		return false
	}
	if !p.BigintData.Equals(other.BigintData) {
		return false
	}
	if !p.DoubleData.Equals(other.DoubleData) {
		return false
	}
	if !p.VarcharData.Equals(other.VarcharData) {
		return false
	}
	if !p.BooleanData.Equals(other.BooleanData) {
		return false
	}
	if !p.DateData.Equals(other.DateData) {
		return false
	}
	if !p.TimestampData.Equals(other.TimestampData) {
		return false
	}
	if !p.JsonData.Equals(other.JsonData) {
		return false
	}
	if !p.HyperLogLogData.Equals(other.HyperLogLogData) {
		return false
	}
	if !p.BigintArrayData.Equals(other.BigintArrayData) {
		return false
	}
	return true
}

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

func (p *TrinoThriftBlock) Validate() error {
	return nil
}

// LOWER UNBOUNDED is specified with an empty value and an ABOVE bound
// UPPER UNBOUNDED is specified with an empty value and a BELOW bound
//
// Attributes:
//   - Value
//   - Bound
type TrinoThriftMarker struct {
	Value *TrinoThriftBlock `thrift:"value,1" db:"value" json:"value,omitempty"`
	Bound TrinoThriftBound  `thrift:"bound,2" db:"bound" json:"bound"`
}

func NewTrinoThriftMarker() *TrinoThriftMarker {
	return &TrinoThriftMarker{}
}

var TrinoThriftMarker_Value_DEFAULT *TrinoThriftBlock

func (p *TrinoThriftMarker) GetValue() *TrinoThriftBlock {
	if !p.IsSetValue() {
		return TrinoThriftMarker_Value_DEFAULT
	}
	return p.Value
}

func (p *TrinoThriftMarker) GetBound() TrinoThriftBound {
	return p.Bound
}
func (p *TrinoThriftMarker) IsSetValue() bool {
	return p.Value != nil
}

func (p *TrinoThriftMarker) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftMarker) 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 := TrinoThriftBound(v)
		p.Bound = temp
	}
	return nil
}

func (p *TrinoThriftMarker) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftMarker"); 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 *TrinoThriftMarker) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetValue() {
		if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err)
		}
		if err := p.Value.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:value: ", p), err)
		}
	}
	return err
}

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

func (p *TrinoThriftMarker) Equals(other *TrinoThriftMarker) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.Value.Equals(other.Value) {
		return false
	}
	if p.Bound != other.Bound {
		return false
	}
	return true
}

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

func (p *TrinoThriftMarker) Validate() error {
	return nil
}

// Attributes:
//   - Token
type TrinoThriftNullableToken struct {
	Token *TrinoThriftId `thrift:"token,1" db:"token" json:"token,omitempty"`
}

func NewTrinoThriftNullableToken() *TrinoThriftNullableToken {
	return &TrinoThriftNullableToken{}
}

var TrinoThriftNullableToken_Token_DEFAULT *TrinoThriftId

func (p *TrinoThriftNullableToken) GetToken() *TrinoThriftId {
	if !p.IsSetToken() {
		return TrinoThriftNullableToken_Token_DEFAULT
	}
	return p.Token
}
func (p *TrinoThriftNullableToken) IsSetToken() bool {
	return p.Token != nil
}

func (p *TrinoThriftNullableToken) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftNullableToken) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftNullableToken"); 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 *TrinoThriftNullableToken) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetToken() {
		if err := oprot.WriteFieldBegin(ctx, "token", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:token: ", p), err)
		}
		if err := p.Token.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Token), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:token: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftNullableToken) Equals(other *TrinoThriftNullableToken) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.Token.Equals(other.Token) {
		return false
	}
	return true
}

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

func (p *TrinoThriftNullableToken) Validate() error {
	return nil
}

// Attributes:
//   - ValueSet
//   - NullAllowed
type TrinoThriftDomain struct {
	ValueSet    *TrinoThriftValueSet `thrift:"valueSet,1" db:"valueSet" json:"valueSet"`
	NullAllowed bool                 `thrift:"nullAllowed,2" db:"nullAllowed" json:"nullAllowed"`
}

func NewTrinoThriftDomain() *TrinoThriftDomain {
	return &TrinoThriftDomain{}
}

var TrinoThriftDomain_ValueSet_DEFAULT *TrinoThriftValueSet

func (p *TrinoThriftDomain) GetValueSet() *TrinoThriftValueSet {
	if !p.IsSetValueSet() {
		return TrinoThriftDomain_ValueSet_DEFAULT
	}
	return p.ValueSet
}

func (p *TrinoThriftDomain) GetNullAllowed() bool {
	return p.NullAllowed
}
func (p *TrinoThriftDomain) IsSetValueSet() bool {
	return p.ValueSet != nil
}

func (p *TrinoThriftDomain) 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)
	}

	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
				}
			} 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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftDomain) 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.NullAllowed = v
	}
	return nil
}

func (p *TrinoThriftDomain) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftDomain"); 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 *TrinoThriftDomain) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "valueSet", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:valueSet: ", p), err)
	}
	if err := p.ValueSet.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ValueSet), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:valueSet: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftDomain) Equals(other *TrinoThriftDomain) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.ValueSet.Equals(other.ValueSet) {
		return false
	}
	if p.NullAllowed != other.NullAllowed {
		return false
	}
	return true
}

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

func (p *TrinoThriftDomain) Validate() error {
	return nil
}

// Attributes:
//   - Low
//   - High
type TrinoThriftRange struct {
	Low  *TrinoThriftMarker `thrift:"low,1" db:"low" json:"low"`
	High *TrinoThriftMarker `thrift:"high,2" db:"high" json:"high"`
}

func NewTrinoThriftRange() *TrinoThriftRange {
	return &TrinoThriftRange{}
}

var TrinoThriftRange_Low_DEFAULT *TrinoThriftMarker

func (p *TrinoThriftRange) GetLow() *TrinoThriftMarker {
	if !p.IsSetLow() {
		return TrinoThriftRange_Low_DEFAULT
	}
	return p.Low
}

var TrinoThriftRange_High_DEFAULT *TrinoThriftMarker

func (p *TrinoThriftRange) GetHigh() *TrinoThriftMarker {
	if !p.IsSetHigh() {
		return TrinoThriftRange_High_DEFAULT
	}
	return p.High
}
func (p *TrinoThriftRange) IsSetLow() bool {
	return p.Low != nil
}

func (p *TrinoThriftRange) IsSetHigh() bool {
	return p.High != nil
}

func (p *TrinoThriftRange) 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)
	}

	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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField2(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)
	}
	return nil
}

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

func (p *TrinoThriftRange) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
	p.High = &TrinoThriftMarker{}
	if err := p.High.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.High), err)
	}
	return nil
}

func (p *TrinoThriftRange) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "TrinoThriftRange"); 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 *TrinoThriftRange) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "low", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:low: ", p), err)
	}
	if err := p.Low.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Low), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:low: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftRange) Equals(other *TrinoThriftRange) bool {
	if p == other {
		return true
	} else if p == nil || other == nil {
		return false
	}
	if !p.Low.Equals(other.Low) {
		return false
	}
	if !p.High.Equals(other.High) {
		return false
	}
	return true
}

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

func (p *TrinoThriftRange) Validate() error {
	return nil
}

type TrinoThriftService interface { //Trino Thrift service definition.
	//This thrift service needs to be implemented in order to be used with Thrift Connector.

	// Returns available schema names.
	TrinoListSchemaNames(ctx context.Context) (_r []string, _err error)
	// Returns tables for the given schema name.
	//
	// @param schemaNameOrNull a structure containing schema name or {@literal null}
	// @return a list of table names with corresponding schemas. If schema name is null then returns
	// a list of tables for all schemas. Returns an empty list if a schema does not exist
	//
	// Parameters:
	//  - SchemaNameOrNull
	TrinoListTables(ctx context.Context, schemaNameOrNull *TrinoThriftNullableSchemaName) (_r []*TrinoThriftSchemaTableName, _err error)
	// Returns metadata for a given table.
	//
	// @param schemaTableName schema and table name
	// @return metadata for a given table, or a {@literal null} value inside if it does not exist
	//
	// Parameters:
	//  - SchemaTableName
	TrinoGetTableMetadata(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName) (_r *TrinoThriftNullableTableMetadata, _err error)
	// Returns a batch of splits.
	//
	// @param schemaTableName schema and table name
	// @param desiredColumns a superset of columns to return; empty set means "no columns", {@literal null} set means "all columns"
	// @param outputConstraint constraint on the returned data
	// @param maxSplitCount maximum number of splits to return
	// @param nextToken token from a previous split batch or {@literal null} if it is the first call
	// @return a batch of splits
	//
	// Parameters:
	//  - SchemaTableName
	//  - DesiredColumns
	//  - OutputConstraint
	//  - MaxSplitCount
	//  - NextToken
	TrinoGetSplits(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName, desiredColumns *TrinoThriftNullableColumnSet, outputConstraint *TrinoThriftTupleDomain, maxSplitCount int32, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftSplitBatch, _err error)
	// Returns a batch of index splits for the given batch of keys.
	// This method is called if index join strategy is chosen for a query.
	//
	// @param schemaTableName schema and table name
	// @param indexColumnNames specifies columns and their order for keys
	// @param outputColumnNames a list of column names to return
	// @param keys keys for which records need to be returned; includes only unique and non-null values
	// @param outputConstraint constraint on the returned data
	// @param maxSplitCount maximum number of splits to return
	// @param nextToken token from a previous split batch or {@literal null} if it is the first call
	// @return a batch of splits
	//
	// Parameters:
	//  - SchemaTableName
	//  - IndexColumnNames
	//  - OutputColumnNames
	//  - Keys
	//  - OutputConstraint
	//  - MaxSplitCount
	//  - NextToken
	TrinoGetIndexSplits(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName, indexColumnNames []string, outputColumnNames []string, keys *TrinoThriftPageResult_, outputConstraint *TrinoThriftTupleDomain, maxSplitCount int32, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftSplitBatch, _err error)
	// Returns a batch of rows for the given split.
	//
	// @param splitId split id as returned in split batch
	// @param columns a list of column names to return
	// @param maxBytes maximum size of returned data in bytes
	// @param nextToken token from a previous batch or {@literal null} if it is the first call
	// @return a batch of table data
	//
	// Parameters:
	//  - SplitId
	//  - Columns
	//  - MaxBytes
	//  - NextToken
	TrinoGetRows(ctx context.Context, splitId *TrinoThriftId, columns []string, maxBytes int64, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftPageResult_, _err error)
}

// Trino Thrift service definition.
// This thrift service needs to be implemented in order to be used with Thrift Connector.
type TrinoThriftServiceClient struct {
	c    thrift.TClient
	meta thrift.ResponseMeta
}

func NewTrinoThriftServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TrinoThriftServiceClient {
	return &TrinoThriftServiceClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

func NewTrinoThriftServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TrinoThriftServiceClient {
	return &TrinoThriftServiceClient{
		c: thrift.NewTStandardClient(iprot, oprot),
	}
}

func NewTrinoThriftServiceClient(c thrift.TClient) *TrinoThriftServiceClient {
	return &TrinoThriftServiceClient{
		c: c,
	}
}

func (p *TrinoThriftServiceClient) Client_() thrift.TClient {
	return p.c
}

func (p *TrinoThriftServiceClient) LastResponseMeta_() thrift.ResponseMeta {
	return p.meta
}

func (p *TrinoThriftServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) {
	p.meta = meta
}

// Returns available schema names.
func (p *TrinoThriftServiceClient) TrinoListSchemaNames(ctx context.Context) (_r []string, _err error) {
	var _args61 TrinoThriftServiceTrinoListSchemaNamesArgs
	var _result63 TrinoThriftServiceTrinoListSchemaNamesResult
	var _meta62 thrift.ResponseMeta
	_meta62, _err = p.Client_().Call(ctx, "trinoListSchemaNames", &_args61, &_result63)
	p.SetLastResponseMeta_(_meta62)
	if _err != nil {
		return
	}
	switch {
	case _result63.Ex1 != nil:
		return _r, _result63.Ex1
	}

	return _result63.GetSuccess(), nil
}

// Returns tables for the given schema name.
//
// @param schemaNameOrNull a structure containing schema name or {@literal null}
// @return a list of table names with corresponding schemas. If schema name is null then returns
// a list of tables for all schemas. Returns an empty list if a schema does not exist
//
// Parameters:
//   - SchemaNameOrNull
func (p *TrinoThriftServiceClient) TrinoListTables(ctx context.Context, schemaNameOrNull *TrinoThriftNullableSchemaName) (_r []*TrinoThriftSchemaTableName, _err error) {
	var _args64 TrinoThriftServiceTrinoListTablesArgs
	_args64.SchemaNameOrNull = schemaNameOrNull
	var _result66 TrinoThriftServiceTrinoListTablesResult
	var _meta65 thrift.ResponseMeta
	_meta65, _err = p.Client_().Call(ctx, "trinoListTables", &_args64, &_result66)
	p.SetLastResponseMeta_(_meta65)
	if _err != nil {
		return
	}
	switch {
	case _result66.Ex1 != nil:
		return _r, _result66.Ex1
	}

	return _result66.GetSuccess(), nil
}

// Returns metadata for a given table.
//
// @param schemaTableName schema and table name
// @return metadata for a given table, or a {@literal null} value inside if it does not exist
//
// Parameters:
//   - SchemaTableName
func (p *TrinoThriftServiceClient) TrinoGetTableMetadata(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName) (_r *TrinoThriftNullableTableMetadata, _err error) {
	var _args67 TrinoThriftServiceTrinoGetTableMetadataArgs
	_args67.SchemaTableName = schemaTableName
	var _result69 TrinoThriftServiceTrinoGetTableMetadataResult
	var _meta68 thrift.ResponseMeta
	_meta68, _err = p.Client_().Call(ctx, "trinoGetTableMetadata", &_args67, &_result69)
	p.SetLastResponseMeta_(_meta68)
	if _err != nil {
		return
	}
	switch {
	case _result69.Ex1 != nil:
		return _r, _result69.Ex1
	}

	if _ret70 := _result69.GetSuccess(); _ret70 != nil {
		return _ret70, nil
	}
	return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "trinoGetTableMetadata failed: unknown result")
}

// Returns a batch of splits.
//
// @param schemaTableName schema and table name
// @param desiredColumns a superset of columns to return; empty set means "no columns", {@literal null} set means "all columns"
// @param outputConstraint constraint on the returned data
// @param maxSplitCount maximum number of splits to return
// @param nextToken token from a previous split batch or {@literal null} if it is the first call
// @return a batch of splits
//
// Parameters:
//   - SchemaTableName
//   - DesiredColumns
//   - OutputConstraint
//   - MaxSplitCount
//   - NextToken
func (p *TrinoThriftServiceClient) TrinoGetSplits(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName, desiredColumns *TrinoThriftNullableColumnSet, outputConstraint *TrinoThriftTupleDomain, maxSplitCount int32, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftSplitBatch, _err error) {
	var _args71 TrinoThriftServiceTrinoGetSplitsArgs
	_args71.SchemaTableName = schemaTableName
	_args71.DesiredColumns = desiredColumns
	_args71.OutputConstraint = outputConstraint
	_args71.MaxSplitCount = maxSplitCount
	_args71.NextToken = nextToken
	var _result73 TrinoThriftServiceTrinoGetSplitsResult
	var _meta72 thrift.ResponseMeta
	_meta72, _err = p.Client_().Call(ctx, "trinoGetSplits", &_args71, &_result73)
	p.SetLastResponseMeta_(_meta72)
	if _err != nil {
		return
	}
	switch {
	case _result73.Ex1 != nil:
		return _r, _result73.Ex1
	}

	if _ret74 := _result73.GetSuccess(); _ret74 != nil {
		return _ret74, nil
	}
	return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "trinoGetSplits failed: unknown result")
}

// Returns a batch of index splits for the given batch of keys.
// This method is called if index join strategy is chosen for a query.
//
// @param schemaTableName schema and table name
// @param indexColumnNames specifies columns and their order for keys
// @param outputColumnNames a list of column names to return
// @param keys keys for which records need to be returned; includes only unique and non-null values
// @param outputConstraint constraint on the returned data
// @param maxSplitCount maximum number of splits to return
// @param nextToken token from a previous split batch or {@literal null} if it is the first call
// @return a batch of splits
//
// Parameters:
//   - SchemaTableName
//   - IndexColumnNames
//   - OutputColumnNames
//   - Keys
//   - OutputConstraint
//   - MaxSplitCount
//   - NextToken
func (p *TrinoThriftServiceClient) TrinoGetIndexSplits(ctx context.Context, schemaTableName *TrinoThriftSchemaTableName, indexColumnNames []string, outputColumnNames []string, keys *TrinoThriftPageResult_, outputConstraint *TrinoThriftTupleDomain, maxSplitCount int32, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftSplitBatch, _err error) {
	var _args75 TrinoThriftServiceTrinoGetIndexSplitsArgs
	_args75.SchemaTableName = schemaTableName
	_args75.IndexColumnNames = indexColumnNames
	_args75.OutputColumnNames = outputColumnNames
	_args75.Keys = keys
	_args75.OutputConstraint = outputConstraint
	_args75.MaxSplitCount = maxSplitCount
	_args75.NextToken = nextToken
	var _result77 TrinoThriftServiceTrinoGetIndexSplitsResult
	var _meta76 thrift.ResponseMeta
	_meta76, _err = p.Client_().Call(ctx, "trinoGetIndexSplits", &_args75, &_result77)
	p.SetLastResponseMeta_(_meta76)
	if _err != nil {
		return
	}
	switch {
	case _result77.Ex1 != nil:
		return _r, _result77.Ex1
	}

	if _ret78 := _result77.GetSuccess(); _ret78 != nil {
		return _ret78, nil
	}
	return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "trinoGetIndexSplits failed: unknown result")
}

// Returns a batch of rows for the given split.
//
// @param splitId split id as returned in split batch
// @param columns a list of column names to return
// @param maxBytes maximum size of returned data in bytes
// @param nextToken token from a previous batch or {@literal null} if it is the first call
// @return a batch of table data
//
// Parameters:
//   - SplitId
//   - Columns
//   - MaxBytes
//   - NextToken
func (p *TrinoThriftServiceClient) TrinoGetRows(ctx context.Context, splitId *TrinoThriftId, columns []string, maxBytes int64, nextToken *TrinoThriftNullableToken) (_r *TrinoThriftPageResult_, _err error) {
	var _args79 TrinoThriftServiceTrinoGetRowsArgs
	_args79.SplitId = splitId
	_args79.Columns = columns
	_args79.MaxBytes = maxBytes
	_args79.NextToken = nextToken
	var _result81 TrinoThriftServiceTrinoGetRowsResult
	var _meta80 thrift.ResponseMeta
	_meta80, _err = p.Client_().Call(ctx, "trinoGetRows", &_args79, &_result81)
	p.SetLastResponseMeta_(_meta80)
	if _err != nil {
		return
	}
	switch {
	case _result81.Ex1 != nil:
		return _r, _result81.Ex1
	}

	if _ret82 := _result81.GetSuccess(); _ret82 != nil {
		return _ret82, nil
	}
	return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "trinoGetRows failed: unknown result")
}

type TrinoThriftServiceProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      TrinoThriftService
}

func (p *TrinoThriftServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
	p.processorMap[key] = processor
}

func (p *TrinoThriftServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
	processor, ok = p.processorMap[key]
	return processor, ok
}

func (p *TrinoThriftServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
	return p.processorMap
}

func NewTrinoThriftServiceProcessor(handler TrinoThriftService) *TrinoThriftServiceProcessor {

	self83 := &TrinoThriftServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self83.processorMap["trinoListSchemaNames"] = &trinoThriftServiceProcessorTrinoListSchemaNames{handler: handler}
	self83.processorMap["trinoListTables"] = &trinoThriftServiceProcessorTrinoListTables{handler: handler}
	self83.processorMap["trinoGetTableMetadata"] = &trinoThriftServiceProcessorTrinoGetTableMetadata{handler: handler}
	self83.processorMap["trinoGetSplits"] = &trinoThriftServiceProcessorTrinoGetSplits{handler: handler}
	self83.processorMap["trinoGetIndexSplits"] = &trinoThriftServiceProcessorTrinoGetIndexSplits{handler: handler}
	self83.processorMap["trinoGetRows"] = &trinoThriftServiceProcessorTrinoGetRows{handler: handler}
	return self83
}

func (p *TrinoThriftServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	name, _, seqId, err2 := iprot.ReadMessageBegin(ctx)
	if err2 != nil {
		return false, thrift.WrapTException(err2)
	}
	if processor, ok := p.GetProcessorFunction(name); ok {
		return processor.Process(ctx, seqId, iprot, oprot)
	}
	iprot.Skip(ctx, thrift.STRUCT)
	iprot.ReadMessageEnd(ctx)
	x84 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId)
	x84.Write(ctx, oprot)
	oprot.WriteMessageEnd(ctx)
	oprot.Flush(ctx)
	return false, x84

}

type trinoThriftServiceProcessorTrinoListSchemaNames struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoListSchemaNamesResult{}
	if retval, err2 := p.handler.TrinoListSchemaNames(ctx); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc86 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoListSchemaNames: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoListSchemaNames", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err85 = thrift.WrapTException(err2)
			}
			if err2 := _exc86.Write(ctx, oprot); _write_err85 == nil && err2 != nil {
				_write_err85 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err85 == nil && err2 != nil {
				_write_err85 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err85 == nil && err2 != nil {
				_write_err85 = thrift.WrapTException(err2)
			}
			if _write_err85 != nil {
				return false, thrift.WrapTException(_write_err85)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoListSchemaNames", thrift.REPLY, seqId); err2 != nil {
		_write_err85 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err85 == nil && err2 != nil {
		_write_err85 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err85 == nil && err2 != nil {
		_write_err85 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err85 == nil && err2 != nil {
		_write_err85 = thrift.WrapTException(err2)
	}
	if _write_err85 != nil {
		return false, thrift.WrapTException(_write_err85)
	}
	return true, err
}

type trinoThriftServiceProcessorTrinoListTables struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoListTablesResult{}
	if retval, err2 := p.handler.TrinoListTables(ctx, args.SchemaNameOrNull); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc88 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoListTables: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoListTables", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err87 = thrift.WrapTException(err2)
			}
			if err2 := _exc88.Write(ctx, oprot); _write_err87 == nil && err2 != nil {
				_write_err87 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err87 == nil && err2 != nil {
				_write_err87 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err87 == nil && err2 != nil {
				_write_err87 = thrift.WrapTException(err2)
			}
			if _write_err87 != nil {
				return false, thrift.WrapTException(_write_err87)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoListTables", thrift.REPLY, seqId); err2 != nil {
		_write_err87 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err87 == nil && err2 != nil {
		_write_err87 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err87 == nil && err2 != nil {
		_write_err87 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err87 == nil && err2 != nil {
		_write_err87 = thrift.WrapTException(err2)
	}
	if _write_err87 != nil {
		return false, thrift.WrapTException(_write_err87)
	}
	return true, err
}

type trinoThriftServiceProcessorTrinoGetTableMetadata struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoGetTableMetadataResult{}
	if retval, err2 := p.handler.TrinoGetTableMetadata(ctx, args.SchemaTableName); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc90 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoGetTableMetadata: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoGetTableMetadata", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err89 = thrift.WrapTException(err2)
			}
			if err2 := _exc90.Write(ctx, oprot); _write_err89 == nil && err2 != nil {
				_write_err89 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err89 == nil && err2 != nil {
				_write_err89 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err89 == nil && err2 != nil {
				_write_err89 = thrift.WrapTException(err2)
			}
			if _write_err89 != nil {
				return false, thrift.WrapTException(_write_err89)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoGetTableMetadata", thrift.REPLY, seqId); err2 != nil {
		_write_err89 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err89 == nil && err2 != nil {
		_write_err89 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err89 == nil && err2 != nil {
		_write_err89 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err89 == nil && err2 != nil {
		_write_err89 = thrift.WrapTException(err2)
	}
	if _write_err89 != nil {
		return false, thrift.WrapTException(_write_err89)
	}
	return true, err
}

type trinoThriftServiceProcessorTrinoGetSplits struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoGetSplitsResult{}
	if retval, err2 := p.handler.TrinoGetSplits(ctx, args.SchemaTableName, args.DesiredColumns, args.OutputConstraint, args.MaxSplitCount, args.NextToken); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc92 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoGetSplits: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoGetSplits", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err91 = thrift.WrapTException(err2)
			}
			if err2 := _exc92.Write(ctx, oprot); _write_err91 == nil && err2 != nil {
				_write_err91 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err91 == nil && err2 != nil {
				_write_err91 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err91 == nil && err2 != nil {
				_write_err91 = thrift.WrapTException(err2)
			}
			if _write_err91 != nil {
				return false, thrift.WrapTException(_write_err91)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoGetSplits", thrift.REPLY, seqId); err2 != nil {
		_write_err91 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err91 == nil && err2 != nil {
		_write_err91 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err91 == nil && err2 != nil {
		_write_err91 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err91 == nil && err2 != nil {
		_write_err91 = thrift.WrapTException(err2)
	}
	if _write_err91 != nil {
		return false, thrift.WrapTException(_write_err91)
	}
	return true, err
}

type trinoThriftServiceProcessorTrinoGetIndexSplits struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoGetIndexSplitsResult{}
	if retval, err2 := p.handler.TrinoGetIndexSplits(ctx, args.SchemaTableName, args.IndexColumnNames, args.OutputColumnNames, args.Keys, args.OutputConstraint, args.MaxSplitCount, args.NextToken); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc94 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoGetIndexSplits: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoGetIndexSplits", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err93 = thrift.WrapTException(err2)
			}
			if err2 := _exc94.Write(ctx, oprot); _write_err93 == nil && err2 != nil {
				_write_err93 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err93 == nil && err2 != nil {
				_write_err93 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err93 == nil && err2 != nil {
				_write_err93 = thrift.WrapTException(err2)
			}
			if _write_err93 != nil {
				return false, thrift.WrapTException(_write_err93)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoGetIndexSplits", thrift.REPLY, seqId); err2 != nil {
		_write_err93 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err93 == nil && err2 != nil {
		_write_err93 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err93 == nil && err2 != nil {
		_write_err93 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err93 == nil && err2 != nil {
		_write_err93 = thrift.WrapTException(err2)
	}
	if _write_err93 != nil {
		return false, thrift.WrapTException(_write_err93)
	}
	return true, err
}

type trinoThriftServiceProcessorTrinoGetRows struct {
	handler TrinoThriftService
}

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

	tickerCancel := func() {}
	// Start a goroutine to do server side connectivity check.
	if thrift.ServerConnectivityCheckInterval > 0 {
		var cancel context.CancelCauseFunc
		ctx, cancel = context.WithCancelCause(ctx)
		defer cancel(nil)
		var tickerCtx context.Context
		tickerCtx, tickerCancel = context.WithCancel(context.Background())
		defer tickerCancel()
		go func(ctx context.Context, cancel context.CancelCauseFunc) {
			ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval)
			defer ticker.Stop()
			for {
				select {
				case <-ctx.Done():
					return
				case <-ticker.C:
					if !iprot.Transport().IsOpen() {
						cancel(thrift.ErrAbandonRequest)
						return
					}
				}
			}
		}(tickerCtx, cancel)
	}

	result := TrinoThriftServiceTrinoGetRowsResult{}
	if retval, err2 := p.handler.TrinoGetRows(ctx, args.SplitId, args.Columns, args.MaxBytes, args.NextToken); err2 != nil {
		tickerCancel()
		err = thrift.WrapTException(err2)
		switch v := err2.(type) {
		case *TrinoThriftServiceException:
			result.Ex1 = v
		default:
			if errors.Is(err2, thrift.ErrAbandonRequest) {
				return false, thrift.WrapTException(err2)
			}
			if errors.Is(err2, context.Canceled) {
				if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) {
					return false, thrift.WrapTException(err)
				}
			}
			_exc96 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing trinoGetRows: "+err2.Error())
			if err2 := oprot.WriteMessageBegin(ctx, "trinoGetRows", thrift.EXCEPTION, seqId); err2 != nil {
				_write_err95 = thrift.WrapTException(err2)
			}
			if err2 := _exc96.Write(ctx, oprot); _write_err95 == nil && err2 != nil {
				_write_err95 = thrift.WrapTException(err2)
			}
			if err2 := oprot.WriteMessageEnd(ctx); _write_err95 == nil && err2 != nil {
				_write_err95 = thrift.WrapTException(err2)
			}
			if err2 := oprot.Flush(ctx); _write_err95 == nil && err2 != nil {
				_write_err95 = thrift.WrapTException(err2)
			}
			if _write_err95 != nil {
				return false, thrift.WrapTException(_write_err95)
			}
			return true, err
		}
	} else {
		result.Success = retval
	}
	tickerCancel()
	if err2 := oprot.WriteMessageBegin(ctx, "trinoGetRows", thrift.REPLY, seqId); err2 != nil {
		_write_err95 = thrift.WrapTException(err2)
	}
	if err2 := result.Write(ctx, oprot); _write_err95 == nil && err2 != nil {
		_write_err95 = thrift.WrapTException(err2)
	}
	if err2 := oprot.WriteMessageEnd(ctx); _write_err95 == nil && err2 != nil {
		_write_err95 = thrift.WrapTException(err2)
	}
	if err2 := oprot.Flush(ctx); _write_err95 == nil && err2 != nil {
		_write_err95 = thrift.WrapTException(err2)
	}
	if _write_err95 != nil {
		return false, thrift.WrapTException(_write_err95)
	}
	return true, err
}

// HELPER FUNCTIONS AND STRUCTURES

type TrinoThriftServiceTrinoListSchemaNamesArgs struct {
}

func NewTrinoThriftServiceTrinoListSchemaNamesArgs() *TrinoThriftServiceTrinoListSchemaNamesArgs {
	return &TrinoThriftServiceTrinoListSchemaNamesArgs{}
}

func (p *TrinoThriftServiceTrinoListSchemaNamesArgs) 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)
	}

	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
		}
		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)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoListSchemaNamesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoListSchemaNames_args"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
	}
	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 *TrinoThriftServiceTrinoListSchemaNamesArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TrinoThriftServiceTrinoListSchemaNamesArgs(%+v)", *p)
}

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoListSchemaNamesResult struct {
	Success []string                     `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoListSchemaNamesResult() *TrinoThriftServiceTrinoListSchemaNamesResult {
	return &TrinoThriftServiceTrinoListSchemaNamesResult{}
}

var TrinoThriftServiceTrinoListSchemaNamesResult_Success_DEFAULT []string

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) GetSuccess() []string {
	return p.Success
}

var TrinoThriftServiceTrinoListSchemaNamesResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoListSchemaNamesResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoListSchemaNamesResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) ReadField0(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.Success = tSlice
	for i := 0; i < size; i++ {
		var _elem97 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem97 = v
		}
		p.Success = append(p.Success, _elem97)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoListSchemaNames_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoListSchemaNamesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Success)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Success {
			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 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoListSchemaNamesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//   - SchemaNameOrNull
type TrinoThriftServiceTrinoListTablesArgs struct {
	SchemaNameOrNull *TrinoThriftNullableSchemaName `thrift:"schemaNameOrNull,1" db:"schemaNameOrNull" json:"schemaNameOrNull"`
}

func NewTrinoThriftServiceTrinoListTablesArgs() *TrinoThriftServiceTrinoListTablesArgs {
	return &TrinoThriftServiceTrinoListTablesArgs{}
}

var TrinoThriftServiceTrinoListTablesArgs_SchemaNameOrNull_DEFAULT *TrinoThriftNullableSchemaName

func (p *TrinoThriftServiceTrinoListTablesArgs) GetSchemaNameOrNull() *TrinoThriftNullableSchemaName {
	if !p.IsSetSchemaNameOrNull() {
		return TrinoThriftServiceTrinoListTablesArgs_SchemaNameOrNull_DEFAULT
	}
	return p.SchemaNameOrNull
}
func (p *TrinoThriftServiceTrinoListTablesArgs) IsSetSchemaNameOrNull() bool {
	return p.SchemaNameOrNull != nil
}

func (p *TrinoThriftServiceTrinoListTablesArgs) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoListTablesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoListTables_args"); 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 *TrinoThriftServiceTrinoListTablesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaNameOrNull", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaNameOrNull: ", p), err)
	}
	if err := p.SchemaNameOrNull.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaNameOrNull), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaNameOrNull: ", p), err)
	}
	return err
}

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

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoListTablesResult struct {
	Success []*TrinoThriftSchemaTableName `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException  `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoListTablesResult() *TrinoThriftServiceTrinoListTablesResult {
	return &TrinoThriftServiceTrinoListTablesResult{}
}

var TrinoThriftServiceTrinoListTablesResult_Success_DEFAULT []*TrinoThriftSchemaTableName

func (p *TrinoThriftServiceTrinoListTablesResult) GetSuccess() []*TrinoThriftSchemaTableName {
	return p.Success
}

var TrinoThriftServiceTrinoListTablesResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoListTablesResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoListTablesResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoListTablesResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoListTablesResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoListTablesResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.LIST {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoListTablesResult) ReadField0(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([]*TrinoThriftSchemaTableName, 0, size)
	p.Success = tSlice
	for i := 0; i < size; i++ {
		_elem98 := &TrinoThriftSchemaTableName{}
		if err := _elem98.Read(ctx, iprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem98), err)
		}
		p.Success = append(p.Success, _elem98)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoListTablesResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoListTables_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoListTablesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.LIST, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Success)); err != nil {
			return thrift.PrependError("error writing list begin: ", err)
		}
		for _, v := range p.Success {
			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 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoListTablesResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//   - SchemaTableName
type TrinoThriftServiceTrinoGetTableMetadataArgs struct {
	SchemaTableName *TrinoThriftSchemaTableName `thrift:"schemaTableName,1" db:"schemaTableName" json:"schemaTableName"`
}

func NewTrinoThriftServiceTrinoGetTableMetadataArgs() *TrinoThriftServiceTrinoGetTableMetadataArgs {
	return &TrinoThriftServiceTrinoGetTableMetadataArgs{}
}

var TrinoThriftServiceTrinoGetTableMetadataArgs_SchemaTableName_DEFAULT *TrinoThriftSchemaTableName

func (p *TrinoThriftServiceTrinoGetTableMetadataArgs) GetSchemaTableName() *TrinoThriftSchemaTableName {
	if !p.IsSetSchemaTableName() {
		return TrinoThriftServiceTrinoGetTableMetadataArgs_SchemaTableName_DEFAULT
	}
	return p.SchemaTableName
}
func (p *TrinoThriftServiceTrinoGetTableMetadataArgs) IsSetSchemaTableName() bool {
	return p.SchemaTableName != nil
}

func (p *TrinoThriftServiceTrinoGetTableMetadataArgs) 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)
	}

	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
				}
			} 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)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoGetTableMetadataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetTableMetadata_args"); 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 *TrinoThriftServiceTrinoGetTableMetadataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaTableName", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaTableName: ", p), err)
	}
	if err := p.SchemaTableName.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaTableName), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaTableName: ", p), err)
	}
	return err
}

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

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoGetTableMetadataResult struct {
	Success *TrinoThriftNullableTableMetadata `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException      `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoGetTableMetadataResult() *TrinoThriftServiceTrinoGetTableMetadataResult {
	return &TrinoThriftServiceTrinoGetTableMetadataResult{}
}

var TrinoThriftServiceTrinoGetTableMetadataResult_Success_DEFAULT *TrinoThriftNullableTableMetadata

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) GetSuccess() *TrinoThriftNullableTableMetadata {
	if !p.IsSetSuccess() {
		return TrinoThriftServiceTrinoGetTableMetadataResult_Success_DEFAULT
	}
	return p.Success
}

var TrinoThriftServiceTrinoGetTableMetadataResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoGetTableMetadataResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoGetTableMetadataResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

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

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

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetTableMetadata_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoGetTableMetadataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetTableMetadataResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//   - SchemaTableName
//   - DesiredColumns
//   - OutputConstraint
//   - MaxSplitCount
//   - NextToken
type TrinoThriftServiceTrinoGetSplitsArgs struct {
	SchemaTableName  *TrinoThriftSchemaTableName   `thrift:"schemaTableName,1" db:"schemaTableName" json:"schemaTableName"`
	DesiredColumns   *TrinoThriftNullableColumnSet `thrift:"desiredColumns,2" db:"desiredColumns" json:"desiredColumns"`
	OutputConstraint *TrinoThriftTupleDomain       `thrift:"outputConstraint,3" db:"outputConstraint" json:"outputConstraint"`
	MaxSplitCount    int32                         `thrift:"maxSplitCount,4" db:"maxSplitCount" json:"maxSplitCount"`
	NextToken        *TrinoThriftNullableToken     `thrift:"nextToken,5" db:"nextToken" json:"nextToken"`
}

func NewTrinoThriftServiceTrinoGetSplitsArgs() *TrinoThriftServiceTrinoGetSplitsArgs {
	return &TrinoThriftServiceTrinoGetSplitsArgs{}
}

var TrinoThriftServiceTrinoGetSplitsArgs_SchemaTableName_DEFAULT *TrinoThriftSchemaTableName

func (p *TrinoThriftServiceTrinoGetSplitsArgs) GetSchemaTableName() *TrinoThriftSchemaTableName {
	if !p.IsSetSchemaTableName() {
		return TrinoThriftServiceTrinoGetSplitsArgs_SchemaTableName_DEFAULT
	}
	return p.SchemaTableName
}

var TrinoThriftServiceTrinoGetSplitsArgs_DesiredColumns_DEFAULT *TrinoThriftNullableColumnSet

func (p *TrinoThriftServiceTrinoGetSplitsArgs) GetDesiredColumns() *TrinoThriftNullableColumnSet {
	if !p.IsSetDesiredColumns() {
		return TrinoThriftServiceTrinoGetSplitsArgs_DesiredColumns_DEFAULT
	}
	return p.DesiredColumns
}

var TrinoThriftServiceTrinoGetSplitsArgs_OutputConstraint_DEFAULT *TrinoThriftTupleDomain

func (p *TrinoThriftServiceTrinoGetSplitsArgs) GetOutputConstraint() *TrinoThriftTupleDomain {
	if !p.IsSetOutputConstraint() {
		return TrinoThriftServiceTrinoGetSplitsArgs_OutputConstraint_DEFAULT
	}
	return p.OutputConstraint
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) GetMaxSplitCount() int32 {
	return p.MaxSplitCount
}

var TrinoThriftServiceTrinoGetSplitsArgs_NextToken_DEFAULT *TrinoThriftNullableToken

func (p *TrinoThriftServiceTrinoGetSplitsArgs) GetNextToken() *TrinoThriftNullableToken {
	if !p.IsSetNextToken() {
		return TrinoThriftServiceTrinoGetSplitsArgs_NextToken_DEFAULT
	}
	return p.NextToken
}
func (p *TrinoThriftServiceTrinoGetSplitsArgs) IsSetSchemaTableName() bool {
	return p.SchemaTableName != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) IsSetDesiredColumns() bool {
	return p.DesiredColumns != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) IsSetOutputConstraint() bool {
	return p.OutputConstraint != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) IsSetNextToken() bool {
	return p.NextToken != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) 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)
	}

	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
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 2:
			if fieldTypeId == thrift.STRUCT {
				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.STRUCT {
				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.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.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)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoGetSplitsArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error {
	p.DesiredColumns = &TrinoThriftNullableColumnSet{}
	if err := p.DesiredColumns.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DesiredColumns), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error {
	p.OutputConstraint = &TrinoThriftTupleDomain{}
	if err := p.OutputConstraint.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OutputConstraint), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) 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.MaxSplitCount = v
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
	p.NextToken = &TrinoThriftNullableToken{}
	if err := p.NextToken.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NextToken), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetSplitsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetSplits_args"); 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 *TrinoThriftServiceTrinoGetSplitsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaTableName", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaTableName: ", p), err)
	}
	if err := p.SchemaTableName.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaTableName), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaTableName: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftServiceTrinoGetSplitsArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "outputConstraint", thrift.STRUCT, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:outputConstraint: ", p), err)
	}
	if err := p.OutputConstraint.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OutputConstraint), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:outputConstraint: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftServiceTrinoGetSplitsArgs) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "nextToken", thrift.STRUCT, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:nextToken: ", p), err)
	}
	if err := p.NextToken.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NextToken), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:nextToken: ", p), err)
	}
	return err
}

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

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoGetSplitsResult struct {
	Success *TrinoThriftSplitBatch       `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoGetSplitsResult() *TrinoThriftServiceTrinoGetSplitsResult {
	return &TrinoThriftServiceTrinoGetSplitsResult{}
}

var TrinoThriftServiceTrinoGetSplitsResult_Success_DEFAULT *TrinoThriftSplitBatch

func (p *TrinoThriftServiceTrinoGetSplitsResult) GetSuccess() *TrinoThriftSplitBatch {
	if !p.IsSetSuccess() {
		return TrinoThriftServiceTrinoGetSplitsResult_Success_DEFAULT
	}
	return p.Success
}

var TrinoThriftServiceTrinoGetSplitsResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoGetSplitsResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoGetSplitsResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoGetSplitsResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoGetSplitsResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

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

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

func (p *TrinoThriftServiceTrinoGetSplitsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetSplits_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoGetSplitsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetSplitsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//   - SchemaTableName
//   - IndexColumnNames
//   - OutputColumnNames
//   - Keys
//   - OutputConstraint
//   - MaxSplitCount
//   - NextToken
type TrinoThriftServiceTrinoGetIndexSplitsArgs struct {
	SchemaTableName   *TrinoThriftSchemaTableName `thrift:"schemaTableName,1" db:"schemaTableName" json:"schemaTableName"`
	IndexColumnNames  []string                    `thrift:"indexColumnNames,2" db:"indexColumnNames" json:"indexColumnNames"`
	OutputColumnNames []string                    `thrift:"outputColumnNames,3" db:"outputColumnNames" json:"outputColumnNames"`
	Keys              *TrinoThriftPageResult_     `thrift:"keys,4" db:"keys" json:"keys"`
	OutputConstraint  *TrinoThriftTupleDomain     `thrift:"outputConstraint,5" db:"outputConstraint" json:"outputConstraint"`
	MaxSplitCount     int32                       `thrift:"maxSplitCount,6" db:"maxSplitCount" json:"maxSplitCount"`
	NextToken         *TrinoThriftNullableToken   `thrift:"nextToken,7" db:"nextToken" json:"nextToken"`
}

func NewTrinoThriftServiceTrinoGetIndexSplitsArgs() *TrinoThriftServiceTrinoGetIndexSplitsArgs {
	return &TrinoThriftServiceTrinoGetIndexSplitsArgs{}
}

var TrinoThriftServiceTrinoGetIndexSplitsArgs_SchemaTableName_DEFAULT *TrinoThriftSchemaTableName

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetSchemaTableName() *TrinoThriftSchemaTableName {
	if !p.IsSetSchemaTableName() {
		return TrinoThriftServiceTrinoGetIndexSplitsArgs_SchemaTableName_DEFAULT
	}
	return p.SchemaTableName
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetIndexColumnNames() []string {
	return p.IndexColumnNames
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetOutputColumnNames() []string {
	return p.OutputColumnNames
}

var TrinoThriftServiceTrinoGetIndexSplitsArgs_Keys_DEFAULT *TrinoThriftPageResult_

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetKeys() *TrinoThriftPageResult_ {
	if !p.IsSetKeys() {
		return TrinoThriftServiceTrinoGetIndexSplitsArgs_Keys_DEFAULT
	}
	return p.Keys
}

var TrinoThriftServiceTrinoGetIndexSplitsArgs_OutputConstraint_DEFAULT *TrinoThriftTupleDomain

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetOutputConstraint() *TrinoThriftTupleDomain {
	if !p.IsSetOutputConstraint() {
		return TrinoThriftServiceTrinoGetIndexSplitsArgs_OutputConstraint_DEFAULT
	}
	return p.OutputConstraint
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetMaxSplitCount() int32 {
	return p.MaxSplitCount
}

var TrinoThriftServiceTrinoGetIndexSplitsArgs_NextToken_DEFAULT *TrinoThriftNullableToken

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) GetNextToken() *TrinoThriftNullableToken {
	if !p.IsSetNextToken() {
		return TrinoThriftServiceTrinoGetIndexSplitsArgs_NextToken_DEFAULT
	}
	return p.NextToken
}
func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) IsSetSchemaTableName() bool {
	return p.SchemaTableName != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) IsSetKeys() bool {
	return p.Keys != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) IsSetOutputConstraint() bool {
	return p.OutputConstraint != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) IsSetNextToken() bool {
	return p.NextToken != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) 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)
	}

	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
				}
			} 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
				}
			} 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
				}
			}
		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
				}
			}
		case 6:
			if fieldTypeId == thrift.I32 {
				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
				}
			}
		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)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) 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.IndexColumnNames = tSlice
	for i := 0; i < size; i++ {
		var _elem99 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem99 = v
		}
		p.IndexColumnNames = append(p.IndexColumnNames, _elem99)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) 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.OutputColumnNames = tSlice
	for i := 0; i < size; i++ {
		var _elem100 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem100 = v
		}
		p.OutputColumnNames = append(p.OutputColumnNames, _elem100)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
	p.Keys = &TrinoThriftPageResult_{}
	if err := p.Keys.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Keys), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) ReadField5(ctx context.Context, iprot thrift.TProtocol) error {
	p.OutputConstraint = &TrinoThriftTupleDomain{}
	if err := p.OutputConstraint.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OutputConstraint), err)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) ReadField7(ctx context.Context, iprot thrift.TProtocol) error {
	p.NextToken = &TrinoThriftNullableToken{}
	if err := p.NextToken.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NextToken), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetIndexSplits_args"); 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 := 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 *TrinoThriftServiceTrinoGetIndexSplitsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "schemaTableName", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:schemaTableName: ", p), err)
	}
	if err := p.SchemaTableName.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaTableName), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:schemaTableName: ", p), err)
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "indexColumnNames", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:indexColumnNames: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.IndexColumnNames)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.IndexColumnNames {
		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:indexColumnNames: ", p), err)
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "outputColumnNames", thrift.LIST, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:outputColumnNames: ", p), err)
	}
	if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.OutputColumnNames)); err != nil {
		return thrift.PrependError("error writing list begin: ", err)
	}
	for _, v := range p.OutputColumnNames {
		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:outputColumnNames: ", p), err)
	}
	return err
}

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

func (p *TrinoThriftServiceTrinoGetIndexSplitsArgs) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "outputConstraint", thrift.STRUCT, 5); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:outputConstraint: ", p), err)
	}
	if err := p.OutputConstraint.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OutputConstraint), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 5:outputConstraint: ", p), err)
	}
	return err
}

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

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

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

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoGetIndexSplitsResult struct {
	Success *TrinoThriftSplitBatch       `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoGetIndexSplitsResult() *TrinoThriftServiceTrinoGetIndexSplitsResult {
	return &TrinoThriftServiceTrinoGetIndexSplitsResult{}
}

var TrinoThriftServiceTrinoGetIndexSplitsResult_Success_DEFAULT *TrinoThriftSplitBatch

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) GetSuccess() *TrinoThriftSplitBatch {
	if !p.IsSetSuccess() {
		return TrinoThriftServiceTrinoGetIndexSplitsResult_Success_DEFAULT
	}
	return p.Success
}

var TrinoThriftServiceTrinoGetIndexSplitsResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoGetIndexSplitsResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

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

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

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetIndexSplits_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoGetIndexSplitsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetIndexSplitsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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

// Attributes:
//   - SplitId
//   - Columns
//   - MaxBytes
//   - NextToken
type TrinoThriftServiceTrinoGetRowsArgs struct {
	SplitId   *TrinoThriftId            `thrift:"splitId,1" db:"splitId" json:"splitId"`
	Columns   []string                  `thrift:"columns,2" db:"columns" json:"columns"`
	MaxBytes  int64                     `thrift:"maxBytes,3" db:"maxBytes" json:"maxBytes"`
	NextToken *TrinoThriftNullableToken `thrift:"nextToken,4" db:"nextToken" json:"nextToken"`
}

func NewTrinoThriftServiceTrinoGetRowsArgs() *TrinoThriftServiceTrinoGetRowsArgs {
	return &TrinoThriftServiceTrinoGetRowsArgs{}
}

var TrinoThriftServiceTrinoGetRowsArgs_SplitId_DEFAULT *TrinoThriftId

func (p *TrinoThriftServiceTrinoGetRowsArgs) GetSplitId() *TrinoThriftId {
	if !p.IsSetSplitId() {
		return TrinoThriftServiceTrinoGetRowsArgs_SplitId_DEFAULT
	}
	return p.SplitId
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) GetColumns() []string {
	return p.Columns
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) GetMaxBytes() int64 {
	return p.MaxBytes
}

var TrinoThriftServiceTrinoGetRowsArgs_NextToken_DEFAULT *TrinoThriftNullableToken

func (p *TrinoThriftServiceTrinoGetRowsArgs) GetNextToken() *TrinoThriftNullableToken {
	if !p.IsSetNextToken() {
		return TrinoThriftServiceTrinoGetRowsArgs_NextToken_DEFAULT
	}
	return p.NextToken
}
func (p *TrinoThriftServiceTrinoGetRowsArgs) IsSetSplitId() bool {
	return p.SplitId != nil
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) IsSetNextToken() bool {
	return p.NextToken != nil
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) 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)
	}

	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
				}
			} 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
				}
			} 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.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)
	}
	return nil
}

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

func (p *TrinoThriftServiceTrinoGetRowsArgs) 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.Columns = tSlice
	for i := 0; i < size; i++ {
		var _elem101 string
		if v, err := iprot.ReadString(ctx); err != nil {
			return thrift.PrependError("error reading field 0: ", err)
		} else {
			_elem101 = v
		}
		p.Columns = append(p.Columns, _elem101)
	}
	if err := iprot.ReadListEnd(ctx); err != nil {
		return thrift.PrependError("error reading list end: ", err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) 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.MaxBytes = v
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) ReadField4(ctx context.Context, iprot thrift.TProtocol) error {
	p.NextToken = &TrinoThriftNullableToken{}
	if err := p.NextToken.Read(ctx, iprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NextToken), err)
	}
	return nil
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetRows_args"); 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 *TrinoThriftServiceTrinoGetRowsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "splitId", thrift.STRUCT, 1); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:splitId: ", p), err)
	}
	if err := p.SplitId.Write(ctx, oprot); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SplitId), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 1:splitId: ", p), err)
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 2); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 2: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 2:columns: ", p), err)
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetRowsArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if err := oprot.WriteFieldBegin(ctx, "maxBytes", thrift.I64, 3); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxBytes: ", p), err)
	}
	if err := oprot.WriteI64(ctx, int64(p.MaxBytes)); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T.maxBytes (3) field write error: ", p), err)
	}
	if err := oprot.WriteFieldEnd(ctx); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxBytes: ", p), err)
	}
	return err
}

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

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

// Attributes:
//   - Success
//   - Ex1
type TrinoThriftServiceTrinoGetRowsResult struct {
	Success *TrinoThriftPageResult_      `thrift:"success,0" db:"success" json:"success,omitempty"`
	Ex1     *TrinoThriftServiceException `thrift:"ex1,1" db:"ex1" json:"ex1,omitempty"`
}

func NewTrinoThriftServiceTrinoGetRowsResult() *TrinoThriftServiceTrinoGetRowsResult {
	return &TrinoThriftServiceTrinoGetRowsResult{}
}

var TrinoThriftServiceTrinoGetRowsResult_Success_DEFAULT *TrinoThriftPageResult_

func (p *TrinoThriftServiceTrinoGetRowsResult) GetSuccess() *TrinoThriftPageResult_ {
	if !p.IsSetSuccess() {
		return TrinoThriftServiceTrinoGetRowsResult_Success_DEFAULT
	}
	return p.Success
}

var TrinoThriftServiceTrinoGetRowsResult_Ex1_DEFAULT *TrinoThriftServiceException

func (p *TrinoThriftServiceTrinoGetRowsResult) GetEx1() *TrinoThriftServiceException {
	if !p.IsSetEx1() {
		return TrinoThriftServiceTrinoGetRowsResult_Ex1_DEFAULT
	}
	return p.Ex1
}
func (p *TrinoThriftServiceTrinoGetRowsResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TrinoThriftServiceTrinoGetRowsResult) IsSetEx1() bool {
	return p.Ex1 != nil
}

func (p *TrinoThriftServiceTrinoGetRowsResult) 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)
	}

	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 0:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField0(ctx, iprot); err != nil {
					return err
				}
			} else {
				if err := iprot.Skip(ctx, fieldTypeId); err != nil {
					return err
				}
			}
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err := p.ReadField1(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)
	}
	return nil
}

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

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

func (p *TrinoThriftServiceTrinoGetRowsResult) Write(ctx context.Context, oprot thrift.TProtocol) error {
	if err := oprot.WriteStructBegin(ctx, "trinoGetRows_result"); err != nil {
		return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
	}
	if p != nil {
		if err := p.writeField0(ctx, oprot); err != nil {
			return err
		}
		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 *TrinoThriftServiceTrinoGetRowsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err)
		}
		if err := p.Success.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err)
		}
	}
	return err
}

func (p *TrinoThriftServiceTrinoGetRowsResult) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) {
	if p.IsSetEx1() {
		if err := oprot.WriteFieldBegin(ctx, "ex1", thrift.STRUCT, 1); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:ex1: ", p), err)
		}
		if err := p.Ex1.Write(ctx, oprot); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Ex1), err)
		}
		if err := oprot.WriteFieldEnd(ctx); err != nil {
			return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ex1: ", p), err)
		}
	}
	return err
}

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