diff --git a/go.mod b/go.mod index 8bd5985..a23d273 100644 --- a/go.mod +++ b/go.mod @@ -3,16 +3,17 @@ module sqlflow.org/gohive go 1.18 require ( - github.com/apache/thrift v0.12.0 - github.com/beltran/gohive v1.3.0 + github.com/apache/thrift v0.14.1 + github.com/beltran/gohive v1.5.3 github.com/stretchr/testify v1.7.1 ) require ( - github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 // indirect + github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35 // indirect github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab // indirect github.com/davecgh/go-spew v1.1.0 // indirect - github.com/go-zookeeper/zk v1.0.1 // indirect + github.com/go-zookeeper/zk v1.0.3 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect ) diff --git a/go.sum b/go.sum index 3c1b702..491fa93 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,19 @@ -github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs= -github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/beltran/gohive v1.3.0 h1:7e1TGJ/F/mMpoZ1JLevHkoqc0iQnxwEN9y8gn9uKoqU= -github.com/beltran/gohive v1.3.0/go.mod h1:TcPLlZLQbom57zWZpiG25iG9DFbyJgl/W4NbYlqMD5E= -github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293 h1:1wRvU44e78w7zJoynLqrXLKSI+VEFEaWmzyq5JdUx7I= +github.com/apache/thrift v0.14.1 h1:Yh8v0hpCj63p5edXOLaqTJW0IJ1p+eMW6+YSOqw1d6s= +github.com/apache/thrift v0.14.1/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/beltran/gohive v1.5.3 h1:fGvLt4IoVbXMbg4B14igkwCd435ODug95C9tQcbKCmg= +github.com/beltran/gohive v1.5.3/go.mod h1:BJbXAhof7gWk5+kl0y6Ox8TFDJ1xv6gwDksF7l15LFI= github.com/beltran/gosasl v0.0.0-20200715011608-d5475aebb293/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= +github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35 h1:iQwgRNFGmoKDj0bCxzMOxaT7EHFVFArnm20WqHHvuKE= +github.com/beltran/gosasl v0.0.0-20220331024818-65cde6a69a35/go.mod h1:Qx8cW6jkI8riyzmklj80kAIkv+iezFUTBiGU0qHhHes= github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab h1:ayfcn60tXOSYy5zUN1AMSTQo4nJCf7hrdzAVchpPst4= github.com/beltran/gssapi v0.0.0-20200324152954-d86554db4bab/go.mod h1:GLe4UoSyvJ3cVG+DVtKen5eAiaD8mAJFuV5PT3Eeg9Q= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/go-zookeeper/zk v1.0.1 h1:LmXNmSnkNsNKai+aDu6sHRr8ZJzIrHJo8z8Z4sm8cT8= github.com/go-zookeeper/zk v1.0.1/go.mod h1:gpJdHazfkmlg4V0rt0vYeHYJHSL8hHFwV0qOd+HRTJE= +github.com/go-zookeeper/zk v1.0.3 h1:7M2kwOsc//9VeeFiPtf+uSJlVpU66x9Ba5+8XK7/TDg= +github.com/go-zookeeper/zk v1.0.3/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/hiveserver2/README.md b/hiveserver2/README.md index 30902c5..c9a71ce 100644 --- a/hiveserver2/README.md +++ b/hiveserver2/README.md @@ -2,12 +2,18 @@ For the convenience to access Hive from clients in various languages, the Hive developers created Hive Server, which is a Thrift service. The currently well-used version is known as Hive Server 2. -To write a Hive Server 2 client in Go, we need to use the `thrift` command to compile the Thrift service definition file [`TCLIService.thrift`](https://github.com/apache/hive/blob/master/service-rpc/if/TCLIService.thrift) from Hive Server 2 codebase, into Go source code. +To write a Hive Server 2 client in Go, we need to use the `thrift` command to compile the Thrift service definition file [`TCLIService.thrift`](https://github.com/apache/hive/blob/master/service-rpc/if/TCLIService.thrift) from Hive Server 2 codebase, into Go source code: -According to their [blog post](https://cwiki.apache.org/confluence/display/Hive/HowToContribute), the Hive developers for some reasons locks the Thrift version to 0.9.3, which is pretty old that you might not want to install it on your computer. Thanks to the Thrift team, who releases Thrift in Docker images and we can use the 0.9.3 version of Docker image for the compilation: +```bash +curl -sS https://raw.githubusercontent.com/apache/hive/rel/release-3.1.3/service-rpc/if/TCLIService.thrift > TCLIService.thrift +``` + +According to their [blog post](https://cwiki.apache.org/confluence/display/Hive/HowToContribute#HowToContribute-GeneratingThriftCode), the Hive developers recommends to use Thrift v0.14.1 to generate the Hive's auto-generated Thrift code: ```bash -docker run --rm -it -v $PWD:/work -w /work thrift:0.9.3 thrift -r --gen go TCLIService.thrift +docker run --rm -it -v $PWD:/work -w /work \ + anthonyroussel/thrift:0.14.1 \ + thrift -r --gen go TCLIService.thrift ``` The above command generates Go source code in the subdirectory `./gen-go/tcliservice`. diff --git a/hiveserver2/TCLIService.thrift b/hiveserver2/TCLIService.thrift index baf583f..30f8af7 100644 --- a/hiveserver2/TCLIService.thrift +++ b/hiveserver2/TCLIService.thrift @@ -32,14 +32,14 @@ // * Service names begin with the letter "T", use a capital letter for each // new word (with no underscores), and end with the word "Service". -namespace java org.apache.hive.service.cli.thrift -namespace cpp apache.hive.service.cli.thrift +namespace java org.apache.hive.service.rpc.thrift +namespace cpp apache.hive.service.rpc.thrift // List of protocol versions. A new token should be // added to the end of this list every time a change is made. enum TProtocolVersion { HIVE_CLI_SERVICE_PROTOCOL_V1, - + // V2 adds support for asynchronous execution HIVE_CLI_SERVICE_PROTOCOL_V2 @@ -60,6 +60,15 @@ enum TProtocolVersion { // V8 adds support for interval types HIVE_CLI_SERVICE_PROTOCOL_V8 + + // V9 adds support for serializing ResultSets in SerDe + HIVE_CLI_SERVICE_PROTOCOL_V9 + + // V10 adds support for in place updates via GetOperationStatus + HIVE_CLI_SERVICE_PROTOCOL_V10 + + // V11 adds timestamp with local time zone type + HIVE_CLI_SERVICE_PROTOCOL_V11 } enum TTypeId { @@ -84,9 +93,10 @@ enum TTypeId { VARCHAR_TYPE, CHAR_TYPE, INTERVAL_YEAR_MONTH_TYPE, - INTERVAL_DAY_TIME_TYPE + INTERVAL_DAY_TIME_TYPE, + TIMESTAMPLOCALTZ_TYPE } - + const set PRIMITIVE_TYPES = [ TTypeId.BOOLEAN_TYPE, TTypeId.TINYINT_TYPE, @@ -104,7 +114,8 @@ const set PRIMITIVE_TYPES = [ TTypeId.VARCHAR_TYPE, TTypeId.CHAR_TYPE, TTypeId.INTERVAL_YEAR_MONTH_TYPE, - TTypeId.INTERVAL_DAY_TIME_TYPE + TTypeId.INTERVAL_DAY_TIME_TYPE, + TTypeId.TIMESTAMPLOCALTZ_TYPE ] const set COMPLEX_TYPES = [ @@ -142,6 +153,7 @@ const map TYPE_NAMES = { TTypeId.CHAR_TYPE: "CHAR" TTypeId.INTERVAL_YEAR_MONTH_TYPE: "INTERVAL_YEAR_MONTH" TTypeId.INTERVAL_DAY_TIME_TYPE: "INTERVAL_DAY_TIME" + TTypeId.TIMESTAMPLOCALTZ_TYPE: "TIMESTAMP WITH LOCAL TIME ZONE" } // Thrift does not support recursively defined types or forward declarations, @@ -265,7 +277,7 @@ struct TColumnDesc { // The type descriptor for this column 2: required TTypeDesc typeDesc - + // The ordinal position of this column in the schema 3: required i32 position @@ -402,6 +414,8 @@ struct TRowSet { 1: required i64 startRowOffset 2: required list rows 3: optional list columns + 4: optional binary binaryColumns + 5: optional i32 columnCount } // The return status code contained in each response. @@ -456,6 +470,9 @@ enum TOperationState { // The operation is in an pending state PENDING_STATE, + + // The operation is in an timedout state + TIMEDOUT_STATE, } // A string identifier. This is interpreted literally. @@ -551,7 +568,7 @@ struct TOperationHandle { // which operations may be executed. struct TOpenSessionReq { // The version of the HiveServer2 protocol that the client is using. - 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 // Username and password for authentication. // Depending on the authentication scheme being used, @@ -570,7 +587,7 @@ struct TOpenSessionResp { 1: required TStatus status // The protocol version that the server is using. - 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 + 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 // Session Handle 3: optional TSessionHandle sessionHandle @@ -579,6 +596,15 @@ struct TOpenSessionResp { 4: optional map configuration } +struct TSetClientInfoReq { + 1: required TSessionHandle sessionHandle, + 2: optional map configuration +} + +struct TSetClientInfoResp { + 1: required TStatus status +} + // CloseSession() // @@ -644,6 +670,7 @@ enum TGetInfoType { CLI_CATALOG_NAME = 10003, CLI_COLLATION_SEQ = 10004, CLI_MAX_IDENTIFIER_LEN = 10005, + CLI_ODBC_KEYWORDS = 10006 } union TGetInfoValue { @@ -692,9 +719,12 @@ struct TExecuteStatementReq { // is executed. These properties apply to this statement // only and will not affect the subsequent state of the Session. 3: optional map confOverlay - + // Execute asynchronously when runAsync is true 4: optional bool runAsync = false + + // The number of seconds after which the query will timeout on the server + 5: optional i64 queryTimeout = 0 } struct TExecuteStatementResp { @@ -718,13 +748,13 @@ struct TGetTypeInfoReq { struct TGetTypeInfoResp { 1: required TStatus status 2: optional TOperationHandle operationHandle -} +} // GetCatalogs() // -// Returns the list of catalogs (databases) -// Results are ordered by TABLE_CATALOG +// Returns the list of catalogs (databases) +// Results are ordered by TABLE_CATALOG // // Resultset columns : // col1 @@ -834,9 +864,9 @@ struct TGetTablesResp { // GetTableTypes() // -// Returns the table types available in this database. -// The results are ordered by table type. -// +// Returns the table types available in this database. +// The results are ordered by table type. +// // col1 // name: TABLE_TYPE // type: STRING @@ -857,8 +887,8 @@ struct TGetTableTypesResp { // Returns a list of columns in the specified tables. // The information is returned as a result set which can be fetched // using the OperationHandle provided in the response. -// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, -// and ORDINAL_POSITION. +// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, +// and ORDINAL_POSITION. // // Result Set Columns are the same as those for the ODBC CLIColumns // function. @@ -954,7 +984,53 @@ struct TGetFunctionsResp { 1: required TStatus status 2: optional TOperationHandle operationHandle } - + +struct TGetPrimaryKeysReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the catalog. + 2: optional TIdentifier catalogName + + // Name of the schema. + 3: optional TIdentifier schemaName + + // Name of the table. + 4: optional TIdentifier tableName +} + +struct TGetPrimaryKeysResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + +struct TGetCrossReferenceReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the parent catalog. + 2: optional TIdentifier parentCatalogName + + // Name of the parent schema. + 3: optional TIdentifier parentSchemaName + + // Name of the parent table. + 4: optional TIdentifier parentTableName + + // Name of the foreign catalog. + 5: optional TIdentifier foreignCatalogName + + // Name of the foreign schema. + 6: optional TIdentifier foreignSchemaName + + // Name of the foreign table. + 7: optional TIdentifier foreignTableName +} + +struct TGetCrossReferenceResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} // GetOperationStatus() // @@ -962,6 +1038,8 @@ struct TGetFunctionsResp { struct TGetOperationStatusReq { // Session to run this request against 1: required TOperationHandle operationHandle + // optional arguments to get progress information + 2: optional bool getProgressUpdate } struct TGetOperationStatusResp { @@ -977,6 +1055,21 @@ struct TGetOperationStatusResp { // Error message 5: optional string errorMessage + + // List of statuses of sub tasks + 6: optional string taskStatus + + // When was the operation started + 7: optional i64 operationStarted + + // When was the operation completed + 8: optional i64 operationCompleted + + // If the operation has the result + 9: optional bool hasResultSet + + 10: optional TProgressUpdateResp progressUpdateResponse + } @@ -1059,7 +1152,7 @@ struct TFetchResultsReq { // The fetch orientation. For V1 this must be either // FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT. 2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT - + // Max number of rows that should be returned in // the rowset. 3: required i64 maxRows @@ -1132,6 +1225,29 @@ struct TRenewDelegationTokenResp { 1: required TStatus status } +enum TJobExecutionStatus { + IN_PROGRESS, + COMPLETE, + NOT_AVAILABLE +} + +struct TProgressUpdateResp { + 1: required list headerNames + 2: required list> rows + 3: required double progressedPercentage + 4: required TJobExecutionStatus status + 5: required string footerSummary + 6: required i64 startTime +} + +struct TGetQueryIdReq { + 1: required TOperationHandle operationHandle +} + +struct TGetQueryIdResp { + 1: required string queryId +} + service TCLIService { TOpenSessionResp OpenSession(1:TOpenSessionReq req); @@ -1156,8 +1272,12 @@ service TCLIService { TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req); + TGetPrimaryKeysResp GetPrimaryKeys(1:TGetPrimaryKeysReq req); + + TGetCrossReferenceResp GetCrossReference(1:TGetCrossReferenceReq req); + TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req); - + TCancelOperationResp CancelOperation(1:TCancelOperationReq req); TCloseOperationResp CloseOperation(1:TCloseOperationReq req); @@ -1171,4 +1291,8 @@ service TCLIService { TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req); TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req); + + TGetQueryIdResp GetQueryId(1:TGetQueryIdReq req); + + TSetClientInfoResp SetClientInfo(1:TSetClientInfoReq req); } diff --git a/hiveserver2/gen-go/tcliservice/GoUnusedProtection__.go b/hiveserver2/gen-go/tcliservice/GoUnusedProtection__.go index 63753d1..3f58104 100644 --- a/hiveserver2/gen-go/tcliservice/GoUnusedProtection__.go +++ b/hiveserver2/gen-go/tcliservice/GoUnusedProtection__.go @@ -1,5 +1,4 @@ -// Autogenerated by Thrift Compiler (0.12.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT. package tcliservice diff --git a/hiveserver2/gen-go/tcliservice/TCLIService-consts.go b/hiveserver2/gen-go/tcliservice/TCLIService-consts.go index 8863b2c..ce7e392 100644 --- a/hiveserver2/gen-go/tcliservice/TCLIService-consts.go +++ b/hiveserver2/gen-go/tcliservice/TCLIService-consts.go @@ -1,13 +1,12 @@ -// Autogenerated by Thrift Compiler (0.12.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT. package tcliservice -import ( +import( "bytes" "context" - "reflect" "fmt" + "time" "github.com/apache/thrift/lib/go/thrift" ) @@ -15,7 +14,7 @@ import ( var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = reflect.DeepEqual +var _ = time.Now var _ = bytes.Equal var PRIMITIVE_TYPES []TTypeId @@ -28,7 +27,7 @@ const SCALE = "scale" func init() { PRIMITIVE_TYPES = []TTypeId{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, } + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 17, 18, 19, 20, 21, 22, } COMPLEX_TYPES = []TTypeId{ 10, 11, 12, 13, 14, } @@ -54,6 +53,7 @@ TYPE_NAMES = map[TTypeId]string{ 2: "SMALLINT", 7: "STRING", 12: "STRUCT", + 22: "TIMESTAMP WITH LOCAL TIME ZONE", 8: "TIMESTAMP", 1: "TINYINT", 13: "UNIONTYPE", diff --git a/hiveserver2/gen-go/tcliservice/TCLIService.go b/hiveserver2/gen-go/tcliservice/TCLIService.go index e11788c..2438432 100644 --- a/hiveserver2/gen-go/tcliservice/TCLIService.go +++ b/hiveserver2/gen-go/tcliservice/TCLIService.go @@ -1,15 +1,14 @@ -// Autogenerated by Thrift Compiler (0.12.0) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT. package tcliservice -import ( +import( "bytes" "context" - "reflect" "database/sql/driver" "errors" "fmt" + "time" "github.com/apache/thrift/lib/go/thrift" ) @@ -17,7 +16,7 @@ import ( var _ = thrift.ZERO var _ = fmt.Printf var _ = context.Background -var _ = reflect.DeepEqual +var _ = time.Now var _ = bytes.Equal type TProtocolVersion int64 @@ -30,6 +29,9 @@ const ( TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6 TProtocolVersion = 5 TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7 TProtocolVersion = 6 TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8 TProtocolVersion = 7 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9 TProtocolVersion = 8 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10 TProtocolVersion = 9 + TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11 TProtocolVersion = 10 ) func (p TProtocolVersion) String() string { @@ -42,6 +44,9 @@ func (p TProtocolVersion) String() string { case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6: return "HIVE_CLI_SERVICE_PROTOCOL_V6" case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7: return "HIVE_CLI_SERVICE_PROTOCOL_V7" case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8: return "HIVE_CLI_SERVICE_PROTOCOL_V8" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9: return "HIVE_CLI_SERVICE_PROTOCOL_V9" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10: return "HIVE_CLI_SERVICE_PROTOCOL_V10" + case TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11: return "HIVE_CLI_SERVICE_PROTOCOL_V11" } return "" } @@ -56,6 +61,9 @@ func TProtocolVersionFromString(s string) (TProtocolVersion, error) { case "HIVE_CLI_SERVICE_PROTOCOL_V6": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V6, nil case "HIVE_CLI_SERVICE_PROTOCOL_V7": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V7, nil case "HIVE_CLI_SERVICE_PROTOCOL_V8": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V8, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V9": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V9, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V10": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V10, nil + case "HIVE_CLI_SERVICE_PROTOCOL_V11": return TProtocolVersion_HIVE_CLI_SERVICE_PROTOCOL_V11, nil } return TProtocolVersion(0), fmt.Errorf("not a valid TProtocolVersion string") } @@ -115,6 +123,7 @@ const ( TTypeId_CHAR_TYPE TTypeId = 19 TTypeId_INTERVAL_YEAR_MONTH_TYPE TTypeId = 20 TTypeId_INTERVAL_DAY_TIME_TYPE TTypeId = 21 + TTypeId_TIMESTAMPLOCALTZ_TYPE TTypeId = 22 ) func (p TTypeId) String() string { @@ -141,6 +150,7 @@ func (p TTypeId) String() string { case TTypeId_CHAR_TYPE: return "CHAR_TYPE" case TTypeId_INTERVAL_YEAR_MONTH_TYPE: return "INTERVAL_YEAR_MONTH_TYPE" case TTypeId_INTERVAL_DAY_TIME_TYPE: return "INTERVAL_DAY_TIME_TYPE" + case TTypeId_TIMESTAMPLOCALTZ_TYPE: return "TIMESTAMPLOCALTZ_TYPE" } return "" } @@ -169,6 +179,7 @@ func TTypeIdFromString(s string) (TTypeId, error) { case "CHAR_TYPE": return TTypeId_CHAR_TYPE, nil case "INTERVAL_YEAR_MONTH_TYPE": return TTypeId_INTERVAL_YEAR_MONTH_TYPE, nil case "INTERVAL_DAY_TIME_TYPE": return TTypeId_INTERVAL_DAY_TIME_TYPE, nil + case "TIMESTAMPLOCALTZ_TYPE": return TTypeId_TIMESTAMPLOCALTZ_TYPE, nil } return TTypeId(0), fmt.Errorf("not a valid TTypeId string") } @@ -276,6 +287,7 @@ const ( TOperationState_ERROR_STATE TOperationState = 5 TOperationState_UKNOWN_STATE TOperationState = 6 TOperationState_PENDING_STATE TOperationState = 7 + TOperationState_TIMEDOUT_STATE TOperationState = 8 ) func (p TOperationState) String() string { @@ -288,6 +300,7 @@ func (p TOperationState) String() string { case TOperationState_ERROR_STATE: return "ERROR_STATE" case TOperationState_UKNOWN_STATE: return "UKNOWN_STATE" case TOperationState_PENDING_STATE: return "PENDING_STATE" + case TOperationState_TIMEDOUT_STATE: return "TIMEDOUT_STATE" } return "" } @@ -302,6 +315,7 @@ func TOperationStateFromString(s string) (TOperationState, error) { case "ERROR_STATE": return TOperationState_ERROR_STATE, nil case "UKNOWN_STATE": return TOperationState_UKNOWN_STATE, nil case "PENDING_STATE": return TOperationState_PENDING_STATE, nil + case "TIMEDOUT_STATE": return TOperationState_TIMEDOUT_STATE, nil } return TOperationState(0), fmt.Errorf("not a valid TOperationState string") } @@ -460,6 +474,7 @@ const ( TGetInfoType_CLI_CATALOG_NAME TGetInfoType = 10003 TGetInfoType_CLI_COLLATION_SEQ TGetInfoType = 10004 TGetInfoType_CLI_MAX_IDENTIFIER_LEN TGetInfoType = 10005 + TGetInfoType_CLI_ODBC_KEYWORDS TGetInfoType = 10006 ) func (p TGetInfoType) String() string { @@ -511,6 +526,7 @@ func (p TGetInfoType) String() string { case TGetInfoType_CLI_CATALOG_NAME: return "CLI_CATALOG_NAME" case TGetInfoType_CLI_COLLATION_SEQ: return "CLI_COLLATION_SEQ" case TGetInfoType_CLI_MAX_IDENTIFIER_LEN: return "CLI_MAX_IDENTIFIER_LEN" + case TGetInfoType_CLI_ODBC_KEYWORDS: return "CLI_ODBC_KEYWORDS" } return "" } @@ -564,6 +580,7 @@ func TGetInfoTypeFromString(s string) (TGetInfoType, error) { case "CLI_CATALOG_NAME": return TGetInfoType_CLI_CATALOG_NAME, nil case "CLI_COLLATION_SEQ": return TGetInfoType_CLI_COLLATION_SEQ, nil case "CLI_MAX_IDENTIFIER_LEN": return TGetInfoType_CLI_MAX_IDENTIFIER_LEN, nil + case "CLI_ODBC_KEYWORDS": return TGetInfoType_CLI_ODBC_KEYWORDS, nil } return TGetInfoType(0), fmt.Errorf("not a valid TGetInfoType string") } @@ -664,6 +681,62 @@ func (p * TFetchOrientation) Value() (driver.Value, error) { } return int64(*p), nil } +type TJobExecutionStatus int64 +const ( + TJobExecutionStatus_IN_PROGRESS TJobExecutionStatus = 0 + TJobExecutionStatus_COMPLETE TJobExecutionStatus = 1 + TJobExecutionStatus_NOT_AVAILABLE TJobExecutionStatus = 2 +) + +func (p TJobExecutionStatus) String() string { + switch p { + case TJobExecutionStatus_IN_PROGRESS: return "IN_PROGRESS" + case TJobExecutionStatus_COMPLETE: return "COMPLETE" + case TJobExecutionStatus_NOT_AVAILABLE: return "NOT_AVAILABLE" + } + return "" +} + +func TJobExecutionStatusFromString(s string) (TJobExecutionStatus, error) { + switch s { + case "IN_PROGRESS": return TJobExecutionStatus_IN_PROGRESS, nil + case "COMPLETE": return TJobExecutionStatus_COMPLETE, nil + case "NOT_AVAILABLE": return TJobExecutionStatus_NOT_AVAILABLE, nil + } + return TJobExecutionStatus(0), fmt.Errorf("not a valid TJobExecutionStatus string") +} + + +func TJobExecutionStatusPtr(v TJobExecutionStatus) *TJobExecutionStatus { return &v } + +func (p TJobExecutionStatus) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *TJobExecutionStatus) UnmarshalText(text []byte) error { +q, err := TJobExecutionStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *TJobExecutionStatus) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = TJobExecutionStatus(v) +return nil +} + +func (p * TJobExecutionStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} type TTypeEntryPtr int32 func TTypeEntryPtrPtr(v TTypeEntryPtr) *TTypeEntryPtr { return &v } @@ -726,14 +799,14 @@ func (p *TTypeQualifierValue) IsSetStringValue() bool { return p.StringValue != nil } -func (p *TTypeQualifierValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TTypeQualifierValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -741,41 +814,41 @@ func (p *TTypeQualifierValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TTypeQualifierValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TTypeQualifierValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.I32Value = &v @@ -783,8 +856,8 @@ func (p *TTypeQualifierValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TTypeQualifierValue) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TTypeQualifierValue) 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.StringValue = &v @@ -792,47 +865,68 @@ func (p *TTypeQualifierValue) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TTypeQualifierValue) Write(oprot thrift.TProtocol) error { +func (p *TTypeQualifierValue) Write(ctx context.Context, oprot thrift.TProtocol) error { if c := p.CountSetFieldsTTypeQualifierValue(); c != 1 { return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) } - if err := oprot.WriteStructBegin("TTypeQualifierValue"); err != nil { + if err := oprot.WriteStructBegin(ctx, "TTypeQualifierValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TTypeQualifierValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TTypeQualifierValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI32Value() { - if err := oprot.WriteFieldBegin("i32Value", thrift.I32, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i32Value", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:i32Value: ", p), err) } - if err := oprot.WriteI32(int32(*p.I32Value)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.I32Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.i32Value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:i32Value: ", p), err) } } return err } -func (p *TTypeQualifierValue) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TTypeQualifierValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stringValue: ", p), err) } - if err := oprot.WriteString(string(*p.StringValue)); err != nil { + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.stringValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stringValue: ", p), err) } } return err } +func (p *TTypeQualifierValue) Equals(other *TTypeQualifierValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.I32Value != other.I32Value { + if p.I32Value == nil || other.I32Value == nil { + return false + } + if (*p.I32Value) != (*other.I32Value) { return false } + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { return false } + } + return true +} + func (p *TTypeQualifierValue) String() string { if p == nil { return "" @@ -854,15 +948,15 @@ func NewTTypeQualifiers() *TTypeQualifiers { func (p *TTypeQualifiers) GetQualifiers() map[string]*TTypeQualifierValue { return p.Qualifiers } -func (p *TTypeQualifiers) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TTypeQualifiers) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetQualifiers bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -870,25 +964,25 @@ func (p *TTypeQualifiers) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.MAP { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetQualifiers = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetQualifiers{ @@ -897,8 +991,8 @@ func (p *TTypeQualifiers) Read(iprot thrift.TProtocol) error { return nil } -func (p *TTypeQualifiers) ReadField1(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TTypeQualifiers) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) if err != nil { return thrift.PrependError("error reading map begin: ", err) } @@ -906,57 +1000,71 @@ func (p *TTypeQualifiers) ReadField1(iprot thrift.TProtocol) error { p.Qualifiers = tMap for i := 0; i < size; i ++ { var _key0 string - if v, err := iprot.ReadString(); err != nil { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { _key0 = v } _val1 := &TTypeQualifierValue{} - if err := _val1.Read(iprot); err != nil { + if err := _val1.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val1), err) } p.Qualifiers[_key0] = _val1 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TTypeQualifiers) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TTypeQualifiers"); err != nil { +func (p *TTypeQualifiers) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TTypeQualifiers"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TTypeQualifiers) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("qualifiers", thrift.MAP, 1); err != nil { +func (p *TTypeQualifiers) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "qualifiers", thrift.MAP, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:qualifiers: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.Qualifiers)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Qualifiers { - if err := oprot.WriteString(string(k)); err != nil { + 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(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:qualifiers: ", p), err) } return err } +func (p *TTypeQualifiers) Equals(other *TTypeQualifiers) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Qualifiers) != len(other.Qualifiers) { return false } + for k, _tgt := range p.Qualifiers { + _src2 := other.Qualifiers[k] + if !_tgt.Equals(_src2) { return false } + } + return true +} + func (p *TTypeQualifiers) String() string { if p == nil { return "" @@ -991,15 +1099,15 @@ func (p *TPrimitiveTypeEntry) IsSetTypeQualifiers() bool { return p.TypeQualifiers != nil } -func (p *TPrimitiveTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TPrimitiveTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetType bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1007,35 +1115,35 @@ func (p *TPrimitiveTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetType = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetType{ @@ -1044,8 +1152,8 @@ func (p *TPrimitiveTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TPrimitiveTypeEntry) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TPrimitiveTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := TTypeId(v) @@ -1054,51 +1162,62 @@ func (p *TPrimitiveTypeEntry) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TPrimitiveTypeEntry) ReadField2(iprot thrift.TProtocol) error { +func (p *TPrimitiveTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.TypeQualifiers = &TTypeQualifiers{} - if err := p.TypeQualifiers.Read(iprot); err != nil { + if err := p.TypeQualifiers.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeQualifiers), err) } return nil } -func (p *TPrimitiveTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TPrimitiveTypeEntry"); err != nil { +func (p *TPrimitiveTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TPrimitiveTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TPrimitiveTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { +func (p *TPrimitiveTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } - if err := oprot.WriteI32(int32(p.Type)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } return err } -func (p *TPrimitiveTypeEntry) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TPrimitiveTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetTypeQualifiers() { - if err := oprot.WriteFieldBegin("typeQualifiers", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "typeQualifiers", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeQualifiers: ", p), err) } - if err := p.TypeQualifiers.Write(oprot); err != nil { + if err := p.TypeQualifiers.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeQualifiers), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeQualifiers: ", p), err) } } return err } +func (p *TPrimitiveTypeEntry) Equals(other *TPrimitiveTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if !p.TypeQualifiers.Equals(other.TypeQualifiers) { return false } + return true +} + func (p *TPrimitiveTypeEntry) String() string { if p == nil { return "" @@ -1120,15 +1239,15 @@ func NewTArrayTypeEntry() *TArrayTypeEntry { func (p *TArrayTypeEntry) GetObjectTypePtr() TTypeEntryPtr { return p.ObjectTypePtr } -func (p *TArrayTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TArrayTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetObjectTypePtr bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1136,25 +1255,25 @@ func (p *TArrayTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetObjectTypePtr = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetObjectTypePtr{ @@ -1163,8 +1282,8 @@ func (p *TArrayTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TArrayTypeEntry) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TArrayTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := TTypeEntryPtr(v) @@ -1173,29 +1292,39 @@ func (p *TArrayTypeEntry) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TArrayTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TArrayTypeEntry"); err != nil { +func (p *TArrayTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TArrayTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TArrayTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("objectTypePtr", thrift.I32, 1); err != nil { +func (p *TArrayTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "objectTypePtr", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:objectTypePtr: ", p), err) } - if err := oprot.WriteI32(int32(p.ObjectTypePtr)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.ObjectTypePtr)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.objectTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:objectTypePtr: ", p), err) } return err } +func (p *TArrayTypeEntry) Equals(other *TArrayTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ObjectTypePtr != other.ObjectTypePtr { return false } + return true +} + func (p *TArrayTypeEntry) String() string { if p == nil { return "" @@ -1223,8 +1352,8 @@ func (p *TMapTypeEntry) GetKeyTypePtr() TTypeEntryPtr { func (p *TMapTypeEntry) GetValueTypePtr() TTypeEntryPtr { return p.ValueTypePtr } -func (p *TMapTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TMapTypeEntry) 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) } @@ -1232,7 +1361,7 @@ func (p *TMapTypeEntry) Read(iprot thrift.TProtocol) error { var issetValueTypePtr bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1240,36 +1369,36 @@ func (p *TMapTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetKeyTypePtr = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetValueTypePtr = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetKeyTypePtr{ @@ -1281,8 +1410,8 @@ func (p *TMapTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TMapTypeEntry) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TMapTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := TTypeEntryPtr(v) @@ -1291,8 +1420,8 @@ func (p *TMapTypeEntry) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TMapTypeEntry) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TMapTypeEntry) 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 := TTypeEntryPtr(v) @@ -1301,40 +1430,51 @@ func (p *TMapTypeEntry) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TMapTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TMapTypeEntry"); err != nil { +func (p *TMapTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TMapTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TMapTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("keyTypePtr", thrift.I32, 1); err != nil { +func (p *TMapTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "keyTypePtr", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:keyTypePtr: ", p), err) } - if err := oprot.WriteI32(int32(p.KeyTypePtr)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.KeyTypePtr)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.keyTypePtr (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:keyTypePtr: ", p), err) } return err } -func (p *TMapTypeEntry) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("valueTypePtr", thrift.I32, 2); err != nil { +func (p *TMapTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "valueTypePtr", thrift.I32, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:valueTypePtr: ", p), err) } - if err := oprot.WriteI32(int32(p.ValueTypePtr)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.ValueTypePtr)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.valueTypePtr (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:valueTypePtr: ", p), err) } return err } +func (p *TMapTypeEntry) Equals(other *TMapTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.KeyTypePtr != other.KeyTypePtr { return false } + if p.ValueTypePtr != other.ValueTypePtr { return false } + return true +} + func (p *TMapTypeEntry) String() string { if p == nil { return "" @@ -1356,15 +1496,15 @@ func NewTStructTypeEntry() *TStructTypeEntry { func (p *TStructTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { return p.NameToTypePtr } -func (p *TStructTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TStructTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetNameToTypePtr bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1372,25 +1512,25 @@ func (p *TStructTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.MAP { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetNameToTypePtr = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetNameToTypePtr{ @@ -1399,68 +1539,82 @@ func (p *TStructTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TStructTypeEntry) ReadField1(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TStructTypeEntry) 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]TTypeEntryPtr, size) p.NameToTypePtr = tMap for i := 0; i < size; i ++ { -var _key2 string - if v, err := iprot.ReadString(); err != nil { +var _key3 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key2 = v + _key3 = v } -var _val3 TTypeEntryPtr - if v, err := iprot.ReadI32(); err != nil { +var _val4 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := TTypeEntryPtr(v) - _val3 = temp + _val4 = temp } - p.NameToTypePtr[_key2] = _val3 + p.NameToTypePtr[_key3] = _val4 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TStructTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TStructTypeEntry"); err != nil { +func (p *TStructTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TStructTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TStructTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nameToTypePtr", thrift.MAP, 1); err != nil { +func (p *TStructTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(string(k)); err != nil { + if err := oprot.WriteString(ctx, string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(int32(v)); err != nil { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } return err } +func (p *TStructTypeEntry) Equals(other *TStructTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } + for k, _tgt := range p.NameToTypePtr { + _src5 := other.NameToTypePtr[k] + if _tgt != _src5 { return false } + } + return true +} + func (p *TStructTypeEntry) String() string { if p == nil { return "" @@ -1482,15 +1636,15 @@ func NewTUnionTypeEntry() *TUnionTypeEntry { func (p *TUnionTypeEntry) GetNameToTypePtr() map[string]TTypeEntryPtr { return p.NameToTypePtr } -func (p *TUnionTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TUnionTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetNameToTypePtr bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1498,25 +1652,25 @@ func (p *TUnionTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.MAP { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetNameToTypePtr = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetNameToTypePtr{ @@ -1525,68 +1679,82 @@ func (p *TUnionTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TUnionTypeEntry) ReadField1(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TUnionTypeEntry) 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]TTypeEntryPtr, size) p.NameToTypePtr = tMap for i := 0; i < size; i ++ { -var _key4 string - if v, err := iprot.ReadString(); err != nil { +var _key6 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key4 = v + _key6 = v } -var _val5 TTypeEntryPtr - if v, err := iprot.ReadI32(); err != nil { +var _val7 TTypeEntryPtr + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := TTypeEntryPtr(v) - _val5 = temp + _val7 = temp } - p.NameToTypePtr[_key4] = _val5 + p.NameToTypePtr[_key6] = _val7 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TUnionTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TUnionTypeEntry"); err != nil { +func (p *TUnionTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TUnionTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TUnionTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nameToTypePtr", thrift.MAP, 1); err != nil { +func (p *TUnionTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nameToTypePtr", thrift.MAP, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nameToTypePtr: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.I32, len(p.NameToTypePtr)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.NameToTypePtr { - if err := oprot.WriteString(string(k)); err != nil { + if err := oprot.WriteString(ctx, string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteI32(int32(v)); err != nil { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nameToTypePtr: ", p), err) } return err } +func (p *TUnionTypeEntry) Equals(other *TUnionTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.NameToTypePtr) != len(other.NameToTypePtr) { return false } + for k, _tgt := range p.NameToTypePtr { + _src8 := other.NameToTypePtr[k] + if _tgt != _src8 { return false } + } + return true +} + func (p *TUnionTypeEntry) String() string { if p == nil { return "" @@ -1608,15 +1776,15 @@ func NewTUserDefinedTypeEntry() *TUserDefinedTypeEntry { func (p *TUserDefinedTypeEntry) GetTypeClassName() string { return p.TypeClassName } -func (p *TUserDefinedTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TUserDefinedTypeEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetTypeClassName bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1624,25 +1792,25 @@ func (p *TUserDefinedTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetTypeClassName = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetTypeClassName{ @@ -1651,8 +1819,8 @@ func (p *TUserDefinedTypeEntry) Read(iprot thrift.TProtocol) error { return nil } -func (p *TUserDefinedTypeEntry) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TUserDefinedTypeEntry) 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.TypeClassName = v @@ -1660,29 +1828,39 @@ func (p *TUserDefinedTypeEntry) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TUserDefinedTypeEntry) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TUserDefinedTypeEntry"); err != nil { +func (p *TUserDefinedTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TUserDefinedTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TUserDefinedTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("typeClassName", thrift.STRING, 1); err != nil { +func (p *TUserDefinedTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "typeClassName", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:typeClassName: ", p), err) } - if err := oprot.WriteString(string(p.TypeClassName)); err != nil { + if err := oprot.WriteString(ctx, string(p.TypeClassName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.typeClassName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:typeClassName: ", p), err) } return err } +func (p *TUserDefinedTypeEntry) Equals(other *TUserDefinedTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TypeClassName != other.TypeClassName { return false } + return true +} + func (p *TUserDefinedTypeEntry) String() string { if p == nil { return "" @@ -1800,14 +1978,14 @@ func (p *TTypeEntry) IsSetUserDefinedTypeEntry() bool { return p.UserDefinedTypeEntry != nil } -func (p *TTypeEntry) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TTypeEntry) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -1815,226 +1993,241 @@ func (p *TTypeEntry) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TTypeEntry) ReadField1(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.PrimitiveEntry = &TPrimitiveTypeEntry{} - if err := p.PrimitiveEntry.Read(iprot); err != nil { + if err := p.PrimitiveEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PrimitiveEntry), err) } return nil } -func (p *TTypeEntry) ReadField2(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.ArrayEntry = &TArrayTypeEntry{} - if err := p.ArrayEntry.Read(iprot); err != nil { + if err := p.ArrayEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ArrayEntry), err) } return nil } -func (p *TTypeEntry) ReadField3(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { p.MapEntry = &TMapTypeEntry{} - if err := p.MapEntry.Read(iprot); err != nil { + if err := p.MapEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MapEntry), err) } return nil } -func (p *TTypeEntry) ReadField4(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { p.StructEntry = &TStructTypeEntry{} - if err := p.StructEntry.Read(iprot); err != nil { + if err := p.StructEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StructEntry), err) } return nil } -func (p *TTypeEntry) ReadField5(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { p.UnionEntry = &TUnionTypeEntry{} - if err := p.UnionEntry.Read(iprot); err != nil { + if err := p.UnionEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UnionEntry), err) } return nil } -func (p *TTypeEntry) ReadField6(iprot thrift.TProtocol) error { +func (p *TTypeEntry) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { p.UserDefinedTypeEntry = &TUserDefinedTypeEntry{} - if err := p.UserDefinedTypeEntry.Read(iprot); err != nil { + if err := p.UserDefinedTypeEntry.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UserDefinedTypeEntry), err) } return nil } -func (p *TTypeEntry) Write(oprot thrift.TProtocol) error { +func (p *TTypeEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { if c := p.CountSetFieldsTTypeEntry(); c != 1 { return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) } - if err := oprot.WriteStructBegin("TTypeEntry"); err != nil { + if err := oprot.WriteStructBegin(ctx, "TTypeEntry"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := p.writeField6(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TTypeEntry) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetPrimitiveEntry() { - if err := oprot.WriteFieldBegin("primitiveEntry", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "primitiveEntry", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:primitiveEntry: ", p), err) } - if err := p.PrimitiveEntry.Write(oprot); err != nil { + if err := p.PrimitiveEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PrimitiveEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:primitiveEntry: ", p), err) } } return err } -func (p *TTypeEntry) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetArrayEntry() { - if err := oprot.WriteFieldBegin("arrayEntry", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "arrayEntry", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:arrayEntry: ", p), err) } - if err := p.ArrayEntry.Write(oprot); err != nil { + if err := p.ArrayEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ArrayEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:arrayEntry: ", p), err) } } return err } -func (p *TTypeEntry) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetMapEntry() { - if err := oprot.WriteFieldBegin("mapEntry", thrift.STRUCT, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "mapEntry", thrift.STRUCT, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mapEntry: ", p), err) } - if err := p.MapEntry.Write(oprot); err != nil { + if err := p.MapEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MapEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mapEntry: ", p), err) } } return err } -func (p *TTypeEntry) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetStructEntry() { - if err := oprot.WriteFieldBegin("structEntry", thrift.STRUCT, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "structEntry", thrift.STRUCT, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:structEntry: ", p), err) } - if err := p.StructEntry.Write(oprot); err != nil { + if err := p.StructEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StructEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:structEntry: ", p), err) } } return err } -func (p *TTypeEntry) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetUnionEntry() { - if err := oprot.WriteFieldBegin("unionEntry", thrift.STRUCT, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "unionEntry", thrift.STRUCT, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:unionEntry: ", p), err) } - if err := p.UnionEntry.Write(oprot); err != nil { + if err := p.UnionEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UnionEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:unionEntry: ", p), err) } } return err } -func (p *TTypeEntry) writeField6(oprot thrift.TProtocol) (err error) { +func (p *TTypeEntry) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetUserDefinedTypeEntry() { - if err := oprot.WriteFieldBegin("userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { + if err := oprot.WriteFieldBegin(ctx, "userDefinedTypeEntry", thrift.STRUCT, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:userDefinedTypeEntry: ", p), err) } - if err := p.UserDefinedTypeEntry.Write(oprot); err != nil { + if err := p.UserDefinedTypeEntry.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UserDefinedTypeEntry), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:userDefinedTypeEntry: ", p), err) } } return err } +func (p *TTypeEntry) Equals(other *TTypeEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.PrimitiveEntry.Equals(other.PrimitiveEntry) { return false } + if !p.ArrayEntry.Equals(other.ArrayEntry) { return false } + if !p.MapEntry.Equals(other.MapEntry) { return false } + if !p.StructEntry.Equals(other.StructEntry) { return false } + if !p.UnionEntry.Equals(other.UnionEntry) { return false } + if !p.UserDefinedTypeEntry.Equals(other.UserDefinedTypeEntry) { return false } + return true +} + func (p *TTypeEntry) String() string { if p == nil { return "" @@ -2056,15 +2249,15 @@ func NewTTypeDesc() *TTypeDesc { func (p *TTypeDesc) GetTypes() []*TTypeEntry { return p.Types } -func (p *TTypeDesc) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TTypeDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetTypes bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2072,25 +2265,25 @@ func (p *TTypeDesc) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetTypes = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetTypes{ @@ -2099,58 +2292,72 @@ func (p *TTypeDesc) Read(iprot thrift.TProtocol) error { return nil } -func (p *TTypeDesc) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TTypeDesc) 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([]*TTypeEntry, 0, size) p.Types = tSlice for i := 0; i < size; i ++ { - _elem6 := &TTypeEntry{} - if err := _elem6.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem6), err) + _elem9 := &TTypeEntry{} + if err := _elem9.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) } - p.Types = append(p.Types, _elem6) + p.Types = append(p.Types, _elem9) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TTypeDesc) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TTypeDesc"); err != nil { +func (p *TTypeDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TTypeDesc"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TTypeDesc) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("types", thrift.LIST, 1); err != nil { +func (p *TTypeDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "types", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:types: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Types)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Types)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Types { - if err := v.Write(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:types: ", p), err) } return err } +func (p *TTypeDesc) Equals(other *TTypeDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Types) != len(other.Types) { return false } + for i, _tgt := range p.Types { + _src10 := other.Types[i] + if !_tgt.Equals(_src10) { return false } + } + return true +} + func (p *TTypeDesc) String() string { if p == nil { return "" @@ -2204,8 +2411,8 @@ func (p *TColumnDesc) IsSetComment() bool { return p.Comment != nil } -func (p *TColumnDesc) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TColumnDesc) 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) } @@ -2214,7 +2421,7 @@ func (p *TColumnDesc) Read(iprot thrift.TProtocol) error { var issetPosition bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2222,57 +2429,57 @@ func (p *TColumnDesc) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetColumnName = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetTypeDesc = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.I32 { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } issetPosition = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetColumnName{ @@ -2287,8 +2494,8 @@ func (p *TColumnDesc) Read(iprot thrift.TProtocol) error { return nil } -func (p *TColumnDesc) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TColumnDesc) 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.ColumnName = v @@ -2296,16 +2503,16 @@ func (p *TColumnDesc) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TColumnDesc) ReadField2(iprot thrift.TProtocol) error { +func (p *TColumnDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.TypeDesc = &TTypeDesc{} - if err := p.TypeDesc.Read(iprot); err != nil { + if err := p.TypeDesc.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TypeDesc), err) } return nil } -func (p *TColumnDesc) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TColumnDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { p.Position = v @@ -2313,8 +2520,8 @@ func (p *TColumnDesc) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TColumnDesc) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TColumnDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { p.Comment = &v @@ -2322,65 +2529,83 @@ func (p *TColumnDesc) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TColumnDesc) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TColumnDesc"); err != nil { +func (p *TColumnDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TColumnDesc"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TColumnDesc) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("columnName", thrift.STRING, 1); err != nil { +func (p *TColumnDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columnName: ", p), err) } - if err := oprot.WriteString(string(p.ColumnName)); err != nil { + if err := oprot.WriteString(ctx, string(p.ColumnName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.columnName (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columnName: ", p), err) } return err } -func (p *TColumnDesc) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("typeDesc", thrift.STRUCT, 2); err != nil { +func (p *TColumnDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "typeDesc", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:typeDesc: ", p), err) } - if err := p.TypeDesc.Write(oprot); err != nil { + if err := p.TypeDesc.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TypeDesc), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:typeDesc: ", p), err) } return err } -func (p *TColumnDesc) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("position", thrift.I32, 3); err != nil { +func (p *TColumnDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "position", thrift.I32, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:position: ", p), err) } - if err := oprot.WriteI32(int32(p.Position)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.Position)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.position (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:position: ", p), err) } return err } -func (p *TColumnDesc) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TColumnDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetComment() { - if err := oprot.WriteFieldBegin("comment", thrift.STRING, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:comment: ", p), err) } - if err := oprot.WriteString(string(*p.Comment)); err != nil { + if err := oprot.WriteString(ctx, string(*p.Comment)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.comment (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:comment: ", p), err) } } return err } +func (p *TColumnDesc) Equals(other *TColumnDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ColumnName != other.ColumnName { return false } + if !p.TypeDesc.Equals(other.TypeDesc) { return false } + if p.Position != other.Position { return false } + if p.Comment != other.Comment { + if p.Comment == nil || other.Comment == nil { + return false + } + if (*p.Comment) != (*other.Comment) { return false } + } + return true +} + func (p *TColumnDesc) String() string { if p == nil { return "" @@ -2402,15 +2627,15 @@ func NewTTableSchema() *TTableSchema { func (p *TTableSchema) GetColumns() []*TColumnDesc { return p.Columns } -func (p *TTableSchema) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TTableSchema) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetColumns bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2418,25 +2643,25 @@ func (p *TTableSchema) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetColumns = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetColumns{ @@ -2445,58 +2670,72 @@ func (p *TTableSchema) Read(iprot thrift.TProtocol) error { return nil } -func (p *TTableSchema) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TTableSchema) 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([]*TColumnDesc, 0, size) p.Columns = tSlice for i := 0; i < size; i ++ { - _elem7 := &TColumnDesc{} - if err := _elem7.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + _elem11 := &TColumnDesc{} + if err := _elem11.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) } - p.Columns = append(p.Columns, _elem7) + p.Columns = append(p.Columns, _elem11) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TTableSchema) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TTableSchema"); err != nil { +func (p *TTableSchema) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TTableSchema"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TTableSchema) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { +func (p *TTableSchema) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + 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(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TTableSchema) Equals(other *TTableSchema) 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 { + _src12 := other.Columns[i] + if !_tgt.Equals(_src12) { return false } + } + return true +} + func (p *TTableSchema) String() string { if p == nil { return "" @@ -2525,14 +2764,14 @@ func (p *TBoolValue) IsSetValue() bool { return p.Value != nil } -func (p *TBoolValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TBoolValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2540,31 +2779,31 @@ func (p *TBoolValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.BOOL { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TBoolValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *TBoolValue) 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.Value = &v @@ -2572,31 +2811,46 @@ func (p *TBoolValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TBoolValue) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TBoolValue"); err != nil { +func (p *TBoolValue) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TBoolValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TBoolValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TBoolValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.BOOL, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BOOL, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteBool(bool(*p.Value)); err != nil { + if err := oprot.WriteBool(ctx, bool(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TBoolValue) Equals(other *TBoolValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TBoolValue) String() string { if p == nil { return "" @@ -2625,14 +2879,14 @@ func (p *TByteValue) IsSetValue() bool { return p.Value != nil } -func (p *TByteValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TByteValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2640,31 +2894,31 @@ func (p *TByteValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.BYTE { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TByteValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadByte(); err != nil { +func (p *TByteValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := int8(v) @@ -2673,31 +2927,46 @@ func (p *TByteValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TByteValue) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TByteValue"); err != nil { +func (p *TByteValue) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TByteValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TByteValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TByteValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.BYTE, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.BYTE, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteByte(int8(*p.Value)); err != nil { + if err := oprot.WriteByte(ctx, int8(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TByteValue) Equals(other *TByteValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TByteValue) String() string { if p == nil { return "" @@ -2726,14 +2995,14 @@ func (p *TI16Value) IsSetValue() bool { return p.Value != nil } -func (p *TI16Value) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI16Value) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2741,31 +3010,31 @@ func (p *TI16Value) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I16 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TI16Value) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(); err != nil { +func (p *TI16Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Value = &v @@ -2773,31 +3042,46 @@ func (p *TI16Value) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TI16Value) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI16Value"); err != nil { +func (p *TI16Value) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI16Value"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI16Value) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TI16Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.I16, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I16, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI16(int16(*p.Value)); err != nil { + if err := oprot.WriteI16(ctx, int16(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TI16Value) Equals(other *TI16Value) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TI16Value) String() string { if p == nil { return "" @@ -2826,14 +3110,14 @@ func (p *TI32Value) IsSetValue() bool { return p.Value != nil } -func (p *TI32Value) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI32Value) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2841,31 +3125,31 @@ func (p *TI32Value) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TI32Value) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TI32Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Value = &v @@ -2873,31 +3157,46 @@ func (p *TI32Value) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TI32Value) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI32Value"); err != nil { +func (p *TI32Value) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI32Value"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI32Value) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TI32Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.I32, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI32(int32(*p.Value)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TI32Value) Equals(other *TI32Value) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TI32Value) String() string { if p == nil { return "" @@ -2926,14 +3225,14 @@ func (p *TI64Value) IsSetValue() bool { return p.Value != nil } -func (p *TI64Value) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI64Value) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -2941,31 +3240,31 @@ func (p *TI64Value) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I64 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TI64Value) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *TI64Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Value = &v @@ -2973,31 +3272,46 @@ func (p *TI64Value) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TI64Value) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI64Value"); err != nil { +func (p *TI64Value) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI64Value"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI64Value) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TI64Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.I64, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteI64(int64(*p.Value)); err != nil { + if err := oprot.WriteI64(ctx, int64(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TI64Value) Equals(other *TI64Value) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TI64Value) String() string { if p == nil { return "" @@ -3026,14 +3340,14 @@ func (p *TDoubleValue) IsSetValue() bool { return p.Value != nil } -func (p *TDoubleValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TDoubleValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3041,31 +3355,31 @@ func (p *TDoubleValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TDoubleValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { +func (p *TDoubleValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.Value = &v @@ -3073,31 +3387,46 @@ func (p *TDoubleValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TDoubleValue) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TDoubleValue"); err != nil { +func (p *TDoubleValue) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TDoubleValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TDoubleValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TDoubleValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.DOUBLE, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.DOUBLE, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteDouble(float64(*p.Value)); err != nil { + if err := oprot.WriteDouble(ctx, float64(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TDoubleValue) Equals(other *TDoubleValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TDoubleValue) String() string { if p == nil { return "" @@ -3126,14 +3455,14 @@ func (p *TStringValue) IsSetValue() bool { return p.Value != nil } -func (p *TStringValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TStringValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3141,31 +3470,31 @@ func (p *TStringValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TStringValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TStringValue) 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.Value = &v @@ -3173,31 +3502,46 @@ func (p *TStringValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TStringValue) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TStringValue"); err != nil { +func (p *TStringValue) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TStringValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TStringValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TStringValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetValue() { - if err := oprot.WriteFieldBegin("value", thrift.STRING, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:value: ", p), err) } - if err := oprot.WriteString(string(*p.Value)); err != nil { + if err := oprot.WriteString(ctx, string(*p.Value)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.value (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + 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 *TStringValue) Equals(other *TStringValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Value != other.Value { + if p.Value == nil || other.Value == nil { + return false + } + if (*p.Value) != (*other.Value) { return false } + } + return true +} + func (p *TStringValue) String() string { if p == nil { return "" @@ -3331,14 +3675,14 @@ func (p *TColumnValue) IsSetStringVal() bool { return p.StringVal != nil } -func (p *TColumnValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TColumnValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3346,258 +3690,274 @@ func (p *TColumnValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 7: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(iprot); err != nil { + if err := p.ReadField7(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TColumnValue) ReadField1(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.BoolVal = &TBoolValue{} - if err := p.BoolVal.Read(iprot); err != nil { + if err := p.BoolVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) } return nil } -func (p *TColumnValue) ReadField2(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.ByteVal = &TByteValue{} - if err := p.ByteVal.Read(iprot); err != nil { + if err := p.ByteVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) } return nil } -func (p *TColumnValue) ReadField3(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { p.I16Val = &TI16Value{} - if err := p.I16Val.Read(iprot); err != nil { + if err := p.I16Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) } return nil } -func (p *TColumnValue) ReadField4(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { p.I32Val = &TI32Value{} - if err := p.I32Val.Read(iprot); err != nil { + if err := p.I32Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) } return nil } -func (p *TColumnValue) ReadField5(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { p.I64Val = &TI64Value{} - if err := p.I64Val.Read(iprot); err != nil { + if err := p.I64Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) } return nil } -func (p *TColumnValue) ReadField6(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { p.DoubleVal = &TDoubleValue{} - if err := p.DoubleVal.Read(iprot); err != nil { + if err := p.DoubleVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) } return nil } -func (p *TColumnValue) ReadField7(iprot thrift.TProtocol) error { +func (p *TColumnValue) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { p.StringVal = &TStringValue{} - if err := p.StringVal.Read(iprot); err != nil { + if err := p.StringVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) } return nil } -func (p *TColumnValue) Write(oprot thrift.TProtocol) error { +func (p *TColumnValue) Write(ctx context.Context, oprot thrift.TProtocol) error { if c := p.CountSetFieldsTColumnValue(); c != 1 { return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) } - if err := oprot.WriteStructBegin("TColumnValue"); err != nil { + if err := oprot.WriteStructBegin(ctx, "TColumnValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := p.writeField6(oprot); err != nil { return err } - if err := p.writeField7(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != 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(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TColumnValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin("boolVal", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } - if err := p.BoolVal.Write(oprot); err != nil { + if err := p.BoolVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } } return err } -func (p *TColumnValue) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin("byteVal", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } - if err := p.ByteVal.Write(oprot); err != nil { + if err := p.ByteVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } } return err } -func (p *TColumnValue) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin("i16Val", thrift.STRUCT, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } - if err := p.I16Val.Write(oprot); err != nil { + if err := p.I16Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } } return err } -func (p *TColumnValue) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin("i32Val", thrift.STRUCT, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } - if err := p.I32Val.Write(oprot); err != nil { + if err := p.I32Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } } return err } -func (p *TColumnValue) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin("i64Val", thrift.STRUCT, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } - if err := p.I64Val.Write(oprot); err != nil { + if err := p.I64Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } } return err } -func (p *TColumnValue) writeField6(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin("doubleVal", thrift.STRUCT, 6); err != nil { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } - if err := p.DoubleVal.Write(oprot); err != nil { + if err := p.DoubleVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } } return err } -func (p *TColumnValue) writeField7(oprot thrift.TProtocol) (err error) { +func (p *TColumnValue) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin("stringVal", thrift.STRUCT, 7); err != nil { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } - if err := p.StringVal.Write(oprot); err != nil { + if err := p.StringVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } } return err } +func (p *TColumnValue) Equals(other *TColumnValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { return false } + if !p.ByteVal.Equals(other.ByteVal) { return false } + if !p.I16Val.Equals(other.I16Val) { return false } + if !p.I32Val.Equals(other.I32Val) { return false } + if !p.I64Val.Equals(other.I64Val) { return false } + if !p.DoubleVal.Equals(other.DoubleVal) { return false } + if !p.StringVal.Equals(other.StringVal) { return false } + return true +} + func (p *TColumnValue) String() string { if p == nil { return "" @@ -3619,15 +3979,15 @@ func NewTRow() *TRow { func (p *TRow) GetColVals() []*TColumnValue { return p.ColVals } -func (p *TRow) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TRow) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetColVals bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3635,25 +3995,25 @@ func (p *TRow) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetColVals = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetColVals{ @@ -3662,58 +4022,72 @@ func (p *TRow) Read(iprot thrift.TProtocol) error { return nil } -func (p *TRow) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TRow) 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([]*TColumnValue, 0, size) p.ColVals = tSlice for i := 0; i < size; i ++ { - _elem8 := &TColumnValue{} - if err := _elem8.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem8), err) + _elem13 := &TColumnValue{} + if err := _elem13.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) } - p.ColVals = append(p.ColVals, _elem8) + p.ColVals = append(p.ColVals, _elem13) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TRow) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TRow"); err != nil { +func (p *TRow) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TRow"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TRow) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("colVals", thrift.LIST, 1); err != nil { +func (p *TRow) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "colVals", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:colVals: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColVals)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ColVals)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.ColVals { - if err := v.Write(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:colVals: ", p), err) } return err } +func (p *TRow) Equals(other *TRow) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.ColVals) != len(other.ColVals) { return false } + for i, _tgt := range p.ColVals { + _src14 := other.ColVals[i] + if !_tgt.Equals(_src14) { return false } + } + return true +} + func (p *TRow) String() string { if p == nil { return "" @@ -3741,8 +4115,8 @@ func (p *TBoolColumn) GetValues() []bool { func (p *TBoolColumn) GetNulls() []byte { return p.Nulls } -func (p *TBoolColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TBoolColumn) 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) } @@ -3750,7 +4124,7 @@ func (p *TBoolColumn) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3758,36 +4132,36 @@ func (p *TBoolColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -3799,30 +4173,30 @@ func (p *TBoolColumn) Read(iprot thrift.TProtocol) error { return nil } -func (p *TBoolColumn) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TBoolColumn) 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.Values = tSlice for i := 0; i < size; i ++ { -var _elem9 bool - if v, err := iprot.ReadBool(); err != nil { +var _elem15 bool + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem9 = v + _elem15 = v } - p.Values = append(p.Values, _elem9) + p.Values = append(p.Values, _elem15) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TBoolColumn) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TBoolColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -3830,48 +4204,63 @@ func (p *TBoolColumn) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TBoolColumn) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TBoolColumn"); err != nil { +func (p *TBoolColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TBoolColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TBoolColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TBoolColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.BOOL, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.BOOL, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteBool(bool(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TBoolColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TBoolColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TBoolColumn) Equals(other *TBoolColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src16 := other.Values[i] + if _tgt != _src16 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TBoolColumn) String() string { if p == nil { return "" @@ -3899,8 +4288,8 @@ func (p *TByteColumn) GetValues() []int8 { func (p *TByteColumn) GetNulls() []byte { return p.Nulls } -func (p *TByteColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TByteColumn) 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) } @@ -3908,7 +4297,7 @@ func (p *TByteColumn) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -3916,36 +4305,36 @@ func (p *TByteColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -3957,31 +4346,31 @@ func (p *TByteColumn) Read(iprot thrift.TProtocol) error { return nil } -func (p *TByteColumn) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TByteColumn) 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([]int8, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem10 int8 - if v, err := iprot.ReadByte(); err != nil { +var _elem17 int8 + if v, err := iprot.ReadByte(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { temp := int8(v) - _elem10 = temp + _elem17 = temp } - p.Values = append(p.Values, _elem10) + p.Values = append(p.Values, _elem17) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TByteColumn) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TByteColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -3989,48 +4378,63 @@ func (p *TByteColumn) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TByteColumn) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TByteColumn"); err != nil { +func (p *TByteColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TByteColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TByteColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TByteColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.BYTE, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.BYTE, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteByte(int8(v)); err != nil { + if err := oprot.WriteByte(ctx, int8(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TByteColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TByteColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TByteColumn) Equals(other *TByteColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src18 := other.Values[i] + if _tgt != _src18 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TByteColumn) String() string { if p == nil { return "" @@ -4058,8 +4462,8 @@ func (p *TI16Column) GetValues() []int16 { func (p *TI16Column) GetNulls() []byte { return p.Nulls } -func (p *TI16Column) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI16Column) 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) } @@ -4067,7 +4471,7 @@ func (p *TI16Column) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4075,36 +4479,36 @@ func (p *TI16Column) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4116,30 +4520,30 @@ func (p *TI16Column) Read(iprot thrift.TProtocol) error { return nil } -func (p *TI16Column) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TI16Column) 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([]int16, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem11 int16 - if v, err := iprot.ReadI16(); err != nil { +var _elem19 int16 + if v, err := iprot.ReadI16(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem11 = v + _elem19 = v } - p.Values = append(p.Values, _elem11) + p.Values = append(p.Values, _elem19) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TI16Column) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TI16Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4147,48 +4551,63 @@ func (p *TI16Column) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TI16Column) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI16Column"); err != nil { +func (p *TI16Column) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI16Column"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI16Column) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TI16Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.I16, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.I16, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteI16(int16(v)); err != nil { + if err := oprot.WriteI16(ctx, int16(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TI16Column) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TI16Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TI16Column) Equals(other *TI16Column) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src20 := other.Values[i] + if _tgt != _src20 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TI16Column) String() string { if p == nil { return "" @@ -4216,8 +4635,8 @@ func (p *TI32Column) GetValues() []int32 { func (p *TI32Column) GetNulls() []byte { return p.Nulls } -func (p *TI32Column) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI32Column) 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) } @@ -4225,7 +4644,7 @@ func (p *TI32Column) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4233,36 +4652,36 @@ func (p *TI32Column) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4274,30 +4693,30 @@ func (p *TI32Column) Read(iprot thrift.TProtocol) error { return nil } -func (p *TI32Column) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TI32Column) 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([]int32, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem12 int32 - if v, err := iprot.ReadI32(); err != nil { +var _elem21 int32 + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem12 = v + _elem21 = v } - p.Values = append(p.Values, _elem12) + p.Values = append(p.Values, _elem21) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TI32Column) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TI32Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4305,48 +4724,63 @@ func (p *TI32Column) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TI32Column) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI32Column"); err != nil { +func (p *TI32Column) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI32Column"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI32Column) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TI32Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteI32(int32(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TI32Column) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TI32Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TI32Column) Equals(other *TI32Column) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src22 := other.Values[i] + if _tgt != _src22 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TI32Column) String() string { if p == nil { return "" @@ -4374,8 +4808,8 @@ func (p *TI64Column) GetValues() []int64 { func (p *TI64Column) GetNulls() []byte { return p.Nulls } -func (p *TI64Column) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TI64Column) 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) } @@ -4383,7 +4817,7 @@ func (p *TI64Column) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4391,36 +4825,36 @@ func (p *TI64Column) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4432,30 +4866,30 @@ func (p *TI64Column) Read(iprot thrift.TProtocol) error { return nil } -func (p *TI64Column) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TI64Column) 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([]int64, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem13 int64 - if v, err := iprot.ReadI64(); err != nil { +var _elem23 int64 + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem13 = v + _elem23 = v } - p.Values = append(p.Values, _elem13) + p.Values = append(p.Values, _elem23) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TI64Column) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TI64Column) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4463,48 +4897,63 @@ func (p *TI64Column) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TI64Column) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TI64Column"); err != nil { +func (p *TI64Column) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TI64Column"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TI64Column) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TI64Column) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.I64, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteI64(int64(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TI64Column) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TI64Column) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TI64Column) Equals(other *TI64Column) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src24 := other.Values[i] + if _tgt != _src24 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TI64Column) String() string { if p == nil { return "" @@ -4532,8 +4981,8 @@ func (p *TDoubleColumn) GetValues() []float64 { func (p *TDoubleColumn) GetNulls() []byte { return p.Nulls } -func (p *TDoubleColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TDoubleColumn) 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) } @@ -4541,7 +4990,7 @@ func (p *TDoubleColumn) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4549,36 +4998,36 @@ func (p *TDoubleColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4590,30 +5039,30 @@ func (p *TDoubleColumn) Read(iprot thrift.TProtocol) error { return nil } -func (p *TDoubleColumn) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TDoubleColumn) 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([]float64, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem14 float64 - if v, err := iprot.ReadDouble(); err != nil { +var _elem25 float64 + if v, err := iprot.ReadDouble(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem14 = v + _elem25 = v } - p.Values = append(p.Values, _elem14) + p.Values = append(p.Values, _elem25) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TDoubleColumn) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TDoubleColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4621,48 +5070,63 @@ func (p *TDoubleColumn) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TDoubleColumn) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TDoubleColumn"); err != nil { +func (p *TDoubleColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TDoubleColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TDoubleColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TDoubleColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.DOUBLE, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.DOUBLE, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteDouble(float64(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TDoubleColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TDoubleColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TDoubleColumn) Equals(other *TDoubleColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src26 := other.Values[i] + if _tgt != _src26 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TDoubleColumn) String() string { if p == nil { return "" @@ -4690,8 +5154,8 @@ func (p *TStringColumn) GetValues() []string { func (p *TStringColumn) GetNulls() []byte { return p.Nulls } -func (p *TStringColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TStringColumn) 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) } @@ -4699,7 +5163,7 @@ func (p *TStringColumn) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4707,36 +5171,36 @@ func (p *TStringColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4748,30 +5212,30 @@ func (p *TStringColumn) Read(iprot thrift.TProtocol) error { return nil } -func (p *TStringColumn) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TStringColumn) 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([]string, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem15 string - if v, err := iprot.ReadString(); err != nil { +var _elem27 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem15 = v + _elem27 = v } - p.Values = append(p.Values, _elem15) + p.Values = append(p.Values, _elem27) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TStringColumn) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TStringColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4779,48 +5243,63 @@ func (p *TStringColumn) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TStringColumn) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TStringColumn"); err != nil { +func (p *TStringColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TStringColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TStringColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TStringColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteString(string(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TStringColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TStringColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TStringColumn) Equals(other *TStringColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src28 := other.Values[i] + if _tgt != _src28 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TStringColumn) String() string { if p == nil { return "" @@ -4848,8 +5327,8 @@ func (p *TBinaryColumn) GetValues() [][]byte { func (p *TBinaryColumn) GetNulls() []byte { return p.Nulls } -func (p *TBinaryColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TBinaryColumn) 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) } @@ -4857,7 +5336,7 @@ func (p *TBinaryColumn) Read(iprot thrift.TProtocol) error { var issetNulls bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -4865,36 +5344,36 @@ func (p *TBinaryColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.LIST { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetValues = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetNulls = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetValues{ @@ -4906,30 +5385,30 @@ func (p *TBinaryColumn) Read(iprot thrift.TProtocol) error { return nil } -func (p *TBinaryColumn) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TBinaryColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) if err != nil { return thrift.PrependError("error reading list begin: ", err) } tSlice := make([][]byte, 0, size) p.Values = tSlice for i := 0; i < size; i ++ { -var _elem16 []byte - if v, err := iprot.ReadBinary(); err != nil { +var _elem29 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem16 = v + _elem29 = v } - p.Values = append(p.Values, _elem16) + p.Values = append(p.Values, _elem29) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TBinaryColumn) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *TBinaryColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Nulls = v @@ -4937,48 +5416,63 @@ func (p *TBinaryColumn) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TBinaryColumn) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TBinaryColumn"); err != nil { +func (p *TBinaryColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TBinaryColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TBinaryColumn) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("values", thrift.LIST, 1); err != nil { +func (p *TBinaryColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Values)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Values)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Values { - if err := oprot.WriteBinary(v); err != nil { + if err := oprot.WriteBinary(ctx, v); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } return err } -func (p *TBinaryColumn) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("nulls", thrift.STRING, 2); err != nil { +func (p *TBinaryColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nulls", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nulls: ", p), err) } - if err := oprot.WriteBinary(p.Nulls); err != nil { + if err := oprot.WriteBinary(ctx, p.Nulls); err != nil { return thrift.PrependError(fmt.Sprintf("%T.nulls (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nulls: ", p), err) } return err } +func (p *TBinaryColumn) Equals(other *TBinaryColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src30 := other.Values[i] + if bytes.Compare(_tgt, _src30) != 0 { return false } + } + if bytes.Compare(p.Nulls, other.Nulls) != 0 { return false } + return true +} + func (p *TBinaryColumn) String() string { if p == nil { return "" @@ -5128,14 +5622,14 @@ func (p *TColumn) IsSetBinaryVal() bool { return p.BinaryVal != nil } -func (p *TColumn) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TColumn) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -5143,290 +5637,307 @@ func (p *TColumn) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 7: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField7(iprot); err != nil { + if err := p.ReadField7(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 8: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField8(iprot); err != nil { + if err := p.ReadField8(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TColumn) ReadField1(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.BoolVal = &TBoolColumn{} - if err := p.BoolVal.Read(iprot); err != nil { + if err := p.BoolVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BoolVal), err) } return nil } -func (p *TColumn) ReadField2(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.ByteVal = &TByteColumn{} - if err := p.ByteVal.Read(iprot); err != nil { + if err := p.ByteVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ByteVal), err) } return nil } -func (p *TColumn) ReadField3(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { p.I16Val = &TI16Column{} - if err := p.I16Val.Read(iprot); err != nil { + if err := p.I16Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I16Val), err) } return nil } -func (p *TColumn) ReadField4(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { p.I32Val = &TI32Column{} - if err := p.I32Val.Read(iprot); err != nil { + if err := p.I32Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I32Val), err) } return nil } -func (p *TColumn) ReadField5(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { p.I64Val = &TI64Column{} - if err := p.I64Val.Read(iprot); err != nil { + if err := p.I64Val.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.I64Val), err) } return nil } -func (p *TColumn) ReadField6(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { p.DoubleVal = &TDoubleColumn{} - if err := p.DoubleVal.Read(iprot); err != nil { + if err := p.DoubleVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DoubleVal), err) } return nil } -func (p *TColumn) ReadField7(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { p.StringVal = &TStringColumn{} - if err := p.StringVal.Read(iprot); err != nil { + if err := p.StringVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StringVal), err) } return nil } -func (p *TColumn) ReadField8(iprot thrift.TProtocol) error { +func (p *TColumn) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { p.BinaryVal = &TBinaryColumn{} - if err := p.BinaryVal.Read(iprot); err != nil { + if err := p.BinaryVal.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BinaryVal), err) } return nil } -func (p *TColumn) Write(oprot thrift.TProtocol) error { +func (p *TColumn) Write(ctx context.Context, oprot thrift.TProtocol) error { if c := p.CountSetFieldsTColumn(); c != 1 { return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) } - if err := oprot.WriteStructBegin("TColumn"); err != nil { + if err := oprot.WriteStructBegin(ctx, "TColumn"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := p.writeField6(oprot); err != nil { return err } - if err := p.writeField7(oprot); err != nil { return err } - if err := p.writeField8(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + 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 := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TColumn) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetBoolVal() { - if err := oprot.WriteFieldBegin("boolVal", thrift.STRUCT, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "boolVal", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:boolVal: ", p), err) } - if err := p.BoolVal.Write(oprot); err != nil { + if err := p.BoolVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BoolVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:boolVal: ", p), err) } } return err } -func (p *TColumn) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetByteVal() { - if err := oprot.WriteFieldBegin("byteVal", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "byteVal", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:byteVal: ", p), err) } - if err := p.ByteVal.Write(oprot); err != nil { + if err := p.ByteVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ByteVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:byteVal: ", p), err) } } return err } -func (p *TColumn) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI16Val() { - if err := oprot.WriteFieldBegin("i16Val", thrift.STRUCT, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i16Val", thrift.STRUCT, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:i16Val: ", p), err) } - if err := p.I16Val.Write(oprot); err != nil { + if err := p.I16Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I16Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:i16Val: ", p), err) } } return err } -func (p *TColumn) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI32Val() { - if err := oprot.WriteFieldBegin("i32Val", thrift.STRUCT, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i32Val", thrift.STRUCT, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:i32Val: ", p), err) } - if err := p.I32Val.Write(oprot); err != nil { + if err := p.I32Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I32Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:i32Val: ", p), err) } } return err } -func (p *TColumn) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetI64Val() { - if err := oprot.WriteFieldBegin("i64Val", thrift.STRUCT, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "i64Val", thrift.STRUCT, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:i64Val: ", p), err) } - if err := p.I64Val.Write(oprot); err != nil { + if err := p.I64Val.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.I64Val), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:i64Val: ", p), err) } } return err } -func (p *TColumn) writeField6(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetDoubleVal() { - if err := oprot.WriteFieldBegin("doubleVal", thrift.STRUCT, 6); err != nil { + if err := oprot.WriteFieldBegin(ctx, "doubleVal", thrift.STRUCT, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:doubleVal: ", p), err) } - if err := p.DoubleVal.Write(oprot); err != nil { + if err := p.DoubleVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DoubleVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:doubleVal: ", p), err) } } return err } -func (p *TColumn) writeField7(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetStringVal() { - if err := oprot.WriteFieldBegin("stringVal", thrift.STRUCT, 7); err != nil { + if err := oprot.WriteFieldBegin(ctx, "stringVal", thrift.STRUCT, 7); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stringVal: ", p), err) } - if err := p.StringVal.Write(oprot); err != nil { + if err := p.StringVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StringVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stringVal: ", p), err) } } return err } -func (p *TColumn) writeField8(oprot thrift.TProtocol) (err error) { +func (p *TColumn) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetBinaryVal() { - if err := oprot.WriteFieldBegin("binaryVal", thrift.STRUCT, 8); err != nil { + if err := oprot.WriteFieldBegin(ctx, "binaryVal", thrift.STRUCT, 8); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:binaryVal: ", p), err) } - if err := p.BinaryVal.Write(oprot); err != nil { + if err := p.BinaryVal.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BinaryVal), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 8:binaryVal: ", p), err) } } return err } +func (p *TColumn) Equals(other *TColumn) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.BoolVal.Equals(other.BoolVal) { return false } + if !p.ByteVal.Equals(other.ByteVal) { return false } + if !p.I16Val.Equals(other.I16Val) { return false } + if !p.I32Val.Equals(other.I32Val) { return false } + if !p.I64Val.Equals(other.I64Val) { return false } + if !p.DoubleVal.Equals(other.DoubleVal) { return false } + if !p.StringVal.Equals(other.StringVal) { return false } + if !p.BinaryVal.Equals(other.BinaryVal) { return false } + return true +} + func (p *TColumn) String() string { if p == nil { return "" @@ -5438,10 +5949,14 @@ func (p *TColumn) String() string { // - StartRowOffset // - Rows // - Columns +// - BinaryColumns +// - ColumnCount type TRowSet struct { StartRowOffset int64 `thrift:"startRowOffset,1,required" db:"startRowOffset" json:"startRowOffset"` Rows []*TRow `thrift:"rows,2,required" db:"rows" json:"rows"` Columns []*TColumn `thrift:"columns,3" db:"columns" json:"columns,omitempty"` + BinaryColumns []byte `thrift:"binaryColumns,4" db:"binaryColumns" json:"binaryColumns,omitempty"` + ColumnCount *int32 `thrift:"columnCount,5" db:"columnCount" json:"columnCount,omitempty"` } func NewTRowSet() *TRowSet { @@ -5461,12 +5976,32 @@ var TRowSet_Columns_DEFAULT []*TColumn func (p *TRowSet) GetColumns() []*TColumn { return p.Columns } +var TRowSet_BinaryColumns_DEFAULT []byte + +func (p *TRowSet) GetBinaryColumns() []byte { + return p.BinaryColumns +} +var TRowSet_ColumnCount_DEFAULT int32 +func (p *TRowSet) GetColumnCount() int32 { + if !p.IsSetColumnCount() { + return TRowSet_ColumnCount_DEFAULT + } +return *p.ColumnCount +} func (p *TRowSet) IsSetColumns() bool { return p.Columns != nil } -func (p *TRowSet) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TRowSet) IsSetBinaryColumns() bool { + return p.BinaryColumns != nil +} + +func (p *TRowSet) IsSetColumnCount() bool { + return p.ColumnCount != nil +} + +func (p *TRowSet) 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) } @@ -5474,7 +6009,7 @@ func (p *TRowSet) Read(iprot thrift.TProtocol) error { var issetRows bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -5482,46 +6017,66 @@ func (p *TRowSet) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I64 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStartRowOffset = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.LIST { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetRows = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.LIST { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStartRowOffset{ @@ -5533,8 +6088,8 @@ func (p *TRowSet) Read(iprot thrift.TProtocol) error { return nil } -func (p *TRowSet) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *TRowSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { p.StartRowOffset = v @@ -5542,111 +6097,182 @@ func (p *TRowSet) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TRowSet) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TRowSet) 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([]*TRow, 0, size) p.Rows = tSlice for i := 0; i < size; i ++ { - _elem17 := &TRow{} - if err := _elem17.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem17), err) + _elem31 := &TRow{} + if err := _elem31.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) } - p.Rows = append(p.Rows, _elem17) + p.Rows = append(p.Rows, _elem31) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TRowSet) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TRowSet) 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([]*TColumn, 0, size) p.Columns = tSlice for i := 0; i < size; i ++ { - _elem18 := &TColumn{} - if err := _elem18.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem18), err) + _elem32 := &TColumn{} + if err := _elem32.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) } - p.Columns = append(p.Columns, _elem18) + p.Columns = append(p.Columns, _elem32) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TRowSet) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TRowSet"); err != nil { +func (p *TRowSet) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.BinaryColumns = v +} + return nil +} + +func (p *TRowSet) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ColumnCount = &v +} + return nil +} + +func (p *TRowSet) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TRowSet"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TRowSet) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("startRowOffset", thrift.I64, 1); err != nil { +func (p *TRowSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "startRowOffset", thrift.I64, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:startRowOffset: ", p), err) } - if err := oprot.WriteI64(int64(p.StartRowOffset)); err != nil { + if err := oprot.WriteI64(ctx, int64(p.StartRowOffset)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.startRowOffset (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:startRowOffset: ", p), err) } return err } -func (p *TRowSet) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("rows", thrift.LIST, 2); err != nil { +func (p *TRowSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Rows)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.Rows { - if err := v.Write(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } return err } -func (p *TRowSet) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TRowSet) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetColumns() { - if err := oprot.WriteFieldBegin("columns", thrift.LIST, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:columns: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { + 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(oprot); err != nil { + if err := v.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:columns: ", p), err) } } return err } +func (p *TRowSet) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetBinaryColumns() { + if err := oprot.WriteFieldBegin(ctx, "binaryColumns", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:binaryColumns: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BinaryColumns); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.binaryColumns (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:binaryColumns: ", p), err) } + } + return err +} + +func (p *TRowSet) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetColumnCount() { + if err := oprot.WriteFieldBegin(ctx, "columnCount", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnCount: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ColumnCount)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.columnCount (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnCount: ", p), err) } + } + return err +} + +func (p *TRowSet) Equals(other *TRowSet) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StartRowOffset != other.StartRowOffset { return false } + if len(p.Rows) != len(other.Rows) { return false } + for i, _tgt := range p.Rows { + _src33 := other.Rows[i] + if !_tgt.Equals(_src33) { return false } + } + if len(p.Columns) != len(other.Columns) { return false } + for i, _tgt := range p.Columns { + _src34 := other.Columns[i] + if !_tgt.Equals(_src34) { return false } + } + if bytes.Compare(p.BinaryColumns, other.BinaryColumns) != 0 { return false } + if p.ColumnCount != other.ColumnCount { + if p.ColumnCount == nil || other.ColumnCount == nil { + return false + } + if (*p.ColumnCount) != (*other.ColumnCount) { return false } + } + return true +} + func (p *TRowSet) String() string { if p == nil { return "" @@ -5718,15 +6344,15 @@ func (p *TStatus) IsSetErrorMessage() bool { return p.ErrorMessage != nil } -func (p *TStatus) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TStatus) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatusCode bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -5734,65 +6360,65 @@ func (p *TStatus) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatusCode = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.LIST { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.I32 { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRING { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatusCode{ @@ -5801,8 +6427,8 @@ func (p *TStatus) Read(iprot thrift.TProtocol) error { return nil } -func (p *TStatus) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := TStatusCode(v) @@ -5811,30 +6437,30 @@ func (p *TStatus) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TStatus) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TStatus) 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.InfoMessages = tSlice for i := 0; i < size; i ++ { -var _elem19 string - if v, err := iprot.ReadString(); err != nil { +var _elem35 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem19 = v + _elem35 = v } - p.InfoMessages = append(p.InfoMessages, _elem19) + p.InfoMessages = append(p.InfoMessages, _elem35) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TStatus) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TStatus) 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.SqlState = &v @@ -5842,8 +6468,8 @@ func (p *TStatus) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TStatus) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TStatus) 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.ErrorCode = &v @@ -5851,8 +6477,8 @@ func (p *TStatus) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TStatus) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TStatus) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 5: ", err) } else { p.ErrorMessage = &v @@ -5860,89 +6486,122 @@ func (p *TStatus) ReadField5(iprot thrift.TProtocol) error { return nil } -func (p *TStatus) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TStatus"); err != nil { +func (p *TStatus) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TStatus"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TStatus) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("statusCode", thrift.I32, 1); err != nil { +func (p *TStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "statusCode", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:statusCode: ", p), err) } - if err := oprot.WriteI32(int32(p.StatusCode)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.StatusCode)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.statusCode (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:statusCode: ", p), err) } return err } -func (p *TStatus) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetInfoMessages() { - if err := oprot.WriteFieldBegin("infoMessages", thrift.LIST, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "infoMessages", thrift.LIST, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoMessages: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.InfoMessages)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.InfoMessages)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.InfoMessages { - if err := oprot.WriteString(string(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoMessages: ", p), err) } } return err } -func (p *TStatus) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TStatus) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin("sqlState", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(string(*p.SqlState)); err != nil { + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } } return err } -func (p *TStatus) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TStatus) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin("errorCode", thrift.I32, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(int32(*p.ErrorCode)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } } return err } -func (p *TStatus) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TStatus) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin("errorMessage", thrift.STRING, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(string(*p.ErrorMessage)); err != nil { + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } } return err } +func (p *TStatus) Equals(other *TStatus) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StatusCode != other.StatusCode { return false } + if len(p.InfoMessages) != len(other.InfoMessages) { return false } + for i, _tgt := range p.InfoMessages { + _src36 := other.InfoMessages[i] + if _tgt != _src36 { return false } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { return false } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { return false } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } + } + return true +} + func (p *TStatus) String() string { if p == nil { return "" @@ -5970,8 +6629,8 @@ func (p *THandleIdentifier) GetGUID() []byte { func (p *THandleIdentifier) GetSecret() []byte { return p.Secret } -func (p *THandleIdentifier) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *THandleIdentifier) 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) } @@ -5979,7 +6638,7 @@ func (p *THandleIdentifier) Read(iprot thrift.TProtocol) error { var issetSecret bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -5987,36 +6646,36 @@ func (p *THandleIdentifier) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetGUID = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetSecret = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetGUID{ @@ -6028,8 +6687,8 @@ func (p *THandleIdentifier) Read(iprot thrift.TProtocol) error { return nil } -func (p *THandleIdentifier) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *THandleIdentifier) 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.GUID = v @@ -6037,8 +6696,8 @@ func (p *THandleIdentifier) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *THandleIdentifier) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBinary(); err != nil { +func (p *THandleIdentifier) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Secret = v @@ -6046,40 +6705,51 @@ func (p *THandleIdentifier) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *THandleIdentifier) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("THandleIdentifier"); err != nil { +func (p *THandleIdentifier) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "THandleIdentifier"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *THandleIdentifier) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("guid", thrift.STRING, 1); err != nil { +func (p *THandleIdentifier) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "guid", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:guid: ", p), err) } - if err := oprot.WriteBinary(p.GUID); err != nil { + if err := oprot.WriteBinary(ctx, p.GUID); err != nil { return thrift.PrependError(fmt.Sprintf("%T.guid (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:guid: ", p), err) } return err } -func (p *THandleIdentifier) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("secret", thrift.STRING, 2); err != nil { +func (p *THandleIdentifier) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "secret", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:secret: ", p), err) } - if err := oprot.WriteBinary(p.Secret); err != nil { + if err := oprot.WriteBinary(ctx, p.Secret); err != nil { return thrift.PrependError(fmt.Sprintf("%T.secret (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:secret: ", p), err) } return err } +func (p *THandleIdentifier) Equals(other *THandleIdentifier) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.GUID, other.GUID) != 0 { return false } + if bytes.Compare(p.Secret, other.Secret) != 0 { return false } + return true +} + func (p *THandleIdentifier) String() string { if p == nil { return "" @@ -6108,15 +6778,15 @@ func (p *TSessionHandle) IsSetSessionId() bool { return p.SessionId != nil } -func (p *TSessionHandle) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TSessionHandle) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionId bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -6124,25 +6794,25 @@ func (p *TSessionHandle) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionId = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionId{ @@ -6151,38 +6821,48 @@ func (p *TSessionHandle) Read(iprot thrift.TProtocol) error { return nil } -func (p *TSessionHandle) ReadField1(iprot thrift.TProtocol) error { +func (p *TSessionHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionId = &THandleIdentifier{} - if err := p.SessionId.Read(iprot); err != nil { + if err := p.SessionId.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionId), err) } return nil } -func (p *TSessionHandle) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TSessionHandle"); err != nil { +func (p *TSessionHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TSessionHandle"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TSessionHandle) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionId", thrift.STRUCT, 1); err != nil { +func (p *TSessionHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } - if err := p.SessionId.Write(oprot); err != nil { + if err := p.SessionId.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionId), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } return err } +func (p *TSessionHandle) Equals(other *TSessionHandle) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionId.Equals(other.SessionId) { return false } + return true +} + func (p *TSessionHandle) String() string { if p == nil { return "" @@ -6236,8 +6916,8 @@ func (p *TOperationHandle) IsSetModifiedRowCount() bool { return p.ModifiedRowCount != nil } -func (p *TOperationHandle) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TOperationHandle) 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) } @@ -6246,7 +6926,7 @@ func (p *TOperationHandle) Read(iprot thrift.TProtocol) error { var issetHasResultSet bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -6254,57 +6934,57 @@ func (p *TOperationHandle) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetOperationId = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetOperationType = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.BOOL { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } issetHasResultSet = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.DOUBLE { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetOperationId{ @@ -6319,16 +6999,16 @@ func (p *TOperationHandle) Read(iprot thrift.TProtocol) error { return nil } -func (p *TOperationHandle) ReadField1(iprot thrift.TProtocol) error { +func (p *TOperationHandle) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.OperationId = &THandleIdentifier{} - if err := p.OperationId.Read(iprot); err != nil { + if err := p.OperationId.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationId), err) } return nil } -func (p *TOperationHandle) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TOperationHandle) 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 := TOperationType(v) @@ -6337,8 +7017,8 @@ func (p *TOperationHandle) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TOperationHandle) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *TOperationHandle) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { p.HasResultSet = v @@ -6346,8 +7026,8 @@ func (p *TOperationHandle) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TOperationHandle) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadDouble(); err != nil { +func (p *TOperationHandle) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { p.ModifiedRowCount = &v @@ -6355,65 +7035,83 @@ func (p *TOperationHandle) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TOperationHandle) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TOperationHandle"); err != nil { +func (p *TOperationHandle) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TOperationHandle"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TOperationHandle) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationId", thrift.STRUCT, 1); err != nil { +func (p *TOperationHandle) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationId", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationId: ", p), err) } - if err := p.OperationId.Write(oprot); err != nil { + if err := p.OperationId.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationId), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationId: ", p), err) } return err } -func (p *TOperationHandle) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationType", thrift.I32, 2); err != nil { +func (p *TOperationHandle) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationType", thrift.I32, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationType: ", p), err) } - if err := oprot.WriteI32(int32(p.OperationType)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.OperationType)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.operationType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationType: ", p), err) } return err } -func (p *TOperationHandle) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("hasResultSet", thrift.BOOL, 3); err != nil { +func (p *TOperationHandle) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hasResultSet: ", p), err) } - if err := oprot.WriteBool(bool(p.HasResultSet)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.HasResultSet)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hasResultSet: ", p), err) } return err } -func (p *TOperationHandle) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TOperationHandle) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetModifiedRowCount() { - if err := oprot.WriteFieldBegin("modifiedRowCount", thrift.DOUBLE, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "modifiedRowCount", thrift.DOUBLE, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:modifiedRowCount: ", p), err) } - if err := oprot.WriteDouble(float64(*p.ModifiedRowCount)); err != nil { + if err := oprot.WriteDouble(ctx, float64(*p.ModifiedRowCount)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.modifiedRowCount (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:modifiedRowCount: ", p), err) } } return err } +func (p *TOperationHandle) Equals(other *TOperationHandle) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationId.Equals(other.OperationId) { return false } + if p.OperationType != other.OperationType { return false } + if p.HasResultSet != other.HasResultSet { return false } + if p.ModifiedRowCount != other.ModifiedRowCount { + if p.ModifiedRowCount == nil || other.ModifiedRowCount == nil { + return false + } + if (*p.ModifiedRowCount) != (*other.ModifiedRowCount) { return false } + } + return true +} + func (p *TOperationHandle) String() string { if p == nil { return "" @@ -6435,7 +7133,7 @@ type TOpenSessionReq struct { func NewTOpenSessionReq() *TOpenSessionReq { return &TOpenSessionReq{ -ClientProtocol: 7, +ClientProtocol: 9, } } @@ -6474,15 +7172,15 @@ func (p *TOpenSessionReq) IsSetConfiguration() bool { return p.Configuration != nil } -func (p *TOpenSessionReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TOpenSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetClientProtocol bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -6490,55 +7188,55 @@ func (p *TOpenSessionReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetClientProtocol = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.MAP { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetClientProtocol{ @@ -6547,8 +7245,8 @@ func (p *TOpenSessionReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionReq) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TOpenSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 1: ", err) } else { temp := TProtocolVersion(v) @@ -6557,8 +7255,8 @@ func (p *TOpenSessionReq) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TOpenSessionReq) 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.Username = &v @@ -6566,8 +7264,8 @@ func (p *TOpenSessionReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TOpenSessionReq) 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.Password = &v @@ -6575,106 +7273,133 @@ func (p *TOpenSessionReq) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionReq) ReadField4(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TOpenSessionReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[string]string, size) p.Configuration = tMap for i := 0; i < size; i ++ { -var _key20 string - if v, err := iprot.ReadString(); err != nil { +var _key37 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key20 = v + _key37 = v } -var _val21 string - if v, err := iprot.ReadString(); err != nil { +var _val38 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val21 = v + _val38 = v } - p.Configuration[_key20] = _val21 + p.Configuration[_key37] = _val38 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TOpenSessionReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TOpenSessionReq"); err != nil { +func (p *TOpenSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TOpenSessionReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TOpenSessionReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("client_protocol", thrift.I32, 1); err != nil { +func (p *TOpenSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "client_protocol", thrift.I32, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_protocol: ", p), err) } - if err := oprot.WriteI32(int32(p.ClientProtocol)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.ClientProtocol)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.client_protocol (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_protocol: ", p), err) } return err } -func (p *TOpenSessionReq) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TOpenSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetUsername() { - if err := oprot.WriteFieldBegin("username", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:username: ", p), err) } - if err := oprot.WriteString(string(*p.Username)); err != nil { + if err := oprot.WriteString(ctx, string(*p.Username)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.username (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:username: ", p), err) } } return err } -func (p *TOpenSessionReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TOpenSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetPassword() { - if err := oprot.WriteFieldBegin("password", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:password: ", p), err) } - if err := oprot.WriteString(string(*p.Password)); err != nil { + if err := oprot.WriteString(ctx, string(*p.Password)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.password (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:password: ", p), err) } } return err } -func (p *TOpenSessionReq) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TOpenSessionReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Configuration { - if err := oprot.WriteString(string(k)); err != nil { + if err := oprot.WriteString(ctx, string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } } return err } +func (p *TOpenSessionReq) Equals(other *TOpenSessionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ClientProtocol != other.ClientProtocol { return false } + if p.Username != other.Username { + if p.Username == nil || other.Username == nil { + return false + } + if (*p.Username) != (*other.Username) { return false } + } + if p.Password != other.Password { + if p.Password == nil || other.Password == nil { + return false + } + if (*p.Password) != (*other.Password) { return false } + } + if len(p.Configuration) != len(other.Configuration) { return false } + for k, _tgt := range p.Configuration { + _src39 := other.Configuration[k] + if _tgt != _src39 { return false } + } + return true +} + func (p *TOpenSessionReq) String() string { if p == nil { return "" @@ -6696,7 +7421,7 @@ type TOpenSessionResp struct { func NewTOpenSessionResp() *TOpenSessionResp { return &TOpenSessionResp{ -ServerProtocolVersion: 7, +ServerProtocolVersion: 9, } } @@ -6735,8 +7460,8 @@ func (p *TOpenSessionResp) IsSetConfiguration() bool { return p.Configuration != nil } -func (p *TOpenSessionResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TOpenSessionResp) 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) } @@ -6744,7 +7469,7 @@ func (p *TOpenSessionResp) Read(iprot thrift.TProtocol) error { var issetServerProtocolVersion bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -6752,56 +7477,56 @@ func (p *TOpenSessionResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetServerProtocolVersion = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.MAP { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -6813,16 +7538,16 @@ func (p *TOpenSessionResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TOpenSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TOpenSessionResp) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TOpenSessionResp) 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 := TProtocolVersion(v) @@ -6831,114 +7556,131 @@ func (p *TOpenSessionResp) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TOpenSessionResp) ReadField3(iprot thrift.TProtocol) error { +func (p *TOpenSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TOpenSessionResp) ReadField4(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TOpenSessionResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[string]string, size) p.Configuration = tMap for i := 0; i < size; i ++ { -var _key22 string - if v, err := iprot.ReadString(); err != nil { +var _key40 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key22 = v + _key40 = v } -var _val23 string - if v, err := iprot.ReadString(); err != nil { +var _val41 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val23 = v + _val41 = v } - p.Configuration[_key22] = _val23 + p.Configuration[_key40] = _val41 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TOpenSessionResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TOpenSessionResp"); err != nil { +func (p *TOpenSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TOpenSessionResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TOpenSessionResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TOpenSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TOpenSessionResp) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("serverProtocolVersion", thrift.I32, 2); err != nil { +func (p *TOpenSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "serverProtocolVersion", thrift.I32, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:serverProtocolVersion: ", p), err) } - if err := oprot.WriteI32(int32(p.ServerProtocolVersion)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.ServerProtocolVersion)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.serverProtocolVersion (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:serverProtocolVersion: ", p), err) } return err } -func (p *TOpenSessionResp) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TOpenSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSessionHandle() { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessionHandle: ", p), err) } } return err } -func (p *TOpenSessionResp) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TOpenSessionResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConfiguration() { - if err := oprot.WriteFieldBegin("configuration", thrift.MAP, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:configuration: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.Configuration { - if err := oprot.WriteString(string(k)); err != nil { + if err := oprot.WriteString(ctx, string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:configuration: ", p), err) } } return err } +func (p *TOpenSessionResp) Equals(other *TOpenSessionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.ServerProtocolVersion != other.ServerProtocolVersion { return false } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if len(p.Configuration) != len(other.Configuration) { return false } + for k, _tgt := range p.Configuration { + _src42 := other.Configuration[k] + if _tgt != _src42 { return false } + } + return true +} + func (p *TOpenSessionResp) String() string { if p == nil { return "" @@ -6948,16 +7690,319 @@ func (p *TOpenSessionResp) String() string { // Attributes: // - SessionHandle -type TCloseSessionReq struct { +// - Configuration +type TSetClientInfoReq struct { SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Configuration map[string]string `thrift:"configuration,2" db:"configuration" json:"configuration,omitempty"` } -func NewTCloseSessionReq() *TCloseSessionReq { - return &TCloseSessionReq{} +func NewTSetClientInfoReq() *TSetClientInfoReq { + return &TSetClientInfoReq{} } -var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle -func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle { +var TSetClientInfoReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TSetClientInfoReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TSetClientInfoReq_SessionHandle_DEFAULT + } +return p.SessionHandle +} +var TSetClientInfoReq_Configuration_DEFAULT map[string]string + +func (p *TSetClientInfoReq) GetConfiguration() map[string]string { + return p.Configuration +} +func (p *TSetClientInfoReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil +} + +func (p *TSetClientInfoReq) IsSetConfiguration() bool { + return p.Configuration != nil +} + +func (p *TSetClientInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + 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) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + return nil +} + +func (p *TSetClientInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TSetClientInfoReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]string, size) + p.Configuration = tMap + for i := 0; i < size; i ++ { +var _key43 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key43 = v +} +var _val44 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val44 = v +} + p.Configuration[_key43] = _val44 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *TSetClientInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TSetClientInfoReq"); 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 *TSetClientInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err +} + +func (p *TSetClientInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetConfiguration() { + if err := oprot.WriteFieldBegin(ctx, "configuration", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:configuration: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.Configuration)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Configuration { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:configuration: ", p), err) } + } + return err +} + +func (p *TSetClientInfoReq) Equals(other *TSetClientInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if len(p.Configuration) != len(other.Configuration) { return false } + for k, _tgt := range p.Configuration { + _src45 := other.Configuration[k] + if _tgt != _src45 { return false } + } + return true +} + +func (p *TSetClientInfoReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TSetClientInfoReq(%+v)", *p) +} + +// Attributes: +// - Status +type TSetClientInfoResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +} + +func NewTSetClientInfoResp() *TSetClientInfoResp { + return &TSetClientInfoResp{} +} + +var TSetClientInfoResp_Status_DEFAULT *TStatus +func (p *TSetClientInfoResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TSetClientInfoResp_Status_DEFAULT + } +return p.Status +} +func (p *TSetClientInfoResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TSetClientInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TSetClientInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TSetClientInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TSetClientInfoResp"); 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 *TSetClientInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err +} + +func (p *TSetClientInfoResp) Equals(other *TSetClientInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true +} + +func (p *TSetClientInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TSetClientInfoResp(%+v)", *p) +} + +// Attributes: +// - SessionHandle +type TCloseSessionReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` +} + +func NewTCloseSessionReq() *TCloseSessionReq { + return &TCloseSessionReq{} +} + +var TCloseSessionReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TCloseSessionReq) GetSessionHandle() *TSessionHandle { if !p.IsSetSessionHandle() { return TCloseSessionReq_SessionHandle_DEFAULT } @@ -6967,15 +8012,15 @@ func (p *TCloseSessionReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } -func (p *TCloseSessionReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCloseSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -6983,25 +8028,25 @@ func (p *TCloseSessionReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -7010,38 +8055,48 @@ func (p *TCloseSessionReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TCloseSessionReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TCloseSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TCloseSessionReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCloseSessionReq"); err != nil { +func (p *TCloseSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCloseSessionReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCloseSessionReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TCloseSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } +func (p *TCloseSessionReq) Equals(other *TCloseSessionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + return true +} + func (p *TCloseSessionReq) String() string { if p == nil { return "" @@ -7070,15 +8125,15 @@ func (p *TCloseSessionResp) IsSetStatus() bool { return p.Status != nil } -func (p *TCloseSessionResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCloseSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -7086,25 +8141,25 @@ func (p *TCloseSessionResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -7113,38 +8168,48 @@ func (p *TCloseSessionResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TCloseSessionResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TCloseSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TCloseSessionResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCloseSessionResp"); err != nil { +func (p *TCloseSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCloseSessionResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCloseSessionResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TCloseSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } +func (p *TCloseSessionResp) Equals(other *TCloseSessionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true +} + func (p *TCloseSessionResp) String() string { if p == nil { return "" @@ -7262,14 +8327,14 @@ func (p *TGetInfoValue) IsSetLenValue() bool { return p.LenValue != nil } -func (p *TGetInfoValue) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetInfoValue) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -7277,81 +8342,81 @@ func (p *TGetInfoValue) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRING { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I16 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.I32 { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.I32 { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.I32 { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 6: if fieldTypeId == thrift.I64 { - if err := p.ReadField6(iprot); err != nil { + if err := p.ReadField6(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TGetInfoValue) ReadField1(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetInfoValue) 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.StringValue = &v @@ -7359,8 +8424,8 @@ func (p *TGetInfoValue) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(); err != nil { +func (p *TGetInfoValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.SmallIntValue = &v @@ -7368,8 +8433,8 @@ func (p *TGetInfoValue) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetInfoValue) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 3: ", err) } else { p.IntegerBitmask = &v @@ -7377,8 +8442,8 @@ func (p *TGetInfoValue) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetInfoValue) 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.IntegerFlag = &v @@ -7386,8 +8451,8 @@ func (p *TGetInfoValue) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetInfoValue) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { return thrift.PrependError("error reading field 5: ", err) } else { p.BinaryValue = &v @@ -7395,8 +8460,8 @@ func (p *TGetInfoValue) ReadField5(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) ReadField6(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *TGetInfoValue) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { return thrift.PrependError("error reading field 6: ", err) } else { p.LenValue = &v @@ -7404,99 +8469,144 @@ func (p *TGetInfoValue) ReadField6(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoValue) Write(oprot thrift.TProtocol) error { +func (p *TGetInfoValue) Write(ctx context.Context, oprot thrift.TProtocol) error { if c := p.CountSetFieldsTGetInfoValue(); c != 1 { return fmt.Errorf("%T write union: exactly one field must be set (%d set).", p, c) } - if err := oprot.WriteStructBegin("TGetInfoValue"); err != nil { + if err := oprot.WriteStructBegin(ctx, "TGetInfoValue"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := p.writeField6(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetInfoValue) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetStringValue() { - if err := oprot.WriteFieldBegin("stringValue", thrift.STRING, 1); err != nil { + if err := oprot.WriteFieldBegin(ctx, "stringValue", thrift.STRING, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:stringValue: ", p), err) } - if err := oprot.WriteString(string(*p.StringValue)); err != nil { + if err := oprot.WriteString(ctx, string(*p.StringValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.stringValue (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:stringValue: ", p), err) } } return err } -func (p *TGetInfoValue) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSmallIntValue() { - if err := oprot.WriteFieldBegin("smallIntValue", thrift.I16, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "smallIntValue", thrift.I16, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:smallIntValue: ", p), err) } - if err := oprot.WriteI16(int16(*p.SmallIntValue)); err != nil { + if err := oprot.WriteI16(ctx, int16(*p.SmallIntValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.smallIntValue (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:smallIntValue: ", p), err) } } return err } -func (p *TGetInfoValue) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetIntegerBitmask() { - if err := oprot.WriteFieldBegin("integerBitmask", thrift.I32, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "integerBitmask", thrift.I32, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:integerBitmask: ", p), err) } - if err := oprot.WriteI32(int32(*p.IntegerBitmask)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.IntegerBitmask)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.integerBitmask (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:integerBitmask: ", p), err) } } return err } -func (p *TGetInfoValue) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetIntegerFlag() { - if err := oprot.WriteFieldBegin("integerFlag", thrift.I32, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "integerFlag", thrift.I32, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:integerFlag: ", p), err) } - if err := oprot.WriteI32(int32(*p.IntegerFlag)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.IntegerFlag)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.integerFlag (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:integerFlag: ", p), err) } } return err } -func (p *TGetInfoValue) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetBinaryValue() { - if err := oprot.WriteFieldBegin("binaryValue", thrift.I32, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "binaryValue", thrift.I32, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:binaryValue: ", p), err) } - if err := oprot.WriteI32(int32(*p.BinaryValue)); err != nil { + if err := oprot.WriteI32(ctx, int32(*p.BinaryValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.binaryValue (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:binaryValue: ", p), err) } } return err } -func (p *TGetInfoValue) writeField6(oprot thrift.TProtocol) (err error) { +func (p *TGetInfoValue) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetLenValue() { - if err := oprot.WriteFieldBegin("lenValue", thrift.I64, 6); err != nil { + if err := oprot.WriteFieldBegin(ctx, "lenValue", thrift.I64, 6); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:lenValue: ", p), err) } - if err := oprot.WriteI64(int64(*p.LenValue)); err != nil { + if err := oprot.WriteI64(ctx, int64(*p.LenValue)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.lenValue (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 6:lenValue: ", p), err) } } return err } +func (p *TGetInfoValue) Equals(other *TGetInfoValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StringValue != other.StringValue { + if p.StringValue == nil || other.StringValue == nil { + return false + } + if (*p.StringValue) != (*other.StringValue) { return false } + } + if p.SmallIntValue != other.SmallIntValue { + if p.SmallIntValue == nil || other.SmallIntValue == nil { + return false + } + if (*p.SmallIntValue) != (*other.SmallIntValue) { return false } + } + if p.IntegerBitmask != other.IntegerBitmask { + if p.IntegerBitmask == nil || other.IntegerBitmask == nil { + return false + } + if (*p.IntegerBitmask) != (*other.IntegerBitmask) { return false } + } + if p.IntegerFlag != other.IntegerFlag { + if p.IntegerFlag == nil || other.IntegerFlag == nil { + return false + } + if (*p.IntegerFlag) != (*other.IntegerFlag) { return false } + } + if p.BinaryValue != other.BinaryValue { + if p.BinaryValue == nil || other.BinaryValue == nil { + return false + } + if (*p.BinaryValue) != (*other.BinaryValue) { return false } + } + if p.LenValue != other.LenValue { + if p.LenValue == nil || other.LenValue == nil { + return false + } + if (*p.LenValue) != (*other.LenValue) { return false } + } + return true +} + func (p *TGetInfoValue) String() string { if p == nil { return "" @@ -7531,8 +8641,8 @@ func (p *TGetInfoReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } -func (p *TGetInfoReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetInfoReq) 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) } @@ -7540,7 +8650,7 @@ func (p *TGetInfoReq) Read(iprot thrift.TProtocol) error { var issetInfoType bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -7548,36 +8658,36 @@ func (p *TGetInfoReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetInfoType = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -7589,16 +8699,16 @@ func (p *TGetInfoReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetInfoReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetInfoReq) 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 := TGetInfoType(v) @@ -7607,41 +8717,52 @@ func (p *TGetInfoReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetInfoReq"); err != nil { +func (p *TGetInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetInfoReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetInfoReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetInfoReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("infoType", thrift.I32, 2); err != nil { +func (p *TGetInfoReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "infoType", thrift.I32, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoType: ", p), err) } - if err := oprot.WriteI32(int32(p.InfoType)); err != nil { + if err := oprot.WriteI32(ctx, int32(p.InfoType)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.infoType (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoType: ", p), err) } return err } +func (p *TGetInfoReq) Equals(other *TGetInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.InfoType != other.InfoType { return false } + return true +} + func (p *TGetInfoReq) String() string { if p == nil { return "" @@ -7683,8 +8804,8 @@ func (p *TGetInfoResp) IsSetInfoValue() bool { return p.InfoValue != nil } -func (p *TGetInfoResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetInfoResp) 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) } @@ -7692,7 +8813,7 @@ func (p *TGetInfoResp) Read(iprot thrift.TProtocol) error { var issetInfoValue bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -7700,36 +8821,36 @@ func (p *TGetInfoResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetInfoValue = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -7741,58 +8862,69 @@ func (p *TGetInfoResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetInfoResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetInfoResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.InfoValue = &TGetInfoValue{} - if err := p.InfoValue.Read(iprot); err != nil { + if err := p.InfoValue.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.InfoValue), err) } return nil } -func (p *TGetInfoResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetInfoResp"); err != nil { +func (p *TGetInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetInfoResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetInfoResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetInfoResp) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("infoValue", thrift.STRUCT, 2); err != nil { +func (p *TGetInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "infoValue", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:infoValue: ", p), err) } - if err := p.InfoValue.Write(oprot); err != nil { + if err := p.InfoValue.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.InfoValue), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:infoValue: ", p), err) } return err } +func (p *TGetInfoResp) Equals(other *TGetInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.InfoValue.Equals(other.InfoValue) { return false } + return true +} + func (p *TGetInfoResp) String() string { if p == nil { return "" @@ -7805,11 +8937,13 @@ func (p *TGetInfoResp) String() string { // - Statement // - ConfOverlay // - RunAsync +// - QueryTimeout type TExecuteStatementReq struct { SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` Statement string `thrift:"statement,2,required" db:"statement" json:"statement"` ConfOverlay map[string]string `thrift:"confOverlay,3" db:"confOverlay" json:"confOverlay,omitempty"` - RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync,omitempty"` + RunAsync bool `thrift:"runAsync,4" db:"runAsync" json:"runAsync"` + QueryTimeout int64 `thrift:"queryTimeout,5" db:"queryTimeout" json:"queryTimeout"` } func NewTExecuteStatementReq() *TExecuteStatementReq { @@ -7837,6 +8971,11 @@ var TExecuteStatementReq_RunAsync_DEFAULT bool = false func (p *TExecuteStatementReq) GetRunAsync() bool { return p.RunAsync } +var TExecuteStatementReq_QueryTimeout_DEFAULT int64 = 0 + +func (p *TExecuteStatementReq) GetQueryTimeout() int64 { + return p.QueryTimeout +} func (p *TExecuteStatementReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } @@ -7849,8 +8988,12 @@ func (p *TExecuteStatementReq) IsSetRunAsync() bool { return p.RunAsync != TExecuteStatementReq_RunAsync_DEFAULT } -func (p *TExecuteStatementReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TExecuteStatementReq) IsSetQueryTimeout() bool { + return p.QueryTimeout != TExecuteStatementReq_QueryTimeout_DEFAULT +} + +func (p *TExecuteStatementReq) 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) } @@ -7858,7 +9001,7 @@ func (p *TExecuteStatementReq) Read(iprot thrift.TProtocol) error { var issetStatement bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -7866,56 +9009,66 @@ func (p *TExecuteStatementReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } issetStatement = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.MAP { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.BOOL { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -7927,16 +9080,16 @@ func (p *TExecuteStatementReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TExecuteStatementReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TExecuteStatementReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TExecuteStatementReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TExecuteStatementReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 2: ", err) } else { p.Statement = v @@ -7944,36 +9097,36 @@ func (p *TExecuteStatementReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TExecuteStatementReq) ReadField3(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() +func (p *TExecuteStatementReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) if err != nil { return thrift.PrependError("error reading map begin: ", err) } tMap := make(map[string]string, size) p.ConfOverlay = tMap for i := 0; i < size; i ++ { -var _key24 string - if v, err := iprot.ReadString(); err != nil { +var _key46 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _key24 = v + _key46 = v } -var _val25 string - if v, err := iprot.ReadString(); err != nil { +var _val47 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _val25 = v + _val47 = v } - p.ConfOverlay[_key24] = _val25 + p.ConfOverlay[_key46] = _val47 } - if err := iprot.ReadMapEnd(); err != nil { + if err := iprot.ReadMapEnd(ctx); err != nil { return thrift.PrependError("error reading map end: ", err) } return nil } -func (p *TExecuteStatementReq) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { +func (p *TExecuteStatementReq) 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.RunAsync = v @@ -7981,82 +9134,122 @@ func (p *TExecuteStatementReq) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TExecuteStatementReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TExecuteStatementReq"); err != nil { +func (p *TExecuteStatementReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.QueryTimeout = v +} + return nil +} + +func (p *TExecuteStatementReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TExecuteStatementReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TExecuteStatementReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TExecuteStatementReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("statement", thrift.STRING, 2); err != nil { +func (p *TExecuteStatementReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "statement", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:statement: ", p), err) } - if err := oprot.WriteString(string(p.Statement)); err != nil { + if err := oprot.WriteString(ctx, string(p.Statement)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.statement (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:statement: ", p), err) } return err } -func (p *TExecuteStatementReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TExecuteStatementReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetConfOverlay() { - if err := oprot.WriteFieldBegin("confOverlay", thrift.MAP, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "confOverlay", thrift.MAP, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:confOverlay: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRING, len(p.ConfOverlay)); err != nil { return thrift.PrependError("error writing map begin: ", err) } for k, v := range p.ConfOverlay { - if err := oprot.WriteString(string(k)); err != nil { + if err := oprot.WriteString(ctx, string(k)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteString(string(v)); err != nil { + if err := oprot.WriteString(ctx, string(v)); err != nil { return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteMapEnd(ctx); err != nil { return thrift.PrependError("error writing map end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:confOverlay: ", p), err) } } return err } -func (p *TExecuteStatementReq) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TExecuteStatementReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetRunAsync() { - if err := oprot.WriteFieldBegin("runAsync", thrift.BOOL, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "runAsync", thrift.BOOL, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:runAsync: ", p), err) } - if err := oprot.WriteBool(bool(p.RunAsync)); err != nil { + if err := oprot.WriteBool(ctx, bool(p.RunAsync)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.runAsync (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:runAsync: ", p), err) } } return err } -func (p *TExecuteStatementReq) String() string { - if p == nil { - return "" +func (p *TExecuteStatementReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetQueryTimeout() { + if err := oprot.WriteFieldBegin(ctx, "queryTimeout", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:queryTimeout: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.QueryTimeout)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryTimeout (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:queryTimeout: ", p), err) } } - return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) + return err +} + +func (p *TExecuteStatementReq) Equals(other *TExecuteStatementReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.Statement != other.Statement { return false } + if len(p.ConfOverlay) != len(other.ConfOverlay) { return false } + for k, _tgt := range p.ConfOverlay { + _src48 := other.ConfOverlay[k] + if _tgt != _src48 { return false } + } + if p.RunAsync != other.RunAsync { return false } + if p.QueryTimeout != other.QueryTimeout { return false } + return true +} + +func (p *TExecuteStatementReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TExecuteStatementReq(%+v)", *p) } // Attributes: @@ -8093,15 +9286,15 @@ func (p *TExecuteStatementResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TExecuteStatementResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TExecuteStatementResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8109,35 +9302,35 @@ func (p *TExecuteStatementResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -8146,60 +9339,71 @@ func (p *TExecuteStatementResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TExecuteStatementResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TExecuteStatementResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TExecuteStatementResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TExecuteStatementResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TExecuteStatementResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TExecuteStatementResp"); err != nil { +func (p *TExecuteStatementResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TExecuteStatementResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TExecuteStatementResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TExecuteStatementResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TExecuteStatementResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TExecuteStatementResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TExecuteStatementResp) Equals(other *TExecuteStatementResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TExecuteStatementResp) String() string { if p == nil { return "" @@ -8228,15 +9432,15 @@ func (p *TGetTypeInfoReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } -func (p *TGetTypeInfoReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTypeInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8244,25 +9448,25 @@ func (p *TGetTypeInfoReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -8271,38 +9475,48 @@ func (p *TGetTypeInfoReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTypeInfoReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTypeInfoReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetTypeInfoReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTypeInfoReq"); err != nil { +func (p *TGetTypeInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTypeInfoReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetTypeInfoReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } +func (p *TGetTypeInfoReq) Equals(other *TGetTypeInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + return true +} + func (p *TGetTypeInfoReq) String() string { if p == nil { return "" @@ -8344,15 +9558,15 @@ func (p *TGetTypeInfoResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetTypeInfoResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTypeInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8360,35 +9574,35 @@ func (p *TGetTypeInfoResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -8397,60 +9611,71 @@ func (p *TGetTypeInfoResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTypeInfoResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTypeInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetTypeInfoResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetTypeInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetTypeInfoResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTypeInfoResp"); err != nil { +func (p *TGetTypeInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTypeInfoResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTypeInfoResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetTypeInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetTypeInfoResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetTypeInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetTypeInfoResp) Equals(other *TGetTypeInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetTypeInfoResp) String() string { if p == nil { return "" @@ -8479,15 +9704,15 @@ func (p *TGetCatalogsReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } -func (p *TGetCatalogsReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetCatalogsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8495,25 +9720,25 @@ func (p *TGetCatalogsReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -8522,38 +9747,48 @@ func (p *TGetCatalogsReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetCatalogsReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetCatalogsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetCatalogsReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetCatalogsReq"); err != nil { +func (p *TGetCatalogsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetCatalogsReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetCatalogsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } +func (p *TGetCatalogsReq) Equals(other *TGetCatalogsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + return true +} + func (p *TGetCatalogsReq) String() string { if p == nil { return "" @@ -8595,15 +9830,15 @@ func (p *TGetCatalogsResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetCatalogsResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetCatalogsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8611,35 +9846,35 @@ func (p *TGetCatalogsResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -8648,60 +9883,71 @@ func (p *TGetCatalogsResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetCatalogsResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetCatalogsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetCatalogsResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetCatalogsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetCatalogsResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetCatalogsResp"); err != nil { +func (p *TGetCatalogsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetCatalogsResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetCatalogsResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetCatalogsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetCatalogsResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetCatalogsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetCatalogsResp) Equals(other *TGetCatalogsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetCatalogsResp) String() string { if p == nil { return "" @@ -8756,15 +10002,15 @@ func (p *TGetSchemasReq) IsSetSchemaName() bool { return p.SchemaName != nil } -func (p *TGetSchemasReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetSchemasReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8772,45 +10018,45 @@ func (p *TGetSchemasReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -8819,16 +10065,16 @@ func (p *TGetSchemasReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetSchemasReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetSchemasReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetSchemasReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetSchemasReq) 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 { temp := TIdentifier(v) @@ -8837,8 +10083,8 @@ func (p *TGetSchemasReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetSchemasReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetSchemasReq) 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 { temp := TPatternOrIdentifier(v) @@ -8847,56 +10093,78 @@ func (p *TGetSchemasReq) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TGetSchemasReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetSchemasReq"); err != nil { +func (p *TGetSchemasReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetSchemasReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetSchemasReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetSchemasReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetSchemasReq) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetSchemasReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(string(*p.CatalogName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } } return err } -func (p *TGetSchemasReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TGetSchemasReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(string(*p.SchemaName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } } return err } +func (p *TGetSchemasReq) Equals(other *TGetSchemasReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { 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 *TGetSchemasReq) String() string { if p == nil { return "" @@ -8938,15 +10206,15 @@ func (p *TGetSchemasResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetSchemasResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetSchemasResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -8954,35 +10222,35 @@ func (p *TGetSchemasResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -8991,60 +10259,71 @@ func (p *TGetSchemasResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetSchemasResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetSchemasResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetSchemasResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetSchemasResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetSchemasResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetSchemasResp"); err != nil { +func (p *TGetSchemasResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetSchemasResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetSchemasResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetSchemasResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetSchemasResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetSchemasResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetSchemasResp) Equals(other *TGetSchemasResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetSchemasResp) String() string { if p == nil { return "" @@ -9123,15 +10402,15 @@ func (p *TGetTablesReq) IsSetTableTypes() bool { return p.TableTypes != nil } -func (p *TGetTablesReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTablesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -9139,65 +10418,65 @@ func (p *TGetTablesReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.LIST { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -9206,16 +10485,16 @@ func (p *TGetTablesReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTablesReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTablesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetTablesReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetTablesReq) 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 { temp := TPatternOrIdentifier(v) @@ -9224,8 +10503,8 @@ func (p *TGetTablesReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetTablesReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetTablesReq) 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 { temp := TPatternOrIdentifier(v) @@ -9234,8 +10513,8 @@ func (p *TGetTablesReq) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TGetTablesReq) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetTablesReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { temp := TPatternOrIdentifier(v) @@ -9244,112 +10523,145 @@ func (p *TGetTablesReq) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TGetTablesReq) ReadField5(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TGetTablesReq) ReadField5(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.TableTypes = tSlice for i := 0; i < size; i ++ { -var _elem26 string - if v, err := iprot.ReadString(); err != nil { +var _elem49 string + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 0: ", err) } else { - _elem26 = v + _elem49 = v } - p.TableTypes = append(p.TableTypes, _elem26) + p.TableTypes = append(p.TableTypes, _elem49) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadListEnd(ctx); err != nil { return thrift.PrependError("error reading list end: ", err) } return nil } -func (p *TGetTablesReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTablesReq"); err != nil { +func (p *TGetTablesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTablesReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTablesReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetTablesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetTablesReq) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetTablesReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(string(*p.CatalogName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } } return err } -func (p *TGetTablesReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TGetTablesReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(string(*p.SchemaName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } } return err } -func (p *TGetTablesReq) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TGetTablesReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetTableName() { - if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(string(*p.TableName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } } return err } -func (p *TGetTablesReq) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TGetTablesReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetTableTypes() { - if err := oprot.WriteFieldBegin("tableTypes", thrift.LIST, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "tableTypes", thrift.LIST, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:tableTypes: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.TableTypes)); err != nil { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TableTypes)); err != nil { return thrift.PrependError("error writing list begin: ", err) } for _, v := range p.TableTypes { - if err := oprot.WriteString(string(v)); err != nil { + 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(); err != nil { + if err := oprot.WriteListEnd(ctx); err != nil { return thrift.PrependError("error writing list end: ", err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:tableTypes: ", p), err) } } return err } +func (p *TGetTablesReq) Equals(other *TGetTablesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + if len(p.TableTypes) != len(other.TableTypes) { return false } + for i, _tgt := range p.TableTypes { + _src50 := other.TableTypes[i] + if _tgt != _src50 { return false } + } + return true +} + func (p *TGetTablesReq) String() string { if p == nil { return "" @@ -9391,15 +10703,15 @@ func (p *TGetTablesResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetTablesResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTablesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -9407,35 +10719,35 @@ func (p *TGetTablesResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -9444,60 +10756,71 @@ func (p *TGetTablesResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTablesResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTablesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetTablesResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetTablesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetTablesResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTablesResp"); err != nil { +func (p *TGetTablesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTablesResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTablesResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetTablesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetTablesResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetTablesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetTablesResp) Equals(other *TGetTablesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetTablesResp) String() string { if p == nil { return "" @@ -9526,15 +10849,15 @@ func (p *TGetTableTypesReq) IsSetSessionHandle() bool { return p.SessionHandle != nil } -func (p *TGetTableTypesReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTableTypesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -9542,25 +10865,25 @@ func (p *TGetTableTypesReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -9569,38 +10892,48 @@ func (p *TGetTableTypesReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTableTypesReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTableTypesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetTableTypesReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTableTypesReq"); err != nil { +func (p *TGetTableTypesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTableTypesReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetTableTypesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } +func (p *TGetTableTypesReq) Equals(other *TGetTableTypesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + return true +} + func (p *TGetTableTypesReq) String() string { if p == nil { return "" @@ -9642,15 +10975,15 @@ func (p *TGetTableTypesResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetTableTypesResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetTableTypesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -9658,35 +10991,35 @@ func (p *TGetTableTypesResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -9695,60 +11028,71 @@ func (p *TGetTableTypesResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetTableTypesResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetTableTypesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetTableTypesResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetTableTypesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetTableTypesResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetTableTypesResp"); err != nil { +func (p *TGetTableTypesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetTableTypesResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetTableTypesResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetTableTypesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetTableTypesResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetTableTypesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetTableTypesResp) Equals(other *TGetTableTypesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetTableTypesResp) String() string { if p == nil { return "" @@ -9829,15 +11173,15 @@ func (p *TGetColumnsReq) IsSetColumnName() bool { return p.ColumnName != nil } -func (p *TGetColumnsReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetColumnsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -9845,65 +11189,65 @@ func (p *TGetColumnsReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 5: if fieldTypeId == thrift.STRING { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField5(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -9912,16 +11256,16 @@ func (p *TGetColumnsReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetColumnsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetColumnsReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetColumnsReq) 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 { temp := TIdentifier(v) @@ -9930,8 +11274,8 @@ func (p *TGetColumnsReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetColumnsReq) 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 { temp := TPatternOrIdentifier(v) @@ -9940,8 +11284,8 @@ func (p *TGetColumnsReq) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsReq) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetColumnsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { temp := TPatternOrIdentifier(v) @@ -9950,8 +11294,8 @@ func (p *TGetColumnsReq) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsReq) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetColumnsReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 5: ", err) } else { temp := TPatternOrIdentifier(v) @@ -9960,82 +11304,116 @@ func (p *TGetColumnsReq) ReadField5(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetColumnsReq"); err != nil { +func (p *TGetColumnsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetColumnsReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetColumnsReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetColumnsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetColumnsReq) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetColumnsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(string(*p.CatalogName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } } return err } -func (p *TGetColumnsReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TGetColumnsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(string(*p.SchemaName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } } return err } -func (p *TGetColumnsReq) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TGetColumnsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetTableName() { - if err := oprot.WriteFieldBegin("tableName", thrift.STRING, 4); err != nil { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } - if err := oprot.WriteString(string(*p.TableName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } } return err } -func (p *TGetColumnsReq) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TGetColumnsReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetColumnName() { - if err := oprot.WriteFieldBegin("columnName", thrift.STRING, 5); err != nil { + if err := oprot.WriteFieldBegin(ctx, "columnName", thrift.STRING, 5); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:columnName: ", p), err) } - if err := oprot.WriteString(string(*p.ColumnName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.ColumnName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.columnName (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 5:columnName: ", p), err) } } return err } +func (p *TGetColumnsReq) Equals(other *TGetColumnsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + if p.ColumnName != other.ColumnName { + if p.ColumnName == nil || other.ColumnName == nil { + return false + } + if (*p.ColumnName) != (*other.ColumnName) { return false } + } + return true +} + func (p *TGetColumnsReq) String() string { if p == nil { return "" @@ -10077,15 +11455,15 @@ func (p *TGetColumnsResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetColumnsResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetColumnsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -10093,35 +11471,35 @@ func (p *TGetColumnsResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -10130,60 +11508,71 @@ func (p *TGetColumnsResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetColumnsResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetColumnsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetColumnsResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetColumnsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetColumnsResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetColumnsResp"); err != nil { +func (p *TGetColumnsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetColumnsResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetColumnsResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetColumnsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetColumnsResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetColumnsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } +func (p *TGetColumnsResp) Equals(other *TGetColumnsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + func (p *TGetColumnsResp) String() string { if p == nil { return "" @@ -10244,8 +11633,8 @@ func (p *TGetFunctionsReq) IsSetSchemaName() bool { return p.SchemaName != nil } -func (p *TGetFunctionsReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetFunctionsReq) 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) } @@ -10253,7 +11642,7 @@ func (p *TGetFunctionsReq) Read(iprot thrift.TProtocol) error { var issetFunctionName bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -10261,56 +11650,56 @@ func (p *TGetFunctionsReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: if fieldTypeId == thrift.STRING { - if err := p.ReadField4(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } issetFunctionName = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetSessionHandle{ @@ -10322,16 +11711,16 @@ func (p *TGetFunctionsReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetFunctionsReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetFunctionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { + if err := p.SessionHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetFunctionsReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetFunctionsReq) 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 { temp := TIdentifier(v) @@ -10340,8 +11729,8 @@ func (p *TGetFunctionsReq) ReadField2(iprot thrift.TProtocol) error { return nil } -func (p *TGetFunctionsReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetFunctionsReq) 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 { temp := TPatternOrIdentifier(v) @@ -10350,8 +11739,8 @@ func (p *TGetFunctionsReq) ReadField3(iprot thrift.TProtocol) error { return nil } -func (p *TGetFunctionsReq) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetFunctionsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { temp := TPatternOrIdentifier(v) @@ -10360,67 +11749,90 @@ func (p *TGetFunctionsReq) ReadField4(iprot thrift.TProtocol) error { return nil } -func (p *TGetFunctionsReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetFunctionsReq"); err != nil { +func (p *TGetFunctionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetFunctionsReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetFunctionsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { + if err := p.SessionHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetFunctionsReq) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetFunctionsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetCatalogName() { - if err := oprot.WriteFieldBegin("catalogName", thrift.STRING, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } - if err := oprot.WriteString(string(*p.CatalogName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } } return err } -func (p *TGetFunctionsReq) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TGetFunctionsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSchemaName() { - if err := oprot.WriteFieldBegin("schemaName", thrift.STRING, 3); err != nil { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } - if err := oprot.WriteString(string(*p.SchemaName)); err != nil { + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } } return err } -func (p *TGetFunctionsReq) writeField4(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("functionName", thrift.STRING, 4); err != nil { +func (p *TGetFunctionsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "functionName", thrift.STRING, 4); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:functionName: ", p), err) } - if err := oprot.WriteString(string(p.FunctionName)); err != nil { + if err := oprot.WriteString(ctx, string(p.FunctionName)); err != nil { return thrift.PrependError(fmt.Sprintf("%T.functionName (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 4:functionName: ", p), err) } return err } +func (p *TGetFunctionsReq) Equals(other *TGetFunctionsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.FunctionName != other.FunctionName { return false } + return true +} + func (p *TGetFunctionsReq) String() string { if p == nil { return "" @@ -10462,15 +11874,15 @@ func (p *TGetFunctionsResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetFunctionsResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetFunctionsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -10478,35 +11890,35 @@ func (p *TGetFunctionsResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -10515,252 +11927,147 @@ func (p *TGetFunctionsResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetFunctionsResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetFunctionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetFunctionsResp) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetFunctionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetFunctionsResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetFunctionsResp"); err != nil { +func (p *TGetFunctionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetFunctionsResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetFunctionsResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetFunctionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetFunctionsResp) writeField2(oprot thrift.TProtocol) (err error) { +func (p *TGetFunctionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetOperationHandle() { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 2); err != nil { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } } return err } -func (p *TGetFunctionsResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) -} - -// Attributes: -// - OperationHandle -type TGetOperationStatusReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` -} - -func NewTGetOperationStatusReq() *TGetOperationStatusReq { - return &TGetOperationStatusReq{} -} - -var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle -func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TGetOperationStatusReq_OperationHandle_DEFAULT - } -return p.OperationHandle -} -func (p *TGetOperationStatusReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil -} - -func (p *TGetOperationStatusReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - return nil -} - -func (p *TGetOperationStatusReq) ReadField1(iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } - return nil -} - -func (p *TGetOperationStatusReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetOperationStatusReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *TGetOperationStatusReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) +func (p *TGetFunctionsResp) Equals(other *TGetFunctionsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } - return err + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } -func (p *TGetOperationStatusReq) String() string { +func (p *TGetFunctionsResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) + return fmt.Sprintf("TGetFunctionsResp(%+v)", *p) } // Attributes: -// - Status -// - OperationState -// - SqlState -// - ErrorCode -// - ErrorMessage -type TGetOperationStatusResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` - SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` - ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` - ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` +// - SessionHandle +// - CatalogName +// - SchemaName +// - TableName +type TGetPrimaryKeysReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + CatalogName *TIdentifier `thrift:"catalogName,2" db:"catalogName" json:"catalogName,omitempty"` + SchemaName *TIdentifier `thrift:"schemaName,3" db:"schemaName" json:"schemaName,omitempty"` + TableName *TIdentifier `thrift:"tableName,4" db:"tableName" json:"tableName,omitempty"` } -func NewTGetOperationStatusResp() *TGetOperationStatusResp { - return &TGetOperationStatusResp{} +func NewTGetPrimaryKeysReq() *TGetPrimaryKeysReq { + return &TGetPrimaryKeysReq{} } -var TGetOperationStatusResp_Status_DEFAULT *TStatus -func (p *TGetOperationStatusResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetOperationStatusResp_Status_DEFAULT - } -return p.Status -} -var TGetOperationStatusResp_OperationState_DEFAULT TOperationState -func (p *TGetOperationStatusResp) GetOperationState() TOperationState { - if !p.IsSetOperationState() { - return TGetOperationStatusResp_OperationState_DEFAULT +var TGetPrimaryKeysReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TGetPrimaryKeysReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TGetPrimaryKeysReq_SessionHandle_DEFAULT } -return *p.OperationState +return p.SessionHandle } -var TGetOperationStatusResp_SqlState_DEFAULT string -func (p *TGetOperationStatusResp) GetSqlState() string { - if !p.IsSetSqlState() { - return TGetOperationStatusResp_SqlState_DEFAULT +var TGetPrimaryKeysReq_CatalogName_DEFAULT TIdentifier +func (p *TGetPrimaryKeysReq) GetCatalogName() TIdentifier { + if !p.IsSetCatalogName() { + return TGetPrimaryKeysReq_CatalogName_DEFAULT } -return *p.SqlState +return *p.CatalogName } -var TGetOperationStatusResp_ErrorCode_DEFAULT int32 -func (p *TGetOperationStatusResp) GetErrorCode() int32 { - if !p.IsSetErrorCode() { - return TGetOperationStatusResp_ErrorCode_DEFAULT +var TGetPrimaryKeysReq_SchemaName_DEFAULT TIdentifier +func (p *TGetPrimaryKeysReq) GetSchemaName() TIdentifier { + if !p.IsSetSchemaName() { + return TGetPrimaryKeysReq_SchemaName_DEFAULT } -return *p.ErrorCode +return *p.SchemaName } -var TGetOperationStatusResp_ErrorMessage_DEFAULT string -func (p *TGetOperationStatusResp) GetErrorMessage() string { - if !p.IsSetErrorMessage() { - return TGetOperationStatusResp_ErrorMessage_DEFAULT +var TGetPrimaryKeysReq_TableName_DEFAULT TIdentifier +func (p *TGetPrimaryKeysReq) GetTableName() TIdentifier { + if !p.IsSetTableName() { + return TGetPrimaryKeysReq_TableName_DEFAULT } -return *p.ErrorMessage -} -func (p *TGetOperationStatusResp) IsSetStatus() bool { - return p.Status != nil +return *p.TableName } - -func (p *TGetOperationStatusResp) IsSetOperationState() bool { - return p.OperationState != nil +func (p *TGetPrimaryKeysReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil } -func (p *TGetOperationStatusResp) IsSetSqlState() bool { - return p.SqlState != nil +func (p *TGetPrimaryKeysReq) IsSetCatalogName() bool { + return p.CatalogName != nil } -func (p *TGetOperationStatusResp) IsSetErrorCode() bool { - return p.ErrorCode != nil +func (p *TGetPrimaryKeysReq) IsSetSchemaName() bool { + return p.SchemaName != nil } -func (p *TGetOperationStatusResp) IsSetErrorMessage() bool { - return p.ErrorMessage != nil +func (p *TGetPrimaryKeysReq) IsSetTableName() bool { + return p.TableName != nil } -func (p *TGetOperationStatusResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetPrimaryKeysReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -10768,231 +12075,242 @@ func (p *TGetOperationStatusResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetStatus = true + issetSessionHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: - if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField3(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: - if fieldTypeId == thrift.I32 { - if err := p.ReadField4(iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 5: if fieldTypeId == thrift.STRING { - if err := p.ReadField5(iprot); err != nil { + if err := p.ReadField4(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); } return nil } -func (p *TGetOperationStatusResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +func (p *TGetPrimaryKeysReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TGetOperationStatusResp) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetPrimaryKeysReq) 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 { - temp := TOperationState(v) - p.OperationState = &temp + temp := TIdentifier(v) + p.CatalogName = &temp } return nil } -func (p *TGetOperationStatusResp) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { +func (p *TGetPrimaryKeysReq) 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.SqlState = &v + temp := TIdentifier(v) + p.SchemaName = &temp } return nil } -func (p *TGetOperationStatusResp) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetPrimaryKeysReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { return thrift.PrependError("error reading field 4: ", err) } else { - p.ErrorCode = &v -} - return nil -} - -func (p *TGetOperationStatusResp) ReadField5(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 5: ", err) -} else { - p.ErrorMessage = &v + temp := TIdentifier(v) + p.TableName = &temp } return nil } -func (p *TGetOperationStatusResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetOperationStatusResp"); err != nil { +func (p *TGetPrimaryKeysReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetOperationStatusResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) +func (p *TGetPrimaryKeysReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TGetOperationStatusResp) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetOperationState() { - if err := oprot.WriteFieldBegin("operationState", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) } - if err := oprot.WriteI32(int32(*p.OperationState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) } +func (p *TGetPrimaryKeysReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "catalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:catalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.CatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.catalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:catalogName: ", p), err) } } return err } -func (p *TGetOperationStatusResp) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetSqlState() { - if err := oprot.WriteFieldBegin("sqlState", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } - if err := oprot.WriteString(string(*p.SqlState)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } +func (p *TGetPrimaryKeysReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "schemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:schemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schemaName: ", p), err) } } return err } -func (p *TGetOperationStatusResp) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetErrorCode() { - if err := oprot.WriteFieldBegin("errorCode", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } - if err := oprot.WriteI32(int32(*p.ErrorCode)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } +func (p *TGetPrimaryKeysReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTableName() { + if err := oprot.WriteFieldBegin(ctx, "tableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:tableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tableName: ", p), err) } } return err } -func (p *TGetOperationStatusResp) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetErrorMessage() { - if err := oprot.WriteFieldBegin("errorMessage", thrift.STRING, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } - if err := oprot.WriteString(string(*p.ErrorMessage)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } +func (p *TGetPrimaryKeysReq) Equals(other *TGetPrimaryKeysReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false } - return err + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.CatalogName != other.CatalogName { + if p.CatalogName == nil || other.CatalogName == nil { + return false + } + if (*p.CatalogName) != (*other.CatalogName) { return false } + } + if p.SchemaName != other.SchemaName { + if p.SchemaName == nil || other.SchemaName == nil { + return false + } + if (*p.SchemaName) != (*other.SchemaName) { return false } + } + if p.TableName != other.TableName { + if p.TableName == nil || other.TableName == nil { + return false + } + if (*p.TableName) != (*other.TableName) { return false } + } + return true } -func (p *TGetOperationStatusResp) String() string { +func (p *TGetPrimaryKeysReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) + return fmt.Sprintf("TGetPrimaryKeysReq(%+v)", *p) } // Attributes: +// - Status // - OperationHandle -type TCancelOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` +type TGetPrimaryKeysResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` } -func NewTCancelOperationReq() *TCancelOperationReq { - return &TCancelOperationReq{} +func NewTGetPrimaryKeysResp() *TGetPrimaryKeysResp { + return &TGetPrimaryKeysResp{} } -var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle -func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle { +var TGetPrimaryKeysResp_Status_DEFAULT *TStatus +func (p *TGetPrimaryKeysResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TGetPrimaryKeysResp_Status_DEFAULT + } +return p.Status +} +var TGetPrimaryKeysResp_OperationHandle_DEFAULT *TOperationHandle +func (p *TGetPrimaryKeysResp) GetOperationHandle() *TOperationHandle { if !p.IsSetOperationHandle() { - return TCancelOperationReq_OperationHandle_DEFAULT + return TGetPrimaryKeysResp_OperationHandle_DEFAULT } return p.OperationHandle } -func (p *TCancelOperationReq) IsSetOperationHandle() bool { +func (p *TGetPrimaryKeysResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TGetPrimaryKeysResp) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TCancelOperationReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetPrimaryKeysResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetOperationHandle bool = false; + var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11000,102 +12318,223 @@ func (p *TCancelOperationReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetOperationHandle = true + issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + 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(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetPrimaryKeysResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TCancelOperationReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetPrimaryKeysResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TCancelOperationReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCancelOperationReq"); err != nil { +func (p *TGetPrimaryKeysResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetPrimaryKeysResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCancelOperationReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) +func (p *TGetPrimaryKeysResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TCancelOperationReq) String() string { +func (p *TGetPrimaryKeysResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err +} + +func (p *TGetPrimaryKeysResp) Equals(other *TGetPrimaryKeysResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + +func (p *TGetPrimaryKeysResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TCancelOperationReq(%+v)", *p) + return fmt.Sprintf("TGetPrimaryKeysResp(%+v)", *p) } // Attributes: -// - Status -type TCancelOperationResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +// - SessionHandle +// - ParentCatalogName +// - ParentSchemaName +// - ParentTableName +// - ForeignCatalogName +// - ForeignSchemaName +// - ForeignTableName +type TGetCrossReferenceReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + ParentCatalogName *TIdentifier `thrift:"parentCatalogName,2" db:"parentCatalogName" json:"parentCatalogName,omitempty"` + ParentSchemaName *TIdentifier `thrift:"parentSchemaName,3" db:"parentSchemaName" json:"parentSchemaName,omitempty"` + ParentTableName *TIdentifier `thrift:"parentTableName,4" db:"parentTableName" json:"parentTableName,omitempty"` + ForeignCatalogName *TIdentifier `thrift:"foreignCatalogName,5" db:"foreignCatalogName" json:"foreignCatalogName,omitempty"` + ForeignSchemaName *TIdentifier `thrift:"foreignSchemaName,6" db:"foreignSchemaName" json:"foreignSchemaName,omitempty"` + ForeignTableName *TIdentifier `thrift:"foreignTableName,7" db:"foreignTableName" json:"foreignTableName,omitempty"` } -func NewTCancelOperationResp() *TCancelOperationResp { - return &TCancelOperationResp{} +func NewTGetCrossReferenceReq() *TGetCrossReferenceReq { + return &TGetCrossReferenceReq{} } -var TCancelOperationResp_Status_DEFAULT *TStatus -func (p *TCancelOperationResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelOperationResp_Status_DEFAULT +var TGetCrossReferenceReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TGetCrossReferenceReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TGetCrossReferenceReq_SessionHandle_DEFAULT } -return p.Status +return p.SessionHandle } -func (p *TCancelOperationResp) IsSetStatus() bool { - return p.Status != nil +var TGetCrossReferenceReq_ParentCatalogName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetParentCatalogName() TIdentifier { + if !p.IsSetParentCatalogName() { + return TGetCrossReferenceReq_ParentCatalogName_DEFAULT + } +return *p.ParentCatalogName +} +var TGetCrossReferenceReq_ParentSchemaName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetParentSchemaName() TIdentifier { + if !p.IsSetParentSchemaName() { + return TGetCrossReferenceReq_ParentSchemaName_DEFAULT + } +return *p.ParentSchemaName +} +var TGetCrossReferenceReq_ParentTableName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetParentTableName() TIdentifier { + if !p.IsSetParentTableName() { + return TGetCrossReferenceReq_ParentTableName_DEFAULT + } +return *p.ParentTableName +} +var TGetCrossReferenceReq_ForeignCatalogName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetForeignCatalogName() TIdentifier { + if !p.IsSetForeignCatalogName() { + return TGetCrossReferenceReq_ForeignCatalogName_DEFAULT + } +return *p.ForeignCatalogName +} +var TGetCrossReferenceReq_ForeignSchemaName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetForeignSchemaName() TIdentifier { + if !p.IsSetForeignSchemaName() { + return TGetCrossReferenceReq_ForeignSchemaName_DEFAULT + } +return *p.ForeignSchemaName +} +var TGetCrossReferenceReq_ForeignTableName_DEFAULT TIdentifier +func (p *TGetCrossReferenceReq) GetForeignTableName() TIdentifier { + if !p.IsSetForeignTableName() { + return TGetCrossReferenceReq_ForeignTableName_DEFAULT + } +return *p.ForeignTableName +} +func (p *TGetCrossReferenceReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil +} + +func (p *TGetCrossReferenceReq) IsSetParentCatalogName() bool { + return p.ParentCatalogName != nil +} + +func (p *TGetCrossReferenceReq) IsSetParentSchemaName() bool { + return p.ParentSchemaName != nil +} + +func (p *TGetCrossReferenceReq) IsSetParentTableName() bool { + return p.ParentTableName != nil +} + +func (p *TGetCrossReferenceReq) IsSetForeignCatalogName() bool { + return p.ForeignCatalogName != nil +} + +func (p *TGetCrossReferenceReq) IsSetForeignSchemaName() bool { + return p.ForeignSchemaName != nil +} + +func (p *TGetCrossReferenceReq) IsSetForeignTableName() bool { + return p.ForeignTableName != nil } -func (p *TCancelOperationResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetCrossReferenceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetSessionHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11103,205 +12542,359 @@ func (p *TCancelOperationResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + 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.STRING { + 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.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { return err } - issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); } return nil } -func (p *TCancelOperationResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +func (p *TGetCrossReferenceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) } return nil } -func (p *TCancelOperationResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCancelOperationResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } +func (p *TGetCrossReferenceReq) 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 { + temp := TIdentifier(v) + p.ParentCatalogName = &temp +} return nil } -func (p *TCancelOperationResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err +func (p *TGetCrossReferenceReq) 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 { + temp := TIdentifier(v) + p.ParentSchemaName = &temp } - -func (p *TCancelOperationResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCancelOperationResp(%+v)", *p) + return nil } -// Attributes: -// - OperationHandle -type TCloseOperationReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` +func (p *TGetCrossReferenceReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := TIdentifier(v) + p.ParentTableName = &temp } - -func NewTCloseOperationReq() *TCloseOperationReq { - return &TCloseOperationReq{} + return nil } -var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle -func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TCloseOperationReq_OperationHandle_DEFAULT - } -return p.OperationHandle +func (p *TGetCrossReferenceReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := TIdentifier(v) + p.ForeignCatalogName = &temp } -func (p *TCloseOperationReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + return nil } -func (p *TCloseOperationReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetOperationHandle bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetOperationHandle = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } +func (p *TGetCrossReferenceReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := TIdentifier(v) + p.ForeignSchemaName = &temp +} return nil } -func (p *TCloseOperationReq) ReadField1(iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) - } +func (p *TGetCrossReferenceReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + temp := TIdentifier(v) + p.ForeignTableName = &temp +} return nil } -func (p *TCloseOperationReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCloseOperationReq"); err != nil { +func (p *TGetCrossReferenceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + 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(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCloseOperationReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) +func (p *TGetCrossReferenceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } return err } -func (p *TCloseOperationReq) String() string { +func (p *TGetCrossReferenceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetParentCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "parentCatalogName", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parentCatalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentCatalogName (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parentCatalogName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetParentSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "parentSchemaName", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parentSchemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentSchemaName (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parentSchemaName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetParentTableName() { + if err := oprot.WriteFieldBegin(ctx, "parentTableName", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:parentTableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ParentTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.parentTableName (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:parentTableName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetForeignCatalogName() { + if err := oprot.WriteFieldBegin(ctx, "foreignCatalogName", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:foreignCatalogName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignCatalogName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignCatalogName (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:foreignCatalogName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetForeignSchemaName() { + if err := oprot.WriteFieldBegin(ctx, "foreignSchemaName", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:foreignSchemaName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignSchemaName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignSchemaName (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:foreignSchemaName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetForeignTableName() { + if err := oprot.WriteFieldBegin(ctx, "foreignTableName", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:foreignTableName: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ForeignTableName)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.foreignTableName (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:foreignTableName: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceReq) Equals(other *TGetCrossReferenceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.ParentCatalogName != other.ParentCatalogName { + if p.ParentCatalogName == nil || other.ParentCatalogName == nil { + return false + } + if (*p.ParentCatalogName) != (*other.ParentCatalogName) { return false } + } + if p.ParentSchemaName != other.ParentSchemaName { + if p.ParentSchemaName == nil || other.ParentSchemaName == nil { + return false + } + if (*p.ParentSchemaName) != (*other.ParentSchemaName) { return false } + } + if p.ParentTableName != other.ParentTableName { + if p.ParentTableName == nil || other.ParentTableName == nil { + return false + } + if (*p.ParentTableName) != (*other.ParentTableName) { return false } + } + if p.ForeignCatalogName != other.ForeignCatalogName { + if p.ForeignCatalogName == nil || other.ForeignCatalogName == nil { + return false + } + if (*p.ForeignCatalogName) != (*other.ForeignCatalogName) { return false } + } + if p.ForeignSchemaName != other.ForeignSchemaName { + if p.ForeignSchemaName == nil || other.ForeignSchemaName == nil { + return false + } + if (*p.ForeignSchemaName) != (*other.ForeignSchemaName) { return false } + } + if p.ForeignTableName != other.ForeignTableName { + if p.ForeignTableName == nil || other.ForeignTableName == nil { + return false + } + if (*p.ForeignTableName) != (*other.ForeignTableName) { return false } + } + return true +} + +func (p *TGetCrossReferenceReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TCloseOperationReq(%+v)", *p) + return fmt.Sprintf("TGetCrossReferenceReq(%+v)", *p) } // Attributes: // - Status -type TCloseOperationResp struct { +// - OperationHandle +type TGetCrossReferenceResp struct { Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + OperationHandle *TOperationHandle `thrift:"operationHandle,2" db:"operationHandle" json:"operationHandle,omitempty"` } -func NewTCloseOperationResp() *TCloseOperationResp { - return &TCloseOperationResp{} +func NewTGetCrossReferenceResp() *TGetCrossReferenceResp { + return &TGetCrossReferenceResp{} } -var TCloseOperationResp_Status_DEFAULT *TStatus -func (p *TCloseOperationResp) GetStatus() *TStatus { +var TGetCrossReferenceResp_Status_DEFAULT *TStatus +func (p *TGetCrossReferenceResp) GetStatus() *TStatus { if !p.IsSetStatus() { - return TCloseOperationResp_Status_DEFAULT + return TGetCrossReferenceResp_Status_DEFAULT } return p.Status } -func (p *TCloseOperationResp) IsSetStatus() bool { +var TGetCrossReferenceResp_OperationHandle_DEFAULT *TOperationHandle +func (p *TGetCrossReferenceResp) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TGetCrossReferenceResp_OperationHandle_DEFAULT + } +return p.OperationHandle +} +func (p *TGetCrossReferenceResp) IsSetStatus() bool { return p.Status != nil } -func (p *TCloseOperationResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetCrossReferenceResp) IsSetOperationHandle() bool { + return p.OperationHandle != nil +} + +func (p *TGetCrossReferenceResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11309,25 +12902,35 @@ func (p *TCloseOperationResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + 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(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetStatus{ @@ -11336,75 +12939,121 @@ func (p *TCloseOperationResp) Read(iprot thrift.TProtocol) error { return nil } -func (p *TCloseOperationResp) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetCrossReferenceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { + if err := p.Status.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TCloseOperationResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCloseOperationResp"); err != nil { +func (p *TGetCrossReferenceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetCrossReferenceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetCrossReferenceResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCloseOperationResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { +func (p *TGetCrossReferenceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { + if err := p.Status.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TCloseOperationResp) String() string { +func (p *TGetCrossReferenceResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOperationHandle() { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationHandle: ", p), err) } + } + return err +} + +func (p *TGetCrossReferenceResp) Equals(other *TGetCrossReferenceResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + +func (p *TGetCrossReferenceResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TCloseOperationResp(%+v)", *p) + return fmt.Sprintf("TGetCrossReferenceResp(%+v)", *p) } // Attributes: // - OperationHandle -type TGetResultSetMetadataReq struct { +// - GetProgressUpdate +type TGetOperationStatusReq struct { OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + GetProgressUpdate *bool `thrift:"getProgressUpdate,2" db:"getProgressUpdate" json:"getProgressUpdate,omitempty"` } -func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq { - return &TGetResultSetMetadataReq{} +func NewTGetOperationStatusReq() *TGetOperationStatusReq { + return &TGetOperationStatusReq{} } -var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle -func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle { +var TGetOperationStatusReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TGetOperationStatusReq) GetOperationHandle() *TOperationHandle { if !p.IsSetOperationHandle() { - return TGetResultSetMetadataReq_OperationHandle_DEFAULT + return TGetOperationStatusReq_OperationHandle_DEFAULT } return p.OperationHandle } -func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool { +var TGetOperationStatusReq_GetProgressUpdate_DEFAULT bool +func (p *TGetOperationStatusReq) GetGetProgressUpdate() bool { + if !p.IsSetGetProgressUpdate() { + return TGetOperationStatusReq_GetProgressUpdate_DEFAULT + } +return *p.GetProgressUpdate +} +func (p *TGetOperationStatusReq) IsSetOperationHandle() bool { return p.OperationHandle != nil } -func (p *TGetResultSetMetadataReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetOperationStatusReq) IsSetGetProgressUpdate() bool { + return p.GetProgressUpdate != nil +} + +func (p *TGetOperationStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } var issetOperationHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11412,25 +13061,35 @@ func (p *TGetResultSetMetadataReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } issetOperationHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + 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(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } if !issetOperationHandle{ @@ -11439,250 +13098,230 @@ func (p *TGetResultSetMetadataReq) Read(iprot thrift.TProtocol) error { return nil } -func (p *TGetResultSetMetadataReq) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetOperationStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { + if err := p.OperationHandle.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetResultSetMetadataReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetResultSetMetadataReq"); err != nil { +func (p *TGetOperationStatusReq) 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.GetProgressUpdate = &v +} + return nil +} + +func (p *TGetOperationStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetResultSetMetadataReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil { +func (p *TGetOperationStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { + if err := p.OperationHandle.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } return err } -func (p *TGetResultSetMetadataReq) String() string { +func (p *TGetOperationStatusReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetGetProgressUpdate() { + if err := oprot.WriteFieldBegin(ctx, "getProgressUpdate", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:getProgressUpdate: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.GetProgressUpdate)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.getProgressUpdate (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:getProgressUpdate: ", p), err) } + } + return err +} + +func (p *TGetOperationStatusReq) Equals(other *TGetOperationStatusReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if p.GetProgressUpdate != other.GetProgressUpdate { + if p.GetProgressUpdate == nil || other.GetProgressUpdate == nil { + return false + } + if (*p.GetProgressUpdate) != (*other.GetProgressUpdate) { return false } + } + return true +} + +func (p *TGetOperationStatusReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) + return fmt.Sprintf("TGetOperationStatusReq(%+v)", *p) } // Attributes: // - Status -// - Schema -type TGetResultSetMetadataResp struct { +// - OperationState +// - SqlState +// - ErrorCode +// - ErrorMessage +// - TaskStatus +// - OperationStarted +// - OperationCompleted +// - HasResultSet +// - ProgressUpdateResponse +type TGetOperationStatusResp struct { Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` + OperationState *TOperationState `thrift:"operationState,2" db:"operationState" json:"operationState,omitempty"` + SqlState *string `thrift:"sqlState,3" db:"sqlState" json:"sqlState,omitempty"` + ErrorCode *int32 `thrift:"errorCode,4" db:"errorCode" json:"errorCode,omitempty"` + ErrorMessage *string `thrift:"errorMessage,5" db:"errorMessage" json:"errorMessage,omitempty"` + TaskStatus *string `thrift:"taskStatus,6" db:"taskStatus" json:"taskStatus,omitempty"` + OperationStarted *int64 `thrift:"operationStarted,7" db:"operationStarted" json:"operationStarted,omitempty"` + OperationCompleted *int64 `thrift:"operationCompleted,8" db:"operationCompleted" json:"operationCompleted,omitempty"` + HasResultSet *bool `thrift:"hasResultSet,9" db:"hasResultSet" json:"hasResultSet,omitempty"` + ProgressUpdateResponse *TProgressUpdateResp `thrift:"progressUpdateResponse,10" db:"progressUpdateResponse" json:"progressUpdateResponse,omitempty"` } -func NewTGetResultSetMetadataResp() *TGetResultSetMetadataResp { - return &TGetResultSetMetadataResp{} +func NewTGetOperationStatusResp() *TGetOperationStatusResp { + return &TGetOperationStatusResp{} } -var TGetResultSetMetadataResp_Status_DEFAULT *TStatus -func (p *TGetResultSetMetadataResp) GetStatus() *TStatus { +var TGetOperationStatusResp_Status_DEFAULT *TStatus +func (p *TGetOperationStatusResp) GetStatus() *TStatus { if !p.IsSetStatus() { - return TGetResultSetMetadataResp_Status_DEFAULT + return TGetOperationStatusResp_Status_DEFAULT } return p.Status } -var TGetResultSetMetadataResp_Schema_DEFAULT *TTableSchema -func (p *TGetResultSetMetadataResp) GetSchema() *TTableSchema { - if !p.IsSetSchema() { - return TGetResultSetMetadataResp_Schema_DEFAULT +var TGetOperationStatusResp_OperationState_DEFAULT TOperationState +func (p *TGetOperationStatusResp) GetOperationState() TOperationState { + if !p.IsSetOperationState() { + return TGetOperationStatusResp_OperationState_DEFAULT } -return p.Schema +return *p.OperationState } -func (p *TGetResultSetMetadataResp) IsSetStatus() bool { - return p.Status != nil +var TGetOperationStatusResp_SqlState_DEFAULT string +func (p *TGetOperationStatusResp) GetSqlState() string { + if !p.IsSetSqlState() { + return TGetOperationStatusResp_SqlState_DEFAULT + } +return *p.SqlState } - -func (p *TGetResultSetMetadataResp) IsSetSchema() bool { - return p.Schema != nil +var TGetOperationStatusResp_ErrorCode_DEFAULT int32 +func (p *TGetOperationStatusResp) GetErrorCode() int32 { + if !p.IsSetErrorCode() { + return TGetOperationStatusResp_ErrorCode_DEFAULT + } +return *p.ErrorCode } - -func (p *TGetResultSetMetadataResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) +var TGetOperationStatusResp_ErrorMessage_DEFAULT string +func (p *TGetOperationStatusResp) GetErrorMessage() string { + if !p.IsSetErrorMessage() { + return TGetOperationStatusResp_ErrorMessage_DEFAULT } - - var issetStatus bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField2(iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil +return *p.ErrorMessage } - -func (p *TGetResultSetMetadataResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +var TGetOperationStatusResp_TaskStatus_DEFAULT string +func (p *TGetOperationStatusResp) GetTaskStatus() string { + if !p.IsSetTaskStatus() { + return TGetOperationStatusResp_TaskStatus_DEFAULT } - return nil +return *p.TaskStatus } - -func (p *TGetResultSetMetadataResp) ReadField2(iprot thrift.TProtocol) error { - p.Schema = &TTableSchema{} - if err := p.Schema.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) +var TGetOperationStatusResp_OperationStarted_DEFAULT int64 +func (p *TGetOperationStatusResp) GetOperationStarted() int64 { + if !p.IsSetOperationStarted() { + return TGetOperationStatusResp_OperationStarted_DEFAULT } - return nil +return *p.OperationStarted } - -func (p *TGetResultSetMetadataResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetResultSetMetadataResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } +var TGetOperationStatusResp_OperationCompleted_DEFAULT int64 +func (p *TGetOperationStatusResp) GetOperationCompleted() int64 { + if !p.IsSetOperationCompleted() { + return TGetOperationStatusResp_OperationCompleted_DEFAULT } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil +return *p.OperationCompleted } - -func (p *TGetResultSetMetadataResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) +var TGetOperationStatusResp_HasResultSet_DEFAULT bool +func (p *TGetOperationStatusResp) GetHasResultSet() bool { + if !p.IsSetHasResultSet() { + return TGetOperationStatusResp_HasResultSet_DEFAULT } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err +return *p.HasResultSet } - -func (p *TGetResultSetMetadataResp) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetSchema() { - if err := oprot.WriteFieldBegin("schema", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } - if err := p.Schema.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } +var TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT *TProgressUpdateResp +func (p *TGetOperationStatusResp) GetProgressUpdateResponse() *TProgressUpdateResp { + if !p.IsSetProgressUpdateResponse() { + return TGetOperationStatusResp_ProgressUpdateResponse_DEFAULT } - return err +return p.ProgressUpdateResponse } - -func (p *TGetResultSetMetadataResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) +func (p *TGetOperationStatusResp) IsSetStatus() bool { + return p.Status != nil } -// Attributes: -// - OperationHandle -// - Orientation -// - MaxRows -// - FetchType -type TFetchResultsReq struct { - OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` - Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` - MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` - FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType,omitempty"` +func (p *TGetOperationStatusResp) IsSetOperationState() bool { + return p.OperationState != nil } -func NewTFetchResultsReq() *TFetchResultsReq { - return &TFetchResultsReq{ -Orientation: 0, +func (p *TGetOperationStatusResp) IsSetSqlState() bool { + return p.SqlState != nil } + +func (p *TGetOperationStatusResp) IsSetErrorCode() bool { + return p.ErrorCode != nil } -var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle -func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle { - if !p.IsSetOperationHandle() { - return TFetchResultsReq_OperationHandle_DEFAULT - } -return p.OperationHandle +func (p *TGetOperationStatusResp) IsSetErrorMessage() bool { + return p.ErrorMessage != nil } -func (p *TFetchResultsReq) GetOrientation() TFetchOrientation { - return p.Orientation +func (p *TGetOperationStatusResp) IsSetTaskStatus() bool { + return p.TaskStatus != nil } -func (p *TFetchResultsReq) GetMaxRows() int64 { - return p.MaxRows +func (p *TGetOperationStatusResp) IsSetOperationStarted() bool { + return p.OperationStarted != nil } -var TFetchResultsReq_FetchType_DEFAULT int16 = 0 -func (p *TFetchResultsReq) GetFetchType() int16 { - return p.FetchType +func (p *TGetOperationStatusResp) IsSetOperationCompleted() bool { + return p.OperationCompleted != nil } -func (p *TFetchResultsReq) IsSetOperationHandle() bool { - return p.OperationHandle != nil + +func (p *TGetOperationStatusResp) IsSetHasResultSet() bool { + return p.HasResultSet != nil } -func (p *TFetchResultsReq) IsSetFetchType() bool { - return p.FetchType != TFetchResultsReq_FetchType_DEFAULT +func (p *TGetOperationStatusResp) IsSetProgressUpdateResponse() bool { + return p.ProgressUpdateResponse != nil } -func (p *TFetchResultsReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetOperationStatusResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetOperationHandle bool = false; - var issetOrientation bool = false; - var issetMaxRows bool = false; + var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11690,229 +13329,450 @@ func (p *TFetchResultsReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetOperationHandle = true + issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: if fieldTypeId == thrift.I32 { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField2(ctx, iprot); err != nil { return err } - issetOrientation = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 3: - if fieldTypeId == thrift.I64 { - if err := p.ReadField3(iprot); err != nil { + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { return err } - issetMaxRows = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 4: - if fieldTypeId == thrift.I16 { - if err := p.ReadField4(iprot); err != nil { + 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.STRING { + 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.STRING { + 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.I64 { + 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.I64 { + 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.BOOL { + 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(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetOperationHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); - } - if !issetOrientation{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")); - } - if !issetMaxRows{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); } return nil } -func (p *TFetchResultsReq) ReadField1(iprot thrift.TProtocol) error { - p.OperationHandle = &TOperationHandle{} - if err := p.OperationHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) +func (p *TGetOperationStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TFetchResultsReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI32(); err != nil { +func (p *TGetOperationStatusResp) 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 := TFetchOrientation(v) - p.Orientation = temp + temp := TOperationState(v) + p.OperationState = &temp } return nil } -func (p *TFetchResultsReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI64(); err != nil { +func (p *TGetOperationStatusResp) 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.MaxRows = v + p.SqlState = &v } return nil } -func (p *TFetchResultsReq) ReadField4(iprot thrift.TProtocol) error { - if v, err := iprot.ReadI16(); err != nil { +func (p *TGetOperationStatusResp) 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.FetchType = v + p.ErrorCode = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMessage = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.TaskStatus = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.OperationStarted = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.OperationCompleted = &v +} + return nil +} + +func (p *TGetOperationStatusResp) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.HasResultSet = &v +} + return nil } + +func (p *TGetOperationStatusResp) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.ProgressUpdateResponse = &TProgressUpdateResp{} + if err := p.ProgressUpdateResponse.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ProgressUpdateResponse), err) + } return nil } -func (p *TFetchResultsReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TFetchResultsReq"); err != nil { +func (p *TGetOperationStatusResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetOperationStatusResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - } - if err := oprot.WriteFieldStop(); err != nil { + 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(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TFetchResultsReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("operationHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } - if err := p.OperationHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) +func (p *TGetOperationStatusResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TFetchResultsReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("orientation", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) } - if err := oprot.WriteI32(int32(p.Orientation)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) } +func (p *TGetOperationStatusResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOperationState() { + if err := oprot.WriteFieldBegin(ctx, "operationState", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:operationState: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.OperationState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationState (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:operationState: ", p), err) } + } return err } -func (p *TFetchResultsReq) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("maxRows", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) } - if err := oprot.WriteI64(int64(p.MaxRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) } +func (p *TGetOperationStatusResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSqlState() { + if err := oprot.WriteFieldBegin(ctx, "sqlState", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sqlState: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.SqlState)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sqlState (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sqlState: ", p), err) } + } return err } -func (p *TFetchResultsReq) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetFetchType() { - if err := oprot.WriteFieldBegin("fetchType", thrift.I16, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) } - if err := oprot.WriteI16(int16(p.FetchType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) } +func (p *TGetOperationStatusResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorCode() { + if err := oprot.WriteFieldBegin(ctx, "errorCode", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:errorCode: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorCode (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:errorCode: ", p), err) } } return err } -func (p *TFetchResultsReq) String() string { - if p == nil { - return "" +func (p *TGetOperationStatusResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMessage() { + if err := oprot.WriteFieldBegin(ctx, "errorMessage", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:errorMessage: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.ErrorMessage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.errorMessage (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:errorMessage: ", p), err) } } - return fmt.Sprintf("TFetchResultsReq(%+v)", *p) + return err } -// Attributes: -// - Status -// - HasMoreRows -// - Results -type TFetchResultsResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` - Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` +func (p *TGetOperationStatusResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTaskStatus() { + if err := oprot.WriteFieldBegin(ctx, "taskStatus", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:taskStatus: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.TaskStatus)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.taskStatus (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:taskStatus: ", p), err) } + } + return err } -func NewTFetchResultsResp() *TFetchResultsResp { - return &TFetchResultsResp{} +func (p *TGetOperationStatusResp) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOperationStarted() { + if err := oprot.WriteFieldBegin(ctx, "operationStarted", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:operationStarted: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.OperationStarted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationStarted (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:operationStarted: ", p), err) } + } + return err } -var TFetchResultsResp_Status_DEFAULT *TStatus -func (p *TFetchResultsResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TFetchResultsResp_Status_DEFAULT +func (p *TGetOperationStatusResp) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOperationCompleted() { + if err := oprot.WriteFieldBegin(ctx, "operationCompleted", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:operationCompleted: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.OperationCompleted)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.operationCompleted (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:operationCompleted: ", p), err) } } -return p.Status + return err } -var TFetchResultsResp_HasMoreRows_DEFAULT bool -func (p *TFetchResultsResp) GetHasMoreRows() bool { - if !p.IsSetHasMoreRows() { - return TFetchResultsResp_HasMoreRows_DEFAULT + +func (p *TGetOperationStatusResp) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetHasResultSet() { + if err := oprot.WriteFieldBegin(ctx, "hasResultSet", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:hasResultSet: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.HasResultSet)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasResultSet (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:hasResultSet: ", p), err) } } -return *p.HasMoreRows + return err } -var TFetchResultsResp_Results_DEFAULT *TRowSet -func (p *TFetchResultsResp) GetResults() *TRowSet { - if !p.IsSetResults() { - return TFetchResultsResp_Results_DEFAULT + +func (p *TGetOperationStatusResp) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProgressUpdateResponse() { + if err := oprot.WriteFieldBegin(ctx, "progressUpdateResponse", thrift.STRUCT, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:progressUpdateResponse: ", p), err) } + if err := p.ProgressUpdateResponse.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ProgressUpdateResponse), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:progressUpdateResponse: ", p), err) } } -return p.Results + return err } -func (p *TFetchResultsResp) IsSetStatus() bool { - return p.Status != nil + +func (p *TGetOperationStatusResp) Equals(other *TGetOperationStatusResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.OperationState != other.OperationState { + if p.OperationState == nil || other.OperationState == nil { + return false + } + if (*p.OperationState) != (*other.OperationState) { return false } + } + if p.SqlState != other.SqlState { + if p.SqlState == nil || other.SqlState == nil { + return false + } + if (*p.SqlState) != (*other.SqlState) { return false } + } + if p.ErrorCode != other.ErrorCode { + if p.ErrorCode == nil || other.ErrorCode == nil { + return false + } + if (*p.ErrorCode) != (*other.ErrorCode) { return false } + } + if p.ErrorMessage != other.ErrorMessage { + if p.ErrorMessage == nil || other.ErrorMessage == nil { + return false + } + if (*p.ErrorMessage) != (*other.ErrorMessage) { return false } + } + if p.TaskStatus != other.TaskStatus { + if p.TaskStatus == nil || other.TaskStatus == nil { + return false + } + if (*p.TaskStatus) != (*other.TaskStatus) { return false } + } + if p.OperationStarted != other.OperationStarted { + if p.OperationStarted == nil || other.OperationStarted == nil { + return false + } + if (*p.OperationStarted) != (*other.OperationStarted) { return false } + } + if p.OperationCompleted != other.OperationCompleted { + if p.OperationCompleted == nil || other.OperationCompleted == nil { + return false + } + if (*p.OperationCompleted) != (*other.OperationCompleted) { return false } + } + if p.HasResultSet != other.HasResultSet { + if p.HasResultSet == nil || other.HasResultSet == nil { + return false + } + if (*p.HasResultSet) != (*other.HasResultSet) { return false } + } + if !p.ProgressUpdateResponse.Equals(other.ProgressUpdateResponse) { return false } + return true } -func (p *TFetchResultsResp) IsSetHasMoreRows() bool { - return p.HasMoreRows != nil +func (p *TGetOperationStatusResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TGetOperationStatusResp(%+v)", *p) } -func (p *TFetchResultsResp) IsSetResults() bool { - return p.Results != nil +// Attributes: +// - OperationHandle +type TCancelOperationReq struct { + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` +} + +func NewTCancelOperationReq() *TCancelOperationReq { + return &TCancelOperationReq{} +} + +var TCancelOperationReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TCancelOperationReq) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TCancelOperationReq_OperationHandle_DEFAULT + } +return p.OperationHandle +} +func (p *TCancelOperationReq) IsSetOperationHandle() bool { + return p.OperationHandle != nil } -func (p *TFetchResultsResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCancelOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetOperationHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -11920,180 +13780,112 @@ func (p *TFetchResultsResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.BOOL { - if err := p.ReadField2(iprot); err != nil { - return err - } - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } + issetOperationHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); - } - return nil -} - -func (p *TFetchResultsResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); } return nil } -func (p *TFetchResultsResp) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.HasMoreRows = &v -} - return nil -} - -func (p *TFetchResultsResp) ReadField3(iprot thrift.TProtocol) error { - p.Results = &TRowSet{} - if err := p.Results.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) +func (p *TCancelOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TFetchResultsResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TFetchResultsResp"); err != nil { +func (p *TCancelOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCancelOperationReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TFetchResultsResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } - return err -} - -func (p *TFetchResultsResp) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetHasMoreRows() { - if err := oprot.WriteFieldBegin("hasMoreRows", thrift.BOOL, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) } - if err := oprot.WriteBool(bool(*p.HasMoreRows)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) } +func (p *TCancelOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } return err } -func (p *TFetchResultsResp) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetResults() { - if err := oprot.WriteFieldBegin("results", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) } - if err := p.Results.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) } +func (p *TCancelOperationReq) Equals(other *TCancelOperationReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false } - return err + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } -func (p *TFetchResultsResp) String() string { +func (p *TCancelOperationReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TFetchResultsResp(%+v)", *p) + return fmt.Sprintf("TCancelOperationReq(%+v)", *p) } // Attributes: -// - SessionHandle -// - Owner -// - Renewer -type TGetDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` - Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` +// - Status +type TCancelOperationResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } -func NewTGetDelegationTokenReq() *TGetDelegationTokenReq { - return &TGetDelegationTokenReq{} +func NewTCancelOperationResp() *TCancelOperationResp { + return &TCancelOperationResp{} } -var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle -func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TGetDelegationTokenReq_SessionHandle_DEFAULT +var TCancelOperationResp_Status_DEFAULT *TStatus +func (p *TCancelOperationResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TCancelOperationResp_Status_DEFAULT } -return p.SessionHandle -} - -func (p *TGetDelegationTokenReq) GetOwner() string { - return p.Owner -} - -func (p *TGetDelegationTokenReq) GetRenewer() string { - return p.Renewer +return p.Status } -func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil +func (p *TCancelOperationResp) IsSetStatus() bool { + return p.Status != nil } -func (p *TGetDelegationTokenReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCancelOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetSessionHandle bool = false; - var issetOwner bool = false; - var issetRenewer bool = false; + var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12101,183 +13893,112 @@ func (p *TGetDelegationTokenReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { - return err - } - issetOwner = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 3: - if fieldTypeId == thrift.STRING { - if err := p.ReadField3(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetRenewer = true + issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetOwner{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")); - } - if !issetRenewer{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")); + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); } return nil } -func (p *TGetDelegationTokenReq) ReadField1(iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) +func (p *TCancelOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TGetDelegationTokenReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.Owner = v -} - return nil -} - -func (p *TGetDelegationTokenReq) ReadField3(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 3: ", err) -} else { - p.Renewer = v -} - return nil -} - -func (p *TGetDelegationTokenReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetDelegationTokenReq"); err != nil { +func (p *TCancelOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCancelOperationResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) +func (p *TCancelOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } - return err -} - -func (p *TGetDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("owner", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) } - if err := oprot.WriteString(string(p.Owner)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TGetDelegationTokenReq) writeField3(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("renewer", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) } - if err := oprot.WriteString(string(p.Renewer)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) } - return err +func (p *TCancelOperationResp) Equals(other *TCancelOperationResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } -func (p *TGetDelegationTokenReq) String() string { +func (p *TCancelOperationResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) + return fmt.Sprintf("TCancelOperationResp(%+v)", *p) } // Attributes: -// - Status -// - DelegationToken -type TGetDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` - DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` +// - OperationHandle +type TCloseOperationReq struct { + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } -func NewTGetDelegationTokenResp() *TGetDelegationTokenResp { - return &TGetDelegationTokenResp{} +func NewTCloseOperationReq() *TCloseOperationReq { + return &TCloseOperationReq{} } -var TGetDelegationTokenResp_Status_DEFAULT *TStatus -func (p *TGetDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TGetDelegationTokenResp_Status_DEFAULT - } -return p.Status -} -var TGetDelegationTokenResp_DelegationToken_DEFAULT string -func (p *TGetDelegationTokenResp) GetDelegationToken() string { - if !p.IsSetDelegationToken() { - return TGetDelegationTokenResp_DelegationToken_DEFAULT +var TCloseOperationReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TCloseOperationReq) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TCloseOperationReq_OperationHandle_DEFAULT } -return *p.DelegationToken -} -func (p *TGetDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil +return p.OperationHandle } - -func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool { - return p.DelegationToken != nil +func (p *TCloseOperationReq) IsSetOperationHandle() bool { + return p.OperationHandle != nil } -func (p *TGetDelegationTokenResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCloseOperationReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetOperationHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12285,141 +14006,112 @@ func (p *TGetDelegationTokenResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetStatus = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } + issetOperationHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); } return nil } -func (p *TGetDelegationTokenResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +func (p *TCloseOperationReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TGetDelegationTokenResp) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = &v -} - return nil -} - -func (p *TGetDelegationTokenResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TGetDelegationTokenResp"); err != nil { +func (p *TCloseOperationReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCloseOperationReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TGetDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) +func (p *TCloseOperationReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } return err } -func (p *TGetDelegationTokenResp) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetDelegationToken() { - if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(string(*p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } +func (p *TCloseOperationReq) Equals(other *TCloseOperationReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false } - return err + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true } -func (p *TGetDelegationTokenResp) String() string { +func (p *TCloseOperationReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) + return fmt.Sprintf("TCloseOperationReq(%+v)", *p) } // Attributes: -// - SessionHandle -// - DelegationToken -type TCancelDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` +// - Status +type TCloseOperationResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` } -func NewTCancelDelegationTokenReq() *TCancelDelegationTokenReq { - return &TCancelDelegationTokenReq{} +func NewTCloseOperationResp() *TCloseOperationResp { + return &TCloseOperationResp{} } -var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle -func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TCancelDelegationTokenReq_SessionHandle_DEFAULT +var TCloseOperationResp_Status_DEFAULT *TStatus +func (p *TCloseOperationResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TCloseOperationResp_Status_DEFAULT } -return p.SessionHandle -} - -func (p *TCancelDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken +return p.Status } -func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil +func (p *TCloseOperationResp) IsSetStatus() bool { + return p.Status != nil } -func (p *TCancelDelegationTokenReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCloseOperationResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetSessionHandle bool = false; - var issetDelegationToken bool = false; + var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12427,136 +14119,112 @@ func (p *TCancelDelegationTokenReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { - return err - } - issetSessionHandle = true - } else { - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetDelegationToken = true + issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetDelegationToken{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); } return nil } -func (p *TCancelDelegationTokenReq) ReadField1(iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) +func (p *TCloseOperationResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TCancelDelegationTokenReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} - return nil -} - -func (p *TCancelDelegationTokenReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCancelDelegationTokenReq"); err != nil { +func (p *TCloseOperationResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCloseOperationResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCancelDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) +func (p *TCloseOperationResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TCancelDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } - return err +func (p *TCloseOperationResp) Equals(other *TCloseOperationResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true } -func (p *TCancelDelegationTokenReq) String() string { +func (p *TCloseOperationResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) + return fmt.Sprintf("TCloseOperationResp(%+v)", *p) } // Attributes: -// - Status -type TCancelDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +// - OperationHandle +type TGetResultSetMetadataReq struct { + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` } -func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp { - return &TCancelDelegationTokenResp{} +func NewTGetResultSetMetadataReq() *TGetResultSetMetadataReq { + return &TGetResultSetMetadataReq{} } -var TCancelDelegationTokenResp_Status_DEFAULT *TStatus -func (p *TCancelDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TCancelDelegationTokenResp_Status_DEFAULT +var TGetResultSetMetadataReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TGetResultSetMetadataReq) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TGetResultSetMetadataReq_OperationHandle_DEFAULT } -return p.Status +return p.OperationHandle } -func (p *TCancelDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil +func (p *TGetResultSetMetadataReq) IsSetOperationHandle() bool { + return p.OperationHandle != nil } -func (p *TCancelDelegationTokenResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetResultSetMetadataReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetOperationHandle bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12564,109 +14232,125 @@ func (p *TCancelDelegationTokenResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetStatus = true + issetOperationHandle = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); } return nil } -func (p *TCancelDelegationTokenResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +func (p *TGetResultSetMetadataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TCancelDelegationTokenResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TCancelDelegationTokenResp"); err != nil { +func (p *TGetResultSetMetadataReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCancelDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) +func (p *TGetResultSetMetadataReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } return err } -func (p *TCancelDelegationTokenResp) String() string { +func (p *TGetResultSetMetadataReq) Equals(other *TGetResultSetMetadataReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + +func (p *TGetResultSetMetadataReq) String() string { if p == nil { return "" } - return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) + return fmt.Sprintf("TGetResultSetMetadataReq(%+v)", *p) } // Attributes: -// - SessionHandle -// - DelegationToken -type TRenewDelegationTokenReq struct { - SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` - DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` +// - Status +// - Schema +type TGetResultSetMetadataResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + Schema *TTableSchema `thrift:"schema,2" db:"schema" json:"schema,omitempty"` } -func NewTRenewDelegationTokenReq() *TRenewDelegationTokenReq { - return &TRenewDelegationTokenReq{} +func NewTGetResultSetMetadataResp() *TGetResultSetMetadataResp { + return &TGetResultSetMetadataResp{} } -var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle -func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle { - if !p.IsSetSessionHandle() { - return TRenewDelegationTokenReq_SessionHandle_DEFAULT +var TGetResultSetMetadataResp_Status_DEFAULT *TStatus +func (p *TGetResultSetMetadataResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TGetResultSetMetadataResp_Status_DEFAULT } -return p.SessionHandle +return p.Status } - -func (p *TRenewDelegationTokenReq) GetDelegationToken() string { - return p.DelegationToken +var TGetResultSetMetadataResp_Schema_DEFAULT *TTableSchema +func (p *TGetResultSetMetadataResp) GetSchema() *TTableSchema { + if !p.IsSetSchema() { + return TGetResultSetMetadataResp_Schema_DEFAULT + } +return p.Schema } -func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool { - return p.SessionHandle != nil +func (p *TGetResultSetMetadataResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TGetResultSetMetadataResp) IsSetSchema() bool { + return p.Schema != nil } -func (p *TRenewDelegationTokenReq) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TGetResultSetMetadataResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetSessionHandle bool = false; - var issetDelegationToken bool = false; + var issetStatus bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12674,136 +14358,172 @@ func (p *TRenewDelegationTokenReq) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } - issetSessionHandle = true + issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } case 2: - if fieldTypeId == thrift.STRING { - if err := p.ReadField2(iprot); err != nil { + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { return err } - issetDelegationToken = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetSessionHandle{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); - } - if !issetDelegationToken{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); } return nil } -func (p *TRenewDelegationTokenReq) ReadField1(iprot thrift.TProtocol) error { - p.SessionHandle = &TSessionHandle{} - if err := p.SessionHandle.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) +func (p *TGetResultSetMetadataResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } return nil } -func (p *TRenewDelegationTokenReq) ReadField2(iprot thrift.TProtocol) error { - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 2: ", err) -} else { - p.DelegationToken = v -} +func (p *TGetResultSetMetadataResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &TTableSchema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } return nil } -func (p *TRenewDelegationTokenReq) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TRenewDelegationTokenReq"); err != nil { +func (p *TGetResultSetMetadataResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetResultSetMetadataResp"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TRenewDelegationTokenReq) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("sessionHandle", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } - if err := p.SessionHandle.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) +func (p *TGetResultSetMetadataResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } return err } -func (p *TRenewDelegationTokenReq) writeField2(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("delegationToken", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } - if err := oprot.WriteString(string(p.DelegationToken)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } +func (p *TGetResultSetMetadataResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSchema() { + if err := oprot.WriteFieldBegin(ctx, "schema", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:schema: ", p), err) } + if err := p.Schema.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } + } return err } -func (p *TRenewDelegationTokenReq) String() string { +func (p *TGetResultSetMetadataResp) Equals(other *TGetResultSetMetadataResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *TGetResultSetMetadataResp) String() string { if p == nil { return "" } - return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) + return fmt.Sprintf("TGetResultSetMetadataResp(%+v)", *p) } // Attributes: -// - Status -type TRenewDelegationTokenResp struct { - Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +// - OperationHandle +// - Orientation +// - MaxRows +// - FetchType +type TFetchResultsReq struct { + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` + Orientation TFetchOrientation `thrift:"orientation,2,required" db:"orientation" json:"orientation"` + MaxRows int64 `thrift:"maxRows,3,required" db:"maxRows" json:"maxRows"` + FetchType int16 `thrift:"fetchType,4" db:"fetchType" json:"fetchType"` } -func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp { - return &TRenewDelegationTokenResp{} +func NewTFetchResultsReq() *TFetchResultsReq { + return &TFetchResultsReq{ +Orientation: 0, +} } -var TRenewDelegationTokenResp_Status_DEFAULT *TStatus -func (p *TRenewDelegationTokenResp) GetStatus() *TStatus { - if !p.IsSetStatus() { - return TRenewDelegationTokenResp_Status_DEFAULT +var TFetchResultsReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TFetchResultsReq) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TFetchResultsReq_OperationHandle_DEFAULT } -return p.Status +return p.OperationHandle } -func (p *TRenewDelegationTokenResp) IsSetStatus() bool { - return p.Status != nil + +func (p *TFetchResultsReq) GetOrientation() TFetchOrientation { + return p.Orientation +} + +func (p *TFetchResultsReq) GetMaxRows() int64 { + return p.MaxRows +} +var TFetchResultsReq_FetchType_DEFAULT int16 = 0 + +func (p *TFetchResultsReq) GetFetchType() int16 { + return p.FetchType +} +func (p *TFetchResultsReq) IsSetOperationHandle() bool { + return p.OperationHandle != nil +} + +func (p *TFetchResultsReq) IsSetFetchType() bool { + return p.FetchType != TFetchResultsReq_FetchType_DEFAULT } -func (p *TRenewDelegationTokenResp) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TFetchResultsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) } - var issetStatus bool = false; + var issetOperationHandle bool = false; + var issetOrientation bool = false; + var issetMaxRows bool = false; for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -12811,1389 +14531,5064 @@ func (p *TRenewDelegationTokenResp) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOrientation = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetMaxRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I16 { + if err := p.ReadField4(ctx, iprot); err != nil { return err } - issetStatus = true } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if !issetStatus{ - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + if !issetOrientation{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Orientation is not set")); + } + if !issetMaxRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field MaxRows is not set")); } return nil } -func (p *TRenewDelegationTokenResp) ReadField1(iprot thrift.TProtocol) error { - p.Status = &TStatus{} - if err := p.Status.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) +func (p *TFetchResultsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) } return nil } -func (p *TRenewDelegationTokenResp) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("TRenewDelegationTokenResp"); err != nil { +func (p *TFetchResultsReq) 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 := TFetchOrientation(v) + p.Orientation = temp +} + return nil +} + +func (p *TFetchResultsReq) 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.MaxRows = v +} + return nil +} + +func (p *TFetchResultsReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FetchType = v +} + return nil +} + +func (p *TFetchResultsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TFetchResultsReq"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.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(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TRenewDelegationTokenResp) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } - if err := p.Status.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) +func (p *TFetchResultsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } return err } -func (p *TRenewDelegationTokenResp) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) -} - -type TCLIService interface { - // Parameters: - // - Req - OpenSession(ctx context.Context, req *TOpenSessionReq) (r *TOpenSessionResp, err error) - // Parameters: - // - Req - CloseSession(ctx context.Context, req *TCloseSessionReq) (r *TCloseSessionResp, err error) - // Parameters: - // - Req - GetInfo(ctx context.Context, req *TGetInfoReq) (r *TGetInfoResp, err error) - // Parameters: - // - Req - ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (r *TExecuteStatementResp, err error) - // Parameters: - // - Req - GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (r *TGetTypeInfoResp, err error) - // Parameters: - // - Req - GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (r *TGetCatalogsResp, err error) - // Parameters: - // - Req - GetSchemas(ctx context.Context, req *TGetSchemasReq) (r *TGetSchemasResp, err error) - // Parameters: - // - Req - GetTables(ctx context.Context, req *TGetTablesReq) (r *TGetTablesResp, err error) - // Parameters: - // - Req - GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (r *TGetTableTypesResp, err error) - // Parameters: - // - Req - GetColumns(ctx context.Context, req *TGetColumnsReq) (r *TGetColumnsResp, err error) - // Parameters: - // - Req - GetFunctions(ctx context.Context, req *TGetFunctionsReq) (r *TGetFunctionsResp, err error) - // Parameters: - // - Req - GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (r *TGetOperationStatusResp, err error) - // Parameters: - // - Req - CancelOperation(ctx context.Context, req *TCancelOperationReq) (r *TCancelOperationResp, err error) - // Parameters: - // - Req - CloseOperation(ctx context.Context, req *TCloseOperationReq) (r *TCloseOperationResp, err error) - // Parameters: - // - Req - GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (r *TGetResultSetMetadataResp, err error) - // Parameters: - // - Req - FetchResults(ctx context.Context, req *TFetchResultsReq) (r *TFetchResultsResp, err error) - // Parameters: - // - Req - GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (r *TGetDelegationTokenResp, err error) - // Parameters: - // - Req - CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (r *TCancelDelegationTokenResp, err error) - // Parameters: - // - Req - RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (r *TRenewDelegationTokenResp, err error) +func (p *TFetchResultsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "orientation", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:orientation: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Orientation)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.orientation (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:orientation: ", p), err) } + return err } -type TCLIServiceClient struct { - c thrift.TClient +func (p *TFetchResultsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "maxRows", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:maxRows: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.MaxRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.maxRows (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:maxRows: ", p), err) } + return err } -func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), +func (p *TFetchResultsReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFetchType() { + if err := oprot.WriteFieldBegin(ctx, "fetchType", thrift.I16, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fetchType: ", p), err) } + if err := oprot.WriteI16(ctx, int16(p.FetchType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fetchType (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fetchType: ", p), err) } } + return err } -func NewTCLIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TCLIServiceClient { - return &TCLIServiceClient{ - c: thrift.NewTStandardClient(iprot, oprot), +func (p *TFetchResultsReq) Equals(other *TFetchResultsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + if p.Orientation != other.Orientation { return false } + if p.MaxRows != other.MaxRows { return false } + if p.FetchType != other.FetchType { return false } + return true } -func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient { - return &TCLIServiceClient{ - c: c, +func (p *TFetchResultsReq) String() string { + if p == nil { + return "" } + return fmt.Sprintf("TFetchResultsReq(%+v)", *p) } -func (p *TCLIServiceClient) Client_() thrift.TClient { - return p.c -} -// Parameters: -// - Req -func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (r *TOpenSessionResp, err error) { - var _args27 TCLIServiceOpenSessionArgs - _args27.Req = req - var _result28 TCLIServiceOpenSessionResult - if err = p.Client_().Call(ctx, "OpenSession", &_args27, &_result28); err != nil { - return - } - return _result28.GetSuccess(), nil +// Attributes: +// - Status +// - HasMoreRows +// - Results +type TFetchResultsResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + HasMoreRows *bool `thrift:"hasMoreRows,2" db:"hasMoreRows" json:"hasMoreRows,omitempty"` + Results *TRowSet `thrift:"results,3" db:"results" json:"results,omitempty"` } -// Parameters: -// - Req -func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (r *TCloseSessionResp, err error) { - var _args29 TCLIServiceCloseSessionArgs - _args29.Req = req - var _result30 TCLIServiceCloseSessionResult - if err = p.Client_().Call(ctx, "CloseSession", &_args29, &_result30); err != nil { - return - } - return _result30.GetSuccess(), nil +func NewTFetchResultsResp() *TFetchResultsResp { + return &TFetchResultsResp{} } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (r *TGetInfoResp, err error) { - var _args31 TCLIServiceGetInfoArgs - _args31.Req = req - var _result32 TCLIServiceGetInfoResult - if err = p.Client_().Call(ctx, "GetInfo", &_args31, &_result32); err != nil { - return +var TFetchResultsResp_Status_DEFAULT *TStatus +func (p *TFetchResultsResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TFetchResultsResp_Status_DEFAULT } - return _result32.GetSuccess(), nil +return p.Status } - -// Parameters: -// - Req -func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (r *TExecuteStatementResp, err error) { - var _args33 TCLIServiceExecuteStatementArgs - _args33.Req = req - var _result34 TCLIServiceExecuteStatementResult - if err = p.Client_().Call(ctx, "ExecuteStatement", &_args33, &_result34); err != nil { - return +var TFetchResultsResp_HasMoreRows_DEFAULT bool +func (p *TFetchResultsResp) GetHasMoreRows() bool { + if !p.IsSetHasMoreRows() { + return TFetchResultsResp_HasMoreRows_DEFAULT } - return _result34.GetSuccess(), nil +return *p.HasMoreRows } - -// Parameters: -// - Req -func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (r *TGetTypeInfoResp, err error) { - var _args35 TCLIServiceGetTypeInfoArgs - _args35.Req = req - var _result36 TCLIServiceGetTypeInfoResult - if err = p.Client_().Call(ctx, "GetTypeInfo", &_args35, &_result36); err != nil { - return +var TFetchResultsResp_Results_DEFAULT *TRowSet +func (p *TFetchResultsResp) GetResults() *TRowSet { + if !p.IsSetResults() { + return TFetchResultsResp_Results_DEFAULT } - return _result36.GetSuccess(), nil +return p.Results } - -// Parameters: -// - Req -func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (r *TGetCatalogsResp, err error) { - var _args37 TCLIServiceGetCatalogsArgs - _args37.Req = req - var _result38 TCLIServiceGetCatalogsResult - if err = p.Client_().Call(ctx, "GetCatalogs", &_args37, &_result38); err != nil { - return - } - return _result38.GetSuccess(), nil +func (p *TFetchResultsResp) IsSetStatus() bool { + return p.Status != nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (r *TGetSchemasResp, err error) { - var _args39 TCLIServiceGetSchemasArgs - _args39.Req = req - var _result40 TCLIServiceGetSchemasResult - if err = p.Client_().Call(ctx, "GetSchemas", &_args39, &_result40); err != nil { - return - } - return _result40.GetSuccess(), nil +func (p *TFetchResultsResp) IsSetHasMoreRows() bool { + return p.HasMoreRows != nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (r *TGetTablesResp, err error) { - var _args41 TCLIServiceGetTablesArgs - _args41.Req = req - var _result42 TCLIServiceGetTablesResult - if err = p.Client_().Call(ctx, "GetTables", &_args41, &_result42); err != nil { - return - } - return _result42.GetSuccess(), nil +func (p *TFetchResultsResp) IsSetResults() bool { + return p.Results != nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (r *TGetTableTypesResp, err error) { - var _args43 TCLIServiceGetTableTypesArgs - _args43.Req = req - var _result44 TCLIServiceGetTableTypesResult - if err = p.Client_().Call(ctx, "GetTableTypes", &_args43, &_result44); err != nil { - return +func (p *TFetchResultsResp) 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) } - return _result44.GetSuccess(), nil -} -// Parameters: -// - Req -func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (r *TGetColumnsResp, err error) { - var _args45 TCLIServiceGetColumnsArgs - _args45.Req = req - var _result46 TCLIServiceGetColumnsResult - if err = p.Client_().Call(ctx, "GetColumns", &_args45, &_result46); err != nil { - return - } - return _result46.GetSuccess(), nil -} + var issetStatus bool = false; -// Parameters: -// - Req -func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (r *TGetFunctionsResp, err error) { - var _args47 TCLIServiceGetFunctionsArgs - _args47.Req = req - var _result48 TCLIServiceGetFunctionsResult - if err = p.Client_().Call(ctx, "GetFunctions", &_args47, &_result48); err != nil { - return + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } 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 + } } - return _result48.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (r *TGetOperationStatusResp, err error) { - var _args49 TCLIServiceGetOperationStatusArgs - _args49.Req = req - var _result50 TCLIServiceGetOperationStatusResult - if err = p.Client_().Call(ctx, "GetOperationStatus", &_args49, &_result50); err != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return _result50.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (r *TCancelOperationResp, err error) { - var _args51 TCLIServiceCancelOperationArgs - _args51.Req = req - var _result52 TCLIServiceCancelOperationResult - if err = p.Client_().Call(ctx, "CancelOperation", &_args51, &_result52); err != nil { - return + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); } - return _result52.GetSuccess(), nil + return nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (r *TCloseOperationResp, err error) { - var _args53 TCLIServiceCloseOperationArgs - _args53.Req = req - var _result54 TCLIServiceCloseOperationResult - if err = p.Client_().Call(ctx, "CloseOperation", &_args53, &_result54); err != nil { - return +func (p *TFetchResultsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) } - return _result54.GetSuccess(), nil + return nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (r *TGetResultSetMetadataResp, err error) { - var _args55 TCLIServiceGetResultSetMetadataArgs - _args55.Req = req - var _result56 TCLIServiceGetResultSetMetadataResult - if err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args55, &_result56); err != nil { - return - } - return _result56.GetSuccess(), nil +func (p *TFetchResultsResp) 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.HasMoreRows = &v +} + return nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (r *TFetchResultsResp, err error) { - var _args57 TCLIServiceFetchResultsArgs - _args57.Req = req - var _result58 TCLIServiceFetchResultsResult - if err = p.Client_().Call(ctx, "FetchResults", &_args57, &_result58); err != nil { - return +func (p *TFetchResultsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Results = &TRowSet{} + if err := p.Results.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Results), err) } - return _result58.GetSuccess(), nil + return nil } -// Parameters: -// - Req -func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (r *TGetDelegationTokenResp, err error) { - var _args59 TCLIServiceGetDelegationTokenArgs - _args59.Req = req - var _result60 TCLIServiceGetDelegationTokenResult - if err = p.Client_().Call(ctx, "GetDelegationToken", &_args59, &_result60); err != nil { - return +func (p *TFetchResultsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TFetchResultsResp"); 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 } } - return _result60.GetSuccess(), 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 } -// Parameters: -// - Req -func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (r *TCancelDelegationTokenResp, err error) { - var _args61 TCLIServiceCancelDelegationTokenArgs - _args61.Req = req - var _result62 TCLIServiceCancelDelegationTokenResult - if err = p.Client_().Call(ctx, "CancelDelegationToken", &_args61, &_result62); err != nil { - return +func (p *TFetchResultsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) } - return _result62.GetSuccess(), nil + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err } -// Parameters: -// - Req -func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (r *TRenewDelegationTokenResp, err error) { - var _args63 TCLIServiceRenewDelegationTokenArgs - _args63.Req = req - var _result64 TCLIServiceRenewDelegationTokenResult - if err = p.Client_().Call(ctx, "RenewDelegationToken", &_args63, &_result64); err != nil { - return +func (p *TFetchResultsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetHasMoreRows() { + if err := oprot.WriteFieldBegin(ctx, "hasMoreRows", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hasMoreRows: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.HasMoreRows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hasMoreRows (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hasMoreRows: ", p), err) } } - return _result64.GetSuccess(), nil + return err } -type TCLIServiceProcessor struct { - processorMap map[string]thrift.TProcessorFunction - handler TCLIService +func (p *TFetchResultsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetResults() { + if err := oprot.WriteFieldBegin(ctx, "results", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:results: ", p), err) } + if err := p.Results.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Results), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:results: ", p), err) } + } + return err } -func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { - p.processorMap[key] = processor +func (p *TFetchResultsResp) Equals(other *TFetchResultsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.HasMoreRows != other.HasMoreRows { + if p.HasMoreRows == nil || other.HasMoreRows == nil { + return false + } + if (*p.HasMoreRows) != (*other.HasMoreRows) { return false } + } + if !p.Results.Equals(other.Results) { return false } + return true } -func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { - processor, ok = p.processorMap[key] - return processor, ok +func (p *TFetchResultsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TFetchResultsResp(%+v)", *p) } -func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { - return p.processorMap +// Attributes: +// - SessionHandle +// - Owner +// - Renewer +type TGetDelegationTokenReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + Owner string `thrift:"owner,2,required" db:"owner" json:"owner"` + Renewer string `thrift:"renewer,3,required" db:"renewer" json:"renewer"` } -func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor { - - self65 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} - self65.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler} - self65.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler} - self65.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler} - self65.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler} - self65.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler} - self65.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler} - self65.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler} - self65.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler} - self65.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler} - self65.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler} - self65.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler} - self65.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler} - self65.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler} - self65.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler} - self65.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler} - self65.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler} - self65.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler} - self65.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler} - self65.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler} -return self65 +func NewTGetDelegationTokenReq() *TGetDelegationTokenReq { + return &TGetDelegationTokenReq{} } -func (p *TCLIServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - name, _, seqId, err := iprot.ReadMessageBegin() - if err != nil { return false, err } - if processor, ok := p.GetProcessorFunction(name); ok { - return processor.Process(ctx, seqId, iprot, oprot) +var TGetDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TGetDelegationTokenReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TGetDelegationTokenReq_SessionHandle_DEFAULT } - iprot.Skip(thrift.STRUCT) - iprot.ReadMessageEnd() - x66 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) - oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId) - x66.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, x66 - +return p.SessionHandle } -type tCLIServiceProcessorOpenSession struct { - handler TCLIService +func (p *TGetDelegationTokenReq) GetOwner() string { + return p.Owner } -func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceOpenSessionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("OpenSession", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - result := TCLIServiceOpenSessionResult{} -var retval *TOpenSessionResp - var err2 error - if retval, err2 = p.handler.OpenSession(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error()) - oprot.WriteMessageBegin("OpenSession", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("OpenSession", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err +func (p *TGetDelegationTokenReq) GetRenewer() string { + return p.Renewer } - -type tCLIServiceProcessorCloseSession struct { - handler TCLIService +func (p *TGetDelegationTokenReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil } -func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCloseSessionArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CloseSession", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TGetDelegationTokenReq) 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) } - iprot.ReadMessageEnd() - result := TCLIServiceCloseSessionResult{} -var retval *TCloseSessionResp - var err2 error - if retval, err2 = p.handler.CloseSession(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error()) - oprot.WriteMessageBegin("CloseSession", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("CloseSession", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err + var issetSessionHandle bool = false; + var issetOwner bool = false; + var issetRenewer bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetOwner = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetRenewer = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetOwner{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Owner is not set")); + } + if !issetRenewer{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Renewer is not set")); + } + return nil +} + +func (p *TGetDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TGetDelegationTokenReq) 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.Owner = v +} + return nil +} + +func (p *TGetDelegationTokenReq) 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.Renewer = v +} + return nil +} + +func (p *TGetDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenReq"); 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 *TGetDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err +} + +func (p *TGetDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "owner", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:owner: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Owner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.owner (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:owner: ", p), err) } + return err +} + +func (p *TGetDelegationTokenReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "renewer", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:renewer: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Renewer)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.renewer (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:renewer: ", p), err) } + return err +} + +func (p *TGetDelegationTokenReq) Equals(other *TGetDelegationTokenReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.Owner != other.Owner { return false } + if p.Renewer != other.Renewer { return false } + return true +} + +func (p *TGetDelegationTokenReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenReq(%+v)", *p) +} + +// Attributes: +// - Status +// - DelegationToken +type TGetDelegationTokenResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` + DelegationToken *string `thrift:"delegationToken,2" db:"delegationToken" json:"delegationToken,omitempty"` +} + +func NewTGetDelegationTokenResp() *TGetDelegationTokenResp { + return &TGetDelegationTokenResp{} +} + +var TGetDelegationTokenResp_Status_DEFAULT *TStatus +func (p *TGetDelegationTokenResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TGetDelegationTokenResp_Status_DEFAULT + } +return p.Status +} +var TGetDelegationTokenResp_DelegationToken_DEFAULT string +func (p *TGetDelegationTokenResp) GetDelegationToken() string { + if !p.IsSetDelegationToken() { + return TGetDelegationTokenResp_DelegationToken_DEFAULT + } +return *p.DelegationToken +} +func (p *TGetDelegationTokenResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TGetDelegationTokenResp) IsSetDelegationToken() bool { + return p.DelegationToken != nil +} + +func (p *TGetDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TGetDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TGetDelegationTokenResp) 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.DelegationToken = &v +} + return nil +} + +func (p *TGetDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetDelegationTokenResp"); 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 *TGetDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err +} + +func (p *TGetDelegationTokenResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDelegationToken() { + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(*p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + } + return err +} + +func (p *TGetDelegationTokenResp) Equals(other *TGetDelegationTokenResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + if p.DelegationToken != other.DelegationToken { + if p.DelegationToken == nil || other.DelegationToken == nil { + return false + } + if (*p.DelegationToken) != (*other.DelegationToken) { return false } + } + return true +} + +func (p *TGetDelegationTokenResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TGetDelegationTokenResp(%+v)", *p) +} + +// Attributes: +// - SessionHandle +// - DelegationToken +type TCancelDelegationTokenReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` +} + +func NewTCancelDelegationTokenReq() *TCancelDelegationTokenReq { + return &TCancelDelegationTokenReq{} +} + +var TCancelDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TCancelDelegationTokenReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TCancelDelegationTokenReq_SessionHandle_DEFAULT + } +return p.SessionHandle +} + +func (p *TCancelDelegationTokenReq) GetDelegationToken() string { + return p.DelegationToken +} +func (p *TCancelDelegationTokenReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil +} + +func (p *TCancelDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetDelegationToken bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetDelegationToken{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + } + return nil +} + +func (p *TCancelDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TCancelDelegationTokenReq) 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.DelegationToken = v +} + return nil +} + +func (p *TCancelDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenReq"); 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 *TCancelDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err +} + +func (p *TCancelDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + return err +} + +func (p *TCancelDelegationTokenReq) Equals(other *TCancelDelegationTokenReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.DelegationToken != other.DelegationToken { return false } + return true +} + +func (p *TCancelDelegationTokenReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenReq(%+v)", *p) +} + +// Attributes: +// - Status +type TCancelDelegationTokenResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +} + +func NewTCancelDelegationTokenResp() *TCancelDelegationTokenResp { + return &TCancelDelegationTokenResp{} +} + +var TCancelDelegationTokenResp_Status_DEFAULT *TStatus +func (p *TCancelDelegationTokenResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TCancelDelegationTokenResp_Status_DEFAULT + } +return p.Status +} +func (p *TCancelDelegationTokenResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TCancelDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TCancelDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TCancelDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TCancelDelegationTokenResp"); 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 *TCancelDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err +} + +func (p *TCancelDelegationTokenResp) Equals(other *TCancelDelegationTokenResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true +} + +func (p *TCancelDelegationTokenResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCancelDelegationTokenResp(%+v)", *p) +} + +// Attributes: +// - SessionHandle +// - DelegationToken +type TRenewDelegationTokenReq struct { + SessionHandle *TSessionHandle `thrift:"sessionHandle,1,required" db:"sessionHandle" json:"sessionHandle"` + DelegationToken string `thrift:"delegationToken,2,required" db:"delegationToken" json:"delegationToken"` +} + +func NewTRenewDelegationTokenReq() *TRenewDelegationTokenReq { + return &TRenewDelegationTokenReq{} +} + +var TRenewDelegationTokenReq_SessionHandle_DEFAULT *TSessionHandle +func (p *TRenewDelegationTokenReq) GetSessionHandle() *TSessionHandle { + if !p.IsSetSessionHandle() { + return TRenewDelegationTokenReq_SessionHandle_DEFAULT + } +return p.SessionHandle +} + +func (p *TRenewDelegationTokenReq) GetDelegationToken() string { + return p.DelegationToken +} +func (p *TRenewDelegationTokenReq) IsSetSessionHandle() bool { + return p.SessionHandle != nil +} + +func (p *TRenewDelegationTokenReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSessionHandle bool = false; + var issetDelegationToken bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSessionHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetDelegationToken = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSessionHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SessionHandle is not set")); + } + if !issetDelegationToken{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field DelegationToken is not set")); + } + return nil +} + +func (p *TRenewDelegationTokenReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.SessionHandle = &TSessionHandle{} + if err := p.SessionHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SessionHandle), err) + } + return nil +} + +func (p *TRenewDelegationTokenReq) 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.DelegationToken = v +} + return nil +} + +func (p *TRenewDelegationTokenReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenReq"); 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 *TRenewDelegationTokenReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionHandle: ", p), err) } + if err := p.SessionHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SessionHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionHandle: ", p), err) } + return err +} + +func (p *TRenewDelegationTokenReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "delegationToken", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:delegationToken: ", p), err) } + if err := oprot.WriteString(ctx, string(p.DelegationToken)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.delegationToken (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:delegationToken: ", p), err) } + return err +} + +func (p *TRenewDelegationTokenReq) Equals(other *TRenewDelegationTokenReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.SessionHandle.Equals(other.SessionHandle) { return false } + if p.DelegationToken != other.DelegationToken { return false } + return true +} + +func (p *TRenewDelegationTokenReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenReq(%+v)", *p) +} + +// Attributes: +// - Status +type TRenewDelegationTokenResp struct { + Status *TStatus `thrift:"status,1,required" db:"status" json:"status"` +} + +func NewTRenewDelegationTokenResp() *TRenewDelegationTokenResp { + return &TRenewDelegationTokenResp{} +} + +var TRenewDelegationTokenResp_Status_DEFAULT *TStatus +func (p *TRenewDelegationTokenResp) GetStatus() *TStatus { + if !p.IsSetStatus() { + return TRenewDelegationTokenResp_Status_DEFAULT + } +return p.Status +} +func (p *TRenewDelegationTokenResp) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TRenewDelegationTokenResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetStatus bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + return nil +} + +func (p *TRenewDelegationTokenResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Status = &TStatus{} + if err := p.Status.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Status), err) + } + return nil +} + +func (p *TRenewDelegationTokenResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TRenewDelegationTokenResp"); 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 *TRenewDelegationTokenResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:status: ", p), err) } + if err := p.Status.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Status), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:status: ", p), err) } + return err +} + +func (p *TRenewDelegationTokenResp) Equals(other *TRenewDelegationTokenResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Status.Equals(other.Status) { return false } + return true +} + +func (p *TRenewDelegationTokenResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TRenewDelegationTokenResp(%+v)", *p) +} + +// Attributes: +// - HeaderNames +// - Rows +// - ProgressedPercentage +// - Status +// - FooterSummary +// - StartTime +type TProgressUpdateResp struct { + HeaderNames []string `thrift:"headerNames,1,required" db:"headerNames" json:"headerNames"` + Rows [][]string `thrift:"rows,2,required" db:"rows" json:"rows"` + ProgressedPercentage float64 `thrift:"progressedPercentage,3,required" db:"progressedPercentage" json:"progressedPercentage"` + Status TJobExecutionStatus `thrift:"status,4,required" db:"status" json:"status"` + FooterSummary string `thrift:"footerSummary,5,required" db:"footerSummary" json:"footerSummary"` + StartTime int64 `thrift:"startTime,6,required" db:"startTime" json:"startTime"` +} + +func NewTProgressUpdateResp() *TProgressUpdateResp { + return &TProgressUpdateResp{} +} + + +func (p *TProgressUpdateResp) GetHeaderNames() []string { + return p.HeaderNames +} + +func (p *TProgressUpdateResp) GetRows() [][]string { + return p.Rows +} + +func (p *TProgressUpdateResp) GetProgressedPercentage() float64 { + return p.ProgressedPercentage +} + +func (p *TProgressUpdateResp) GetStatus() TJobExecutionStatus { + return p.Status +} + +func (p *TProgressUpdateResp) GetFooterSummary() string { + return p.FooterSummary +} + +func (p *TProgressUpdateResp) GetStartTime() int64 { + return p.StartTime +} +func (p *TProgressUpdateResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHeaderNames bool = false; + var issetRows bool = false; + var issetProgressedPercentage bool = false; + var issetStatus bool = false; + var issetFooterSummary bool = false; + var issetStartTime bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetHeaderNames = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetProgressedPercentage = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetStatus = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetFooterSummary = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + issetStartTime = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHeaderNames{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field HeaderNames is not set")); + } + if !issetRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetProgressedPercentage{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ProgressedPercentage is not set")); + } + if !issetStatus{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Status is not set")); + } + if !issetFooterSummary{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FooterSummary is not set")); + } + if !issetStartTime{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field StartTime is not set")); + } + return nil +} + +func (p *TProgressUpdateResp) 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([]string, 0, size) + p.HeaderNames = tSlice + for i := 0; i < size; i ++ { +var _elem51 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem51 = v +} + p.HeaderNames = append(p.HeaderNames, _elem51) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) 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.Rows = tSlice + for i := 0; i < size; i ++ { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]string, 0, size) + _elem52 := tSlice + for i := 0; i < size; i ++ { +var _elem53 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem53 = v +} + _elem52 = append(_elem52, _elem53) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Rows = append(p.Rows, _elem52) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TProgressUpdateResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ProgressedPercentage = v +} + return nil +} + +func (p *TProgressUpdateResp) 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 { + temp := TJobExecutionStatus(v) + p.Status = temp +} + return nil +} + +func (p *TProgressUpdateResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.FooterSummary = v +} + return nil +} + +func (p *TProgressUpdateResp) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *TProgressUpdateResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TProgressUpdateResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TProgressUpdateResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "headerNames", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:headerNames: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.HeaderNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HeaderNames { + 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 1:headerNames: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + 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.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list 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 2:rows: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "progressedPercentage", thrift.DOUBLE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:progressedPercentage: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(p.ProgressedPercentage)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.progressedPercentage (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:progressedPercentage: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "footerSummary", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:footerSummary: ", p), err) } + if err := oprot.WriteString(ctx, string(p.FooterSummary)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.footerSummary (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:footerSummary: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "startTime", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:startTime: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.startTime (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:startTime: ", p), err) } + return err +} + +func (p *TProgressUpdateResp) Equals(other *TProgressUpdateResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.HeaderNames) != len(other.HeaderNames) { return false } + for i, _tgt := range p.HeaderNames { + _src54 := other.HeaderNames[i] + if _tgt != _src54 { return false } + } + if len(p.Rows) != len(other.Rows) { return false } + for i, _tgt := range p.Rows { + _src55 := other.Rows[i] + if len(_tgt) != len(_src55) { return false } + for i, _tgt := range _tgt { + _src56 := _src55[i] + if _tgt != _src56 { return false } + } + } + if p.ProgressedPercentage != other.ProgressedPercentage { return false } + if p.Status != other.Status { return false } + if p.FooterSummary != other.FooterSummary { return false } + if p.StartTime != other.StartTime { return false } + return true +} + +func (p *TProgressUpdateResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TProgressUpdateResp(%+v)", *p) +} + +// Attributes: +// - OperationHandle +type TGetQueryIdReq struct { + OperationHandle *TOperationHandle `thrift:"operationHandle,1,required" db:"operationHandle" json:"operationHandle"` +} + +func NewTGetQueryIdReq() *TGetQueryIdReq { + return &TGetQueryIdReq{} +} + +var TGetQueryIdReq_OperationHandle_DEFAULT *TOperationHandle +func (p *TGetQueryIdReq) GetOperationHandle() *TOperationHandle { + if !p.IsSetOperationHandle() { + return TGetQueryIdReq_OperationHandle_DEFAULT + } +return p.OperationHandle +} +func (p *TGetQueryIdReq) IsSetOperationHandle() bool { + return p.OperationHandle != nil +} + +func (p *TGetQueryIdReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetOperationHandle bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetOperationHandle = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetOperationHandle{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OperationHandle is not set")); + } + return nil +} + +func (p *TGetQueryIdReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.OperationHandle = &TOperationHandle{} + if err := p.OperationHandle.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.OperationHandle), err) + } + return nil +} + +func (p *TGetQueryIdReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetQueryIdReq"); 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 *TGetQueryIdReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "operationHandle", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:operationHandle: ", p), err) } + if err := p.OperationHandle.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.OperationHandle), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:operationHandle: ", p), err) } + return err +} + +func (p *TGetQueryIdReq) Equals(other *TGetQueryIdReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.OperationHandle.Equals(other.OperationHandle) { return false } + return true +} + +func (p *TGetQueryIdReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TGetQueryIdReq(%+v)", *p) +} + +// Attributes: +// - QueryId +type TGetQueryIdResp struct { + QueryId string `thrift:"queryId,1,required" db:"queryId" json:"queryId"` +} + +func NewTGetQueryIdResp() *TGetQueryIdResp { + return &TGetQueryIdResp{} +} + + +func (p *TGetQueryIdResp) GetQueryId() string { + return p.QueryId +} +func (p *TGetQueryIdResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetQueryId bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetQueryId = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetQueryId{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field QueryId is not set")); + } + return nil +} + +func (p *TGetQueryIdResp) 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.QueryId = v +} + return nil +} + +func (p *TGetQueryIdResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TGetQueryIdResp"); 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 *TGetQueryIdResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "queryId", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:queryId: ", p), err) } + if err := oprot.WriteString(ctx, string(p.QueryId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.queryId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:queryId: ", p), err) } + return err +} + +func (p *TGetQueryIdResp) Equals(other *TGetQueryIdResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.QueryId != other.QueryId { return false } + return true +} + +func (p *TGetQueryIdResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TGetQueryIdResp(%+v)", *p) +} + +type TCLIService interface { + // Parameters: + // - Req + OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) + // Parameters: + // - Req + CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) + // Parameters: + // - Req + GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) + // Parameters: + // - Req + ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) + // Parameters: + // - Req + GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) + // Parameters: + // - Req + GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) + // Parameters: + // - Req + GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) + // Parameters: + // - Req + GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) + // Parameters: + // - Req + GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) + // Parameters: + // - Req + GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) + // Parameters: + // - Req + GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) + // Parameters: + // - Req + GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) + // Parameters: + // - Req + GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) + // Parameters: + // - Req + GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) + // Parameters: + // - Req + CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) + // Parameters: + // - Req + CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) + // Parameters: + // - Req + GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) + // Parameters: + // - Req + FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) + // Parameters: + // - Req + GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) + // Parameters: + // - Req + CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) + // Parameters: + // - Req + RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) + // Parameters: + // - Req + GetQueryId(ctx context.Context, req *TGetQueryIdReq) (_r *TGetQueryIdResp, _err error) + // Parameters: + // - Req + SetClientInfo(ctx context.Context, req *TSetClientInfoReq) (_r *TSetClientInfoResp, _err error) +} + +type TCLIServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewTCLIServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *TCLIServiceClient { + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewTCLIServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *TCLIServiceClient { + return &TCLIServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewTCLIServiceClient(c thrift.TClient) *TCLIServiceClient { + return &TCLIServiceClient{ + c: c, + } +} + +func (p *TCLIServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *TCLIServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *TCLIServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) OpenSession(ctx context.Context, req *TOpenSessionReq) (_r *TOpenSessionResp, _err error) { + var _args57 TCLIServiceOpenSessionArgs + _args57.Req = req + var _result59 TCLIServiceOpenSessionResult + var _meta58 thrift.ResponseMeta + _meta58, _err = p.Client_().Call(ctx, "OpenSession", &_args57, &_result59) + p.SetLastResponseMeta_(_meta58) + if _err != nil { + return + } + return _result59.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) CloseSession(ctx context.Context, req *TCloseSessionReq) (_r *TCloseSessionResp, _err error) { + var _args60 TCLIServiceCloseSessionArgs + _args60.Req = req + var _result62 TCLIServiceCloseSessionResult + var _meta61 thrift.ResponseMeta + _meta61, _err = p.Client_().Call(ctx, "CloseSession", &_args60, &_result62) + p.SetLastResponseMeta_(_meta61) + if _err != nil { + return + } + return _result62.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetInfo(ctx context.Context, req *TGetInfoReq) (_r *TGetInfoResp, _err error) { + var _args63 TCLIServiceGetInfoArgs + _args63.Req = req + var _result65 TCLIServiceGetInfoResult + var _meta64 thrift.ResponseMeta + _meta64, _err = p.Client_().Call(ctx, "GetInfo", &_args63, &_result65) + p.SetLastResponseMeta_(_meta64) + if _err != nil { + return + } + return _result65.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) ExecuteStatement(ctx context.Context, req *TExecuteStatementReq) (_r *TExecuteStatementResp, _err error) { + var _args66 TCLIServiceExecuteStatementArgs + _args66.Req = req + var _result68 TCLIServiceExecuteStatementResult + var _meta67 thrift.ResponseMeta + _meta67, _err = p.Client_().Call(ctx, "ExecuteStatement", &_args66, &_result68) + p.SetLastResponseMeta_(_meta67) + if _err != nil { + return + } + return _result68.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetTypeInfo(ctx context.Context, req *TGetTypeInfoReq) (_r *TGetTypeInfoResp, _err error) { + var _args69 TCLIServiceGetTypeInfoArgs + _args69.Req = req + var _result71 TCLIServiceGetTypeInfoResult + var _meta70 thrift.ResponseMeta + _meta70, _err = p.Client_().Call(ctx, "GetTypeInfo", &_args69, &_result71) + p.SetLastResponseMeta_(_meta70) + if _err != nil { + return + } + return _result71.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetCatalogs(ctx context.Context, req *TGetCatalogsReq) (_r *TGetCatalogsResp, _err error) { + var _args72 TCLIServiceGetCatalogsArgs + _args72.Req = req + var _result74 TCLIServiceGetCatalogsResult + var _meta73 thrift.ResponseMeta + _meta73, _err = p.Client_().Call(ctx, "GetCatalogs", &_args72, &_result74) + p.SetLastResponseMeta_(_meta73) + if _err != nil { + return + } + return _result74.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetSchemas(ctx context.Context, req *TGetSchemasReq) (_r *TGetSchemasResp, _err error) { + var _args75 TCLIServiceGetSchemasArgs + _args75.Req = req + var _result77 TCLIServiceGetSchemasResult + var _meta76 thrift.ResponseMeta + _meta76, _err = p.Client_().Call(ctx, "GetSchemas", &_args75, &_result77) + p.SetLastResponseMeta_(_meta76) + if _err != nil { + return + } + return _result77.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetTables(ctx context.Context, req *TGetTablesReq) (_r *TGetTablesResp, _err error) { + var _args78 TCLIServiceGetTablesArgs + _args78.Req = req + var _result80 TCLIServiceGetTablesResult + var _meta79 thrift.ResponseMeta + _meta79, _err = p.Client_().Call(ctx, "GetTables", &_args78, &_result80) + p.SetLastResponseMeta_(_meta79) + if _err != nil { + return + } + return _result80.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetTableTypes(ctx context.Context, req *TGetTableTypesReq) (_r *TGetTableTypesResp, _err error) { + var _args81 TCLIServiceGetTableTypesArgs + _args81.Req = req + var _result83 TCLIServiceGetTableTypesResult + var _meta82 thrift.ResponseMeta + _meta82, _err = p.Client_().Call(ctx, "GetTableTypes", &_args81, &_result83) + p.SetLastResponseMeta_(_meta82) + if _err != nil { + return + } + return _result83.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetColumns(ctx context.Context, req *TGetColumnsReq) (_r *TGetColumnsResp, _err error) { + var _args84 TCLIServiceGetColumnsArgs + _args84.Req = req + var _result86 TCLIServiceGetColumnsResult + var _meta85 thrift.ResponseMeta + _meta85, _err = p.Client_().Call(ctx, "GetColumns", &_args84, &_result86) + p.SetLastResponseMeta_(_meta85) + if _err != nil { + return + } + return _result86.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetFunctions(ctx context.Context, req *TGetFunctionsReq) (_r *TGetFunctionsResp, _err error) { + var _args87 TCLIServiceGetFunctionsArgs + _args87.Req = req + var _result89 TCLIServiceGetFunctionsResult + var _meta88 thrift.ResponseMeta + _meta88, _err = p.Client_().Call(ctx, "GetFunctions", &_args87, &_result89) + p.SetLastResponseMeta_(_meta88) + if _err != nil { + return + } + return _result89.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetPrimaryKeys(ctx context.Context, req *TGetPrimaryKeysReq) (_r *TGetPrimaryKeysResp, _err error) { + var _args90 TCLIServiceGetPrimaryKeysArgs + _args90.Req = req + var _result92 TCLIServiceGetPrimaryKeysResult + var _meta91 thrift.ResponseMeta + _meta91, _err = p.Client_().Call(ctx, "GetPrimaryKeys", &_args90, &_result92) + p.SetLastResponseMeta_(_meta91) + if _err != nil { + return + } + return _result92.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetCrossReference(ctx context.Context, req *TGetCrossReferenceReq) (_r *TGetCrossReferenceResp, _err error) { + var _args93 TCLIServiceGetCrossReferenceArgs + _args93.Req = req + var _result95 TCLIServiceGetCrossReferenceResult + var _meta94 thrift.ResponseMeta + _meta94, _err = p.Client_().Call(ctx, "GetCrossReference", &_args93, &_result95) + p.SetLastResponseMeta_(_meta94) + if _err != nil { + return + } + return _result95.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetOperationStatus(ctx context.Context, req *TGetOperationStatusReq) (_r *TGetOperationStatusResp, _err error) { + var _args96 TCLIServiceGetOperationStatusArgs + _args96.Req = req + var _result98 TCLIServiceGetOperationStatusResult + var _meta97 thrift.ResponseMeta + _meta97, _err = p.Client_().Call(ctx, "GetOperationStatus", &_args96, &_result98) + p.SetLastResponseMeta_(_meta97) + if _err != nil { + return + } + return _result98.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) CancelOperation(ctx context.Context, req *TCancelOperationReq) (_r *TCancelOperationResp, _err error) { + var _args99 TCLIServiceCancelOperationArgs + _args99.Req = req + var _result101 TCLIServiceCancelOperationResult + var _meta100 thrift.ResponseMeta + _meta100, _err = p.Client_().Call(ctx, "CancelOperation", &_args99, &_result101) + p.SetLastResponseMeta_(_meta100) + if _err != nil { + return + } + return _result101.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) CloseOperation(ctx context.Context, req *TCloseOperationReq) (_r *TCloseOperationResp, _err error) { + var _args102 TCLIServiceCloseOperationArgs + _args102.Req = req + var _result104 TCLIServiceCloseOperationResult + var _meta103 thrift.ResponseMeta + _meta103, _err = p.Client_().Call(ctx, "CloseOperation", &_args102, &_result104) + p.SetLastResponseMeta_(_meta103) + if _err != nil { + return + } + return _result104.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetResultSetMetadata(ctx context.Context, req *TGetResultSetMetadataReq) (_r *TGetResultSetMetadataResp, _err error) { + var _args105 TCLIServiceGetResultSetMetadataArgs + _args105.Req = req + var _result107 TCLIServiceGetResultSetMetadataResult + var _meta106 thrift.ResponseMeta + _meta106, _err = p.Client_().Call(ctx, "GetResultSetMetadata", &_args105, &_result107) + p.SetLastResponseMeta_(_meta106) + if _err != nil { + return + } + return _result107.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) FetchResults(ctx context.Context, req *TFetchResultsReq) (_r *TFetchResultsResp, _err error) { + var _args108 TCLIServiceFetchResultsArgs + _args108.Req = req + var _result110 TCLIServiceFetchResultsResult + var _meta109 thrift.ResponseMeta + _meta109, _err = p.Client_().Call(ctx, "FetchResults", &_args108, &_result110) + p.SetLastResponseMeta_(_meta109) + if _err != nil { + return + } + return _result110.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetDelegationToken(ctx context.Context, req *TGetDelegationTokenReq) (_r *TGetDelegationTokenResp, _err error) { + var _args111 TCLIServiceGetDelegationTokenArgs + _args111.Req = req + var _result113 TCLIServiceGetDelegationTokenResult + var _meta112 thrift.ResponseMeta + _meta112, _err = p.Client_().Call(ctx, "GetDelegationToken", &_args111, &_result113) + p.SetLastResponseMeta_(_meta112) + if _err != nil { + return + } + return _result113.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) CancelDelegationToken(ctx context.Context, req *TCancelDelegationTokenReq) (_r *TCancelDelegationTokenResp, _err error) { + var _args114 TCLIServiceCancelDelegationTokenArgs + _args114.Req = req + var _result116 TCLIServiceCancelDelegationTokenResult + var _meta115 thrift.ResponseMeta + _meta115, _err = p.Client_().Call(ctx, "CancelDelegationToken", &_args114, &_result116) + p.SetLastResponseMeta_(_meta115) + if _err != nil { + return + } + return _result116.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) RenewDelegationToken(ctx context.Context, req *TRenewDelegationTokenReq) (_r *TRenewDelegationTokenResp, _err error) { + var _args117 TCLIServiceRenewDelegationTokenArgs + _args117.Req = req + var _result119 TCLIServiceRenewDelegationTokenResult + var _meta118 thrift.ResponseMeta + _meta118, _err = p.Client_().Call(ctx, "RenewDelegationToken", &_args117, &_result119) + p.SetLastResponseMeta_(_meta118) + if _err != nil { + return + } + return _result119.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) GetQueryId(ctx context.Context, req *TGetQueryIdReq) (_r *TGetQueryIdResp, _err error) { + var _args120 TCLIServiceGetQueryIdArgs + _args120.Req = req + var _result122 TCLIServiceGetQueryIdResult + var _meta121 thrift.ResponseMeta + _meta121, _err = p.Client_().Call(ctx, "GetQueryId", &_args120, &_result122) + p.SetLastResponseMeta_(_meta121) + if _err != nil { + return + } + return _result122.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *TCLIServiceClient) SetClientInfo(ctx context.Context, req *TSetClientInfoReq) (_r *TSetClientInfoResp, _err error) { + var _args123 TCLIServiceSetClientInfoArgs + _args123.Req = req + var _result125 TCLIServiceSetClientInfoResult + var _meta124 thrift.ResponseMeta + _meta124, _err = p.Client_().Call(ctx, "SetClientInfo", &_args123, &_result125) + p.SetLastResponseMeta_(_meta124) + if _err != nil { + return + } + return _result125.GetSuccess(), nil +} + +type TCLIServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler TCLIService +} + +func (p *TCLIServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *TCLIServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *TCLIServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewTCLIServiceProcessor(handler TCLIService) *TCLIServiceProcessor { + + self126 := &TCLIServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self126.processorMap["OpenSession"] = &tCLIServiceProcessorOpenSession{handler:handler} + self126.processorMap["CloseSession"] = &tCLIServiceProcessorCloseSession{handler:handler} + self126.processorMap["GetInfo"] = &tCLIServiceProcessorGetInfo{handler:handler} + self126.processorMap["ExecuteStatement"] = &tCLIServiceProcessorExecuteStatement{handler:handler} + self126.processorMap["GetTypeInfo"] = &tCLIServiceProcessorGetTypeInfo{handler:handler} + self126.processorMap["GetCatalogs"] = &tCLIServiceProcessorGetCatalogs{handler:handler} + self126.processorMap["GetSchemas"] = &tCLIServiceProcessorGetSchemas{handler:handler} + self126.processorMap["GetTables"] = &tCLIServiceProcessorGetTables{handler:handler} + self126.processorMap["GetTableTypes"] = &tCLIServiceProcessorGetTableTypes{handler:handler} + self126.processorMap["GetColumns"] = &tCLIServiceProcessorGetColumns{handler:handler} + self126.processorMap["GetFunctions"] = &tCLIServiceProcessorGetFunctions{handler:handler} + self126.processorMap["GetPrimaryKeys"] = &tCLIServiceProcessorGetPrimaryKeys{handler:handler} + self126.processorMap["GetCrossReference"] = &tCLIServiceProcessorGetCrossReference{handler:handler} + self126.processorMap["GetOperationStatus"] = &tCLIServiceProcessorGetOperationStatus{handler:handler} + self126.processorMap["CancelOperation"] = &tCLIServiceProcessorCancelOperation{handler:handler} + self126.processorMap["CloseOperation"] = &tCLIServiceProcessorCloseOperation{handler:handler} + self126.processorMap["GetResultSetMetadata"] = &tCLIServiceProcessorGetResultSetMetadata{handler:handler} + self126.processorMap["FetchResults"] = &tCLIServiceProcessorFetchResults{handler:handler} + self126.processorMap["GetDelegationToken"] = &tCLIServiceProcessorGetDelegationToken{handler:handler} + self126.processorMap["CancelDelegationToken"] = &tCLIServiceProcessorCancelDelegationToken{handler:handler} + self126.processorMap["RenewDelegationToken"] = &tCLIServiceProcessorRenewDelegationToken{handler:handler} + self126.processorMap["GetQueryId"] = &tCLIServiceProcessorGetQueryId{handler:handler} + self126.processorMap["SetClientInfo"] = &tCLIServiceProcessorSetClientInfo{handler:handler} +return self126 +} + +func (p *TCLIServiceProcessor) 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) + x127 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x127.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x127 + +} + +type tCLIServiceProcessorOpenSession struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorOpenSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceOpenSessionArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "OpenSession", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceOpenSessionResult{} + var retval *TOpenSessionResp + if retval, err2 = p.handler.OpenSession(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing OpenSession: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "OpenSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "OpenSession", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorCloseSession struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorCloseSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceCloseSessionArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseSession", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseSessionResult{} + var retval *TCloseSessionResp + if retval, err2 = p.handler.CloseSession(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseSession: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "CloseSession", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetInfo struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetInfoArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetInfo", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetInfoResult{} + var retval *TGetInfoResp + if retval, err2 = p.handler.GetInfo(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetInfo", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorExecuteStatement struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceExecuteStatementArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "ExecuteStatement", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceExecuteStatementResult{} + var retval *TExecuteStatementResp + if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "ExecuteStatement", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetTypeInfo struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetTypeInfoArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTypeInfo", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTypeInfoResult{} + var retval *TGetTypeInfoResp + if retval, err2 = p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetTypeInfo", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetCatalogs struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetCatalogsArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCatalogs", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCatalogsResult{} + var retval *TGetCatalogsResp + if retval, err2 = p.handler.GetCatalogs(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetCatalogs", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetSchemas struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetSchemasArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetSchemas", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetSchemasResult{} + var retval *TGetSchemasResp + if retval, err2 = p.handler.GetSchemas(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetSchemas", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetTables struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetTablesArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTables", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTablesResult{} + var retval *TGetTablesResp + if retval, err2 = p.handler.GetTables(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTables", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetTables", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetTableTypes struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetTableTypesArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTableTypes", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetTableTypesResult{} + var retval *TGetTableTypesResp + if retval, err2 = p.handler.GetTableTypes(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetTableTypes", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetColumns struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetColumnsArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetColumns", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetColumnsResult{} + var retval *TGetColumnsResp + if retval, err2 = p.handler.GetColumns(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetColumns", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetColumns", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetFunctions struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetFunctionsArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetFunctions", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetFunctionsResult{} + var retval *TGetFunctionsResp + if retval, err2 = p.handler.GetFunctions(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetFunctions", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetPrimaryKeys struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetPrimaryKeys) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetPrimaryKeysArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetPrimaryKeysResult{} + var retval *TGetPrimaryKeysResp + if retval, err2 = p.handler.GetPrimaryKeys(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetPrimaryKeys: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetPrimaryKeys", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetCrossReference struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetCrossReference) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetCrossReferenceArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCrossReference", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetCrossReferenceResult{} + var retval *TGetCrossReferenceResp + if retval, err2 = p.handler.GetCrossReference(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCrossReference: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetCrossReference", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetOperationStatus struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetOperationStatusArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetOperationStatus", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetOperationStatusResult{} + var retval *TGetOperationStatusResp + if retval, err2 = p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetOperationStatus", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorCancelOperation struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceCancelOperationArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelOperation", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelOperationResult{} + var retval *TCancelOperationResp + if retval, err2 = p.handler.CancelOperation(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "CancelOperation", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorCloseOperation struct { + handler TCLIService } -type tCLIServiceProcessorGetInfo struct { +func (p *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceCloseOperationArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseOperation", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCloseOperationResult{} + var retval *TCloseOperationResp + if retval, err2 = p.handler.CloseOperation(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "CloseOperation", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetResultSetMetadata struct { handler TCLIService } -func (p *tCLIServiceProcessorGetInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() +func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetResultSetMetadataArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return false, err + 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) } - iprot.ReadMessageEnd() - result := TCLIServiceGetInfoResult{} -var retval *TGetInfoResp + result := TCLIServiceGetResultSetMetadataResult{} + var retval *TGetResultSetMetadataResp + if retval, err2 = p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorFetchResults struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceFetchResultsArgs{} var err2 error - if retval, err2 = p.handler.GetInfo(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetInfo: " + err2.Error()) - oprot.WriteMessageBegin("GetInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "FetchResults", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceFetchResultsResult{} + var retval *TFetchResultsResp + if retval, err2 = p.handler.FetchResults(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "FetchResults", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "FetchResults", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetDelegationToken struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetDelegationTokenArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetDelegationToken", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetDelegationTokenResult{} + var retval *TGetDelegationTokenResp + if retval, err2 = p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetDelegationToken", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorCancelDelegationToken struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceCancelDelegationTokenArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelDelegationToken", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceCancelDelegationTokenResult{} + var retval *TCancelDelegationTokenResp + if retval, err2 = p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorRenewDelegationToken struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceRenewDelegationTokenArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "RenewDelegationToken", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceRenewDelegationTokenResult{} + var retval *TRenewDelegationTokenResp + if retval, err2 = p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + +type tCLIServiceProcessorGetQueryId struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorGetQueryId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceGetQueryIdArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "GetQueryId", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceGetQueryIdResult{} + var retval *TGetQueryIdResp + if retval, err2 = p.handler.GetQueryId(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetQueryId: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "GetQueryId", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) oprot.Flush(ctx) - return true, err2 + return true, thrift.WrapTException(err2) } else { result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "GetQueryId", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err } - if err2 = oprot.WriteMessageBegin("GetInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 + +type tCLIServiceProcessorSetClientInfo struct { + handler TCLIService +} + +func (p *tCLIServiceProcessorSetClientInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := TCLIServiceSetClientInfoArgs{} + var err2 error + if err2 = args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "SetClientInfo", 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.CancelFunc + ctx, cancel = context.WithCancel(ctx) + defer cancel() + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel() + return + } + } + } + }(tickerCtx, cancel) + } + + result := TCLIServiceSetClientInfoResult{} + var retval *TSetClientInfoResp + if retval, err2 = p.handler.SetClientInfo(ctx, args.Req); err2 != nil { + tickerCancel() + if err2 == thrift.ErrAbandonRequest { + return false, thrift.WrapTException(err2) + } + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing SetClientInfo: " + err2.Error()) + oprot.WriteMessageBegin(ctx, "SetClientInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return true, thrift.WrapTException(err2) + } else { + result.Success = retval + } + tickerCancel() + if err2 = oprot.WriteMessageBegin(ctx, "SetClientInfo", thrift.REPLY, seqId); err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err2 = result.Write(ctx, oprot); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err2 = oprot.WriteMessageEnd(ctx); err == nil && err2 != nil { + err = thrift.WrapTException(err2) } if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + err = thrift.WrapTException(err2) + } + if err != nil { + return + } + return true, err +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type TCLIServiceOpenSessionArgs struct { + Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs { + return &TCLIServiceOpenSessionArgs{} +} + +var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq +func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq { + if !p.IsSetReq() { + return TCLIServiceOpenSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *TCLIServiceOpenSessionArgs) 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 *TCLIServiceOpenSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TOpenSessionReq{ + ClientProtocol: 9, +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } - if err != nil { - return + return nil +} + +func (p *TCLIServiceOpenSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "OpenSession_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 } } - return true, 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 } -type tCLIServiceProcessorExecuteStatement struct { - handler TCLIService +func (p *TCLIServiceOpenSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } -func (p *tCLIServiceProcessorExecuteStatement) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceExecuteStatementArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceOpenSessionArgs) String() string { + if p == nil { + return "" } + return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) +} - iprot.ReadMessageEnd() - result := TCLIServiceExecuteStatementResult{} -var retval *TExecuteStatementResp - var err2 error - if retval, err2 = p.handler.ExecuteStatement(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing ExecuteStatement: " + err2.Error()) - oprot.WriteMessageBegin("ExecuteStatement", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +// Attributes: +// - Success +type TCLIServiceOpenSessionResult struct { + Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } - if err2 = oprot.WriteMessageBegin("ExecuteStatement", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + +func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult { + return &TCLIServiceOpenSessionResult{} +} + +var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp +func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp { + if !p.IsSetSuccess() { + return TCLIServiceOpenSessionResult_Success_DEFAULT } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 +return p.Success +} +func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TCLIServiceOpenSessionResult) 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) } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + + 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 + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } } - if err != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return true, err + return nil } -type tCLIServiceProcessorGetTypeInfo struct { - handler TCLIService +func (p *TCLIServiceOpenSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TOpenSessionResp{ + ServerProtocolVersion: 9, } - -func (p *tCLIServiceProcessorGetTypeInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTypeInfoArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } - - iprot.ReadMessageEnd() - result := TCLIServiceGetTypeInfoResult{} -var retval *TGetTypeInfoResp - var err2 error - if retval, err2 = p.handler.GetTypeInfo(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTypeInfo: " + err2.Error()) - oprot.WriteMessageBegin("GetTypeInfo", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + return nil } - if err2 = oprot.WriteMessageBegin("GetTypeInfo", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + +func (p *TCLIServiceOpenSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "OpenSession_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 err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + 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 *TCLIServiceOpenSessionResult) 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) } } - if err != nil { - return + return err +} + +func (p *TCLIServiceOpenSessionResult) String() string { + if p == nil { + return "" } - return true, err + return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) } -type tCLIServiceProcessorGetCatalogs struct { - handler TCLIService +// Attributes: +// - Req +type TCLIServiceCloseSessionArgs struct { + Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` } -func (p *tCLIServiceProcessorGetCatalogs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetCatalogsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs { + return &TCLIServiceCloseSessionArgs{} +} - iprot.ReadMessageEnd() - result := TCLIServiceGetCatalogsResult{} -var retval *TGetCatalogsResp - var err2 error - if retval, err2 = p.handler.GetCatalogs(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetCatalogs: " + err2.Error()) - oprot.WriteMessageBegin("GetCatalogs", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq +func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq { + if !p.IsSetReq() { + return TCLIServiceCloseSessionArgs_Req_DEFAULT + } +return p.Req +} +func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool { + return p.Req != nil } - if err2 = oprot.WriteMessageBegin("GetCatalogs", thrift.REPLY, seqId); err2 != nil { - err = err2 + +func (p *TCLIServiceCloseSessionArgs) 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) } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + + + 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 err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *TCLIServiceCloseSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } - if err != nil { - return + return nil +} + +func (p *TCLIServiceCloseSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CloseSession_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 } } - return true, 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 } -type tCLIServiceProcessorGetSchemas struct { - handler TCLIService +func (p *TCLIServiceCloseSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } -func (p *tCLIServiceProcessorGetSchemas) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetSchemasArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetSchemas", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceCloseSessionArgs) String() string { + if p == nil { + return "" } + return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) +} - iprot.ReadMessageEnd() - result := TCLIServiceGetSchemasResult{} -var retval *TGetSchemasResp - var err2 error - if retval, err2 = p.handler.GetSchemas(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetSchemas: " + err2.Error()) - oprot.WriteMessageBegin("GetSchemas", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +// Attributes: +// - Success +type TCLIServiceCloseSessionResult struct { + Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` } - if err2 = oprot.WriteMessageBegin("GetSchemas", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + +func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult { + return &TCLIServiceCloseSessionResult{} +} + +var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp +func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp { + if !p.IsSetSuccess() { + return TCLIServiceCloseSessionResult_Success_DEFAULT } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 +return p.Success +} +func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *TCLIServiceCloseSessionResult) 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) } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + + 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 + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } } - if err != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return true, err + return nil } -type tCLIServiceProcessorGetTables struct { - handler TCLIService +func (p *TCLIServiceCloseSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseSessionResp{} + 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 *tCLIServiceProcessorGetTables) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTablesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetTables", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceCloseSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CloseSession_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 } } - - iprot.ReadMessageEnd() - result := TCLIServiceGetTablesResult{} -var retval *TGetTablesResp - var err2 error - if retval, err2 = p.handler.GetTables(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTables: " + err2.Error()) - oprot.WriteMessageBegin("GetTables", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + 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 } - if err2 = oprot.WriteMessageBegin("GetTables", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +func (p *TCLIServiceCloseSessionResult) 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 true, err + return err } -type tCLIServiceProcessorGetTableTypes struct { - handler TCLIService +func (p *TCLIServiceCloseSessionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) } -func (p *tCLIServiceProcessorGetTableTypes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetTableTypesArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +// Attributes: +// - Req +type TCLIServiceGetInfoArgs struct { + Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` +} - iprot.ReadMessageEnd() - result := TCLIServiceGetTableTypesResult{} -var retval *TGetTableTypesResp - var err2 error - if retval, err2 = p.handler.GetTableTypes(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetTableTypes: " + err2.Error()) - oprot.WriteMessageBegin("GetTableTypes", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs { + return &TCLIServiceGetInfoArgs{} } - if err2 = oprot.WriteMessageBegin("GetTableTypes", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq +func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq { + if !p.IsSetReq() { + return TCLIServiceGetInfoArgs_Req_DEFAULT } - return true, err +return p.Req } - -type tCLIServiceProcessorGetColumns struct { - handler TCLIService +func (p *TCLIServiceGetInfoArgs) IsSetReq() bool { + return p.Req != nil } -func (p *tCLIServiceProcessorGetColumns) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetColumnsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetColumns", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceGetInfoArgs) 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) } - iprot.ReadMessageEnd() - result := TCLIServiceGetColumnsResult{} -var retval *TGetColumnsResp - var err2 error - if retval, err2 = p.handler.GetColumns(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetColumns: " + err2.Error()) - oprot.WriteMessageBegin("GetColumns", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("GetColumns", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return true, err + return nil } -type tCLIServiceProcessorGetFunctions struct { - handler TCLIService +func (p *TCLIServiceGetInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } -func (p *tCLIServiceProcessorGetFunctions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetFunctionsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetFunctions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceGetInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetInfo_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 } } - - iprot.ReadMessageEnd() - result := TCLIServiceGetFunctionsResult{} -var retval *TGetFunctionsResp - var err2 error - if retval, err2 = p.handler.GetFunctions(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetFunctions: " + err2.Error()) - oprot.WriteMessageBegin("GetFunctions", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + 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 } - if err2 = oprot.WriteMessageBegin("GetFunctions", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +func (p *TCLIServiceGetInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - return true, err + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } -type tCLIServiceProcessorGetOperationStatus struct { - handler TCLIService +func (p *TCLIServiceGetInfoArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) } -func (p *tCLIServiceProcessorGetOperationStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetOperationStatusArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +// Attributes: +// - Success +type TCLIServiceGetInfoResult struct { + Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} - iprot.ReadMessageEnd() - result := TCLIServiceGetOperationStatusResult{} -var retval *TGetOperationStatusResp - var err2 error - if retval, err2 = p.handler.GetOperationStatus(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetOperationStatus: " + err2.Error()) - oprot.WriteMessageBegin("GetOperationStatus", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult { + return &TCLIServiceGetInfoResult{} } - if err2 = oprot.WriteMessageBegin("GetOperationStatus", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp +func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp { + if !p.IsSetSuccess() { + return TCLIServiceGetInfoResult_Success_DEFAULT } - return true, err +return p.Success } - -type tCLIServiceProcessorCancelOperation struct { - handler TCLIService +func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool { + return p.Success != nil } -func (p *tCLIServiceProcessorCancelOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCancelOperationArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CancelOperation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceGetInfoResult) 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) } - iprot.ReadMessageEnd() - result := TCLIServiceCancelOperationResult{} -var retval *TCancelOperationResp - var err2 error - if retval, err2 = p.handler.CancelOperation(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelOperation: " + err2.Error()) - oprot.WriteMessageBegin("CancelOperation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("CancelOperation", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } } - if err != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return true, err + return nil } -type tCLIServiceProcessorCloseOperation struct { - handler TCLIService +func (p *TCLIServiceGetInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetInfoResp{} + 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 *tCLIServiceProcessorCloseOperation) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCloseOperationArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CloseOperation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceGetInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetInfo_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 } } - - iprot.ReadMessageEnd() - result := TCLIServiceCloseOperationResult{} -var retval *TCloseOperationResp - var err2 error - if retval, err2 = p.handler.CloseOperation(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOperation: " + err2.Error()) - oprot.WriteMessageBegin("CloseOperation", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + 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 } - if err2 = oprot.WriteMessageBegin("CloseOperation", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +func (p *TCLIServiceGetInfoResult) 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 true, err + return err } -type tCLIServiceProcessorGetResultSetMetadata struct { - handler TCLIService +func (p *TCLIServiceGetInfoResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) } -func (p *tCLIServiceProcessorGetResultSetMetadata) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetResultSetMetadataArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +// Attributes: +// - Req +type TCLIServiceExecuteStatementArgs struct { + Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` +} - iprot.ReadMessageEnd() - result := TCLIServiceGetResultSetMetadataResult{} -var retval *TGetResultSetMetadataResp - var err2 error - if retval, err2 = p.handler.GetResultSetMetadata(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetResultSetMetadata: " + err2.Error()) - oprot.WriteMessageBegin("GetResultSetMetadata", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs { + return &TCLIServiceExecuteStatementArgs{} } - if err2 = oprot.WriteMessageBegin("GetResultSetMetadata", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq +func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq { + if !p.IsSetReq() { + return TCLIServiceExecuteStatementArgs_Req_DEFAULT } - return true, err +return p.Req } - -type tCLIServiceProcessorFetchResults struct { - handler TCLIService +func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool { + return p.Req != nil } -func (p *tCLIServiceProcessorFetchResults) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceFetchResultsArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("FetchResults", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceExecuteStatementArgs) 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) } - iprot.ReadMessageEnd() - result := TCLIServiceFetchResultsResult{} -var retval *TFetchResultsResp - var err2 error - if retval, err2 = p.handler.FetchResults(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing FetchResults: " + err2.Error()) - oprot.WriteMessageBegin("FetchResults", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("FetchResults", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + + 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 != nil { - return + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - return true, err + return nil } -type tCLIServiceProcessorGetDelegationToken struct { - handler TCLIService +func (p *TCLIServiceExecuteStatementArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TExecuteStatementReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil } -func (p *tCLIServiceProcessorGetDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceGetDelegationTokenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceExecuteStatementArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_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 } } - - iprot.ReadMessageEnd() - result := TCLIServiceGetDelegationTokenResult{} -var retval *TGetDelegationTokenResp - var err2 error - if retval, err2 = p.handler.GetDelegationToken(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing GetDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin("GetDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval + 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 } - if err2 = oprot.WriteMessageBegin("GetDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +func (p *TCLIServiceExecuteStatementArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - return true, err + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err } -type tCLIServiceProcessorCancelDelegationToken struct { - handler TCLIService +func (p *TCLIServiceExecuteStatementArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) } -func (p *tCLIServiceProcessorCancelDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceCancelDelegationTokenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } +// Attributes: +// - Success +type TCLIServiceExecuteStatementResult struct { + Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} - iprot.ReadMessageEnd() - result := TCLIServiceCancelDelegationTokenResult{} -var retval *TCancelDelegationTokenResp - var err2 error - if retval, err2 = p.handler.CancelDelegationToken(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CancelDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin("CancelDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval +func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult { + return &TCLIServiceExecuteStatementResult{} } - if err2 = oprot.WriteMessageBegin("CancelDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return + +var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp +func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp { + if !p.IsSetSuccess() { + return TCLIServiceExecuteStatementResult_Success_DEFAULT } - return true, err +return p.Success } - -type tCLIServiceProcessorRenewDelegationToken struct { - handler TCLIService +func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool { + return p.Success != nil } -func (p *tCLIServiceProcessorRenewDelegationToken) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := TCLIServiceRenewDelegationTokenArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err +func (p *TCLIServiceExecuteStatementResult) 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) } - iprot.ReadMessageEnd() - result := TCLIServiceRenewDelegationTokenResult{} -var retval *TRenewDelegationTokenResp - var err2 error - if retval, err2 = p.handler.RenewDelegationToken(ctx, args.Req); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing RenewDelegationToken: " + err2.Error()) - oprot.WriteMessageBegin("RenewDelegationToken", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval -} - if err2 = oprot.WriteMessageBegin("RenewDelegationToken", thrift.REPLY, seqId); err2 != nil { - err = err2 + + 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 + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *TCLIServiceExecuteStatementResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TExecuteStatementResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 + return nil +} + +func (p *TCLIServiceExecuteStatementResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ExecuteStatement_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 != nil { - return + 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 *TCLIServiceExecuteStatementResult) 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 true, err + return err } - -// HELPER FUNCTIONS AND STRUCTURES +func (p *TCLIServiceExecuteStatementResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) +} // Attributes: // - Req -type TCLIServiceOpenSessionArgs struct { - Req *TOpenSessionReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetTypeInfoArgs struct { + Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceOpenSessionArgs() *TCLIServiceOpenSessionArgs { - return &TCLIServiceOpenSessionArgs{} +func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs { + return &TCLIServiceGetTypeInfoArgs{} } -var TCLIServiceOpenSessionArgs_Req_DEFAULT *TOpenSessionReq -func (p *TCLIServiceOpenSessionArgs) GetReq() *TOpenSessionReq { +var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq +func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq { if !p.IsSetReq() { - return TCLIServiceOpenSessionArgs_Req_DEFAULT + return TCLIServiceGetTypeInfoArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceOpenSessionArgs) IsSetReq() bool { +func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceOpenSessionArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTypeInfoArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14201,99 +19596,97 @@ func (p *TCLIServiceOpenSessionArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceOpenSessionArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TOpenSessionReq{ - ClientProtocol: 7, -} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetTypeInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTypeInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceOpenSessionArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("OpenSession_args"); err != nil { +func (p *TCLIServiceGetTypeInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceOpenSessionArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetTypeInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceOpenSessionArgs) String() string { +func (p *TCLIServiceGetTypeInfoArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceOpenSessionArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceOpenSessionResult struct { - Success *TOpenSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetTypeInfoResult struct { + Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceOpenSessionResult() *TCLIServiceOpenSessionResult { - return &TCLIServiceOpenSessionResult{} +func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult { + return &TCLIServiceGetTypeInfoResult{} } -var TCLIServiceOpenSessionResult_Success_DEFAULT *TOpenSessionResp -func (p *TCLIServiceOpenSessionResult) GetSuccess() *TOpenSessionResp { +var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp +func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp { if !p.IsSetSuccess() { - return TCLIServiceOpenSessionResult_Success_DEFAULT + return TCLIServiceGetTypeInfoResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceOpenSessionResult) IsSetSuccess() bool { +func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceOpenSessionResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTypeInfoResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14301,101 +19694,99 @@ func (p *TCLIServiceOpenSessionResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceOpenSessionResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TOpenSessionResp{ - ServerProtocolVersion: 7, -} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetTypeInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTypeInfoResp{} + 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 *TCLIServiceOpenSessionResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("OpenSession_result"); err != nil { +func (p *TCLIServiceGetTypeInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTypeInfo_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceOpenSessionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetTypeInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceOpenSessionResult) String() string { +func (p *TCLIServiceGetTypeInfoResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceOpenSessionResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceCloseSessionArgs struct { - Req *TCloseSessionReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetCatalogsArgs struct { + Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceCloseSessionArgs() *TCLIServiceCloseSessionArgs { - return &TCLIServiceCloseSessionArgs{} +func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs { + return &TCLIServiceGetCatalogsArgs{} } -var TCLIServiceCloseSessionArgs_Req_DEFAULT *TCloseSessionReq -func (p *TCLIServiceCloseSessionArgs) GetReq() *TCloseSessionReq { +var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq +func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq { if !p.IsSetReq() { - return TCLIServiceCloseSessionArgs_Req_DEFAULT + return TCLIServiceGetCatalogsArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceCloseSessionArgs) IsSetReq() bool { +func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceCloseSessionArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetCatalogsArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14403,97 +19794,97 @@ func (p *TCLIServiceCloseSessionArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCloseSessionArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TCloseSessionReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetCatalogsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCatalogsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceCloseSessionArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CloseSession_args"); err != nil { +func (p *TCLIServiceGetCatalogsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCloseSessionArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetCatalogsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceCloseSessionArgs) String() string { +func (p *TCLIServiceGetCatalogsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCloseSessionArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceCloseSessionResult struct { - Success *TCloseSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetCatalogsResult struct { + Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceCloseSessionResult() *TCLIServiceCloseSessionResult { - return &TCLIServiceCloseSessionResult{} +func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult { + return &TCLIServiceGetCatalogsResult{} } -var TCLIServiceCloseSessionResult_Success_DEFAULT *TCloseSessionResp -func (p *TCLIServiceCloseSessionResult) GetSuccess() *TCloseSessionResp { +var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp +func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp { if !p.IsSetSuccess() { - return TCLIServiceCloseSessionResult_Success_DEFAULT + return TCLIServiceGetCatalogsResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceCloseSessionResult) IsSetSuccess() bool { +func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceCloseSessionResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetCatalogsResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14501,99 +19892,99 @@ func (p *TCLIServiceCloseSessionResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCloseSessionResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TCloseSessionResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetCatalogsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCatalogsResp{} + 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 *TCLIServiceCloseSessionResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CloseSession_result"); err != nil { +func (p *TCLIServiceGetCatalogsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetCatalogs_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCloseSessionResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetCatalogsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceCloseSessionResult) String() string { +func (p *TCLIServiceGetCatalogsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCloseSessionResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetInfoArgs struct { - Req *TGetInfoReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetSchemasArgs struct { + Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetInfoArgs() *TCLIServiceGetInfoArgs { - return &TCLIServiceGetInfoArgs{} +func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs { + return &TCLIServiceGetSchemasArgs{} } -var TCLIServiceGetInfoArgs_Req_DEFAULT *TGetInfoReq -func (p *TCLIServiceGetInfoArgs) GetReq() *TGetInfoReq { +var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq +func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq { if !p.IsSetReq() { - return TCLIServiceGetInfoArgs_Req_DEFAULT + return TCLIServiceGetSchemasArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetInfoArgs) IsSetReq() bool { +func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetInfoArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetSchemasArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14601,97 +19992,97 @@ func (p *TCLIServiceGetInfoArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetInfoArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetInfoReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetSchemasArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetSchemasReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetInfoArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetInfo_args"); err != nil { +func (p *TCLIServiceGetSchemasArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSchemas_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetSchemasArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetInfoArgs) String() string { +func (p *TCLIServiceGetSchemasArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetInfoArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetInfoResult struct { - Success *TGetInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetSchemasResult struct { + Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetInfoResult() *TCLIServiceGetInfoResult { - return &TCLIServiceGetInfoResult{} +func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult { + return &TCLIServiceGetSchemasResult{} } -var TCLIServiceGetInfoResult_Success_DEFAULT *TGetInfoResp -func (p *TCLIServiceGetInfoResult) GetSuccess() *TGetInfoResp { +var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp +func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp { if !p.IsSetSuccess() { - return TCLIServiceGetInfoResult_Success_DEFAULT + return TCLIServiceGetSchemasResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetInfoResult) IsSetSuccess() bool { +func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetInfoResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetSchemasResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14699,99 +20090,99 @@ func (p *TCLIServiceGetInfoResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetInfoResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetInfoResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetSchemasResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetSchemasResp{} + 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 *TCLIServiceGetInfoResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetInfo_result"); err != nil { +func (p *TCLIServiceGetSchemasResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSchemas_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetInfoResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetSchemasResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetInfoResult) String() string { +func (p *TCLIServiceGetSchemasResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetInfoResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceExecuteStatementArgs struct { - Req *TExecuteStatementReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetTablesArgs struct { + Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceExecuteStatementArgs() *TCLIServiceExecuteStatementArgs { - return &TCLIServiceExecuteStatementArgs{} +func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs { + return &TCLIServiceGetTablesArgs{} } -var TCLIServiceExecuteStatementArgs_Req_DEFAULT *TExecuteStatementReq -func (p *TCLIServiceExecuteStatementArgs) GetReq() *TExecuteStatementReq { +var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq +func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq { if !p.IsSetReq() { - return TCLIServiceExecuteStatementArgs_Req_DEFAULT + return TCLIServiceGetTablesArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceExecuteStatementArgs) IsSetReq() bool { +func (p *TCLIServiceGetTablesArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceExecuteStatementArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTablesArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14799,97 +20190,97 @@ func (p *TCLIServiceExecuteStatementArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceExecuteStatementArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TExecuteStatementReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetTablesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTablesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceExecuteStatementArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("ExecuteStatement_args"); err != nil { +func (p *TCLIServiceGetTablesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTables_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceExecuteStatementArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetTablesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceExecuteStatementArgs) String() string { +func (p *TCLIServiceGetTablesArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceExecuteStatementArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceExecuteStatementResult struct { - Success *TExecuteStatementResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetTablesResult struct { + Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceExecuteStatementResult() *TCLIServiceExecuteStatementResult { - return &TCLIServiceExecuteStatementResult{} +func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult { + return &TCLIServiceGetTablesResult{} } -var TCLIServiceExecuteStatementResult_Success_DEFAULT *TExecuteStatementResp -func (p *TCLIServiceExecuteStatementResult) GetSuccess() *TExecuteStatementResp { +var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp +func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp { if !p.IsSetSuccess() { - return TCLIServiceExecuteStatementResult_Success_DEFAULT + return TCLIServiceGetTablesResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceExecuteStatementResult) IsSetSuccess() bool { +func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceExecuteStatementResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTablesResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14897,99 +20288,99 @@ func (p *TCLIServiceExecuteStatementResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceExecuteStatementResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TExecuteStatementResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetTablesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTablesResp{} + 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 *TCLIServiceExecuteStatementResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("ExecuteStatement_result"); err != nil { +func (p *TCLIServiceGetTablesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTables_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceExecuteStatementResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetTablesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceExecuteStatementResult) String() string { +func (p *TCLIServiceGetTablesResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceExecuteStatementResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetTypeInfoArgs struct { - Req *TGetTypeInfoReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetTableTypesArgs struct { + Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetTypeInfoArgs() *TCLIServiceGetTypeInfoArgs { - return &TCLIServiceGetTypeInfoArgs{} +func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs { + return &TCLIServiceGetTableTypesArgs{} } -var TCLIServiceGetTypeInfoArgs_Req_DEFAULT *TGetTypeInfoReq -func (p *TCLIServiceGetTypeInfoArgs) GetReq() *TGetTypeInfoReq { +var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq +func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq { if !p.IsSetReq() { - return TCLIServiceGetTypeInfoArgs_Req_DEFAULT + return TCLIServiceGetTableTypesArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetTypeInfoArgs) IsSetReq() bool { +func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetTypeInfoArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTableTypesArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -14997,97 +20388,97 @@ func (p *TCLIServiceGetTypeInfoArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTypeInfoArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetTypeInfoReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetTableTypesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetTableTypesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetTypeInfoArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTypeInfo_args"); err != nil { +func (p *TCLIServiceGetTableTypesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTypeInfoArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetTableTypesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetTypeInfoArgs) String() string { +func (p *TCLIServiceGetTableTypesArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTypeInfoArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetTypeInfoResult struct { - Success *TGetTypeInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetTableTypesResult struct { + Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetTypeInfoResult() *TCLIServiceGetTypeInfoResult { - return &TCLIServiceGetTypeInfoResult{} +func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult { + return &TCLIServiceGetTableTypesResult{} } -var TCLIServiceGetTypeInfoResult_Success_DEFAULT *TGetTypeInfoResp -func (p *TCLIServiceGetTypeInfoResult) GetSuccess() *TGetTypeInfoResp { +var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp +func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp { if !p.IsSetSuccess() { - return TCLIServiceGetTypeInfoResult_Success_DEFAULT + return TCLIServiceGetTableTypesResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetTypeInfoResult) IsSetSuccess() bool { +func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetTypeInfoResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetTableTypesResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15095,99 +20486,99 @@ func (p *TCLIServiceGetTypeInfoResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTypeInfoResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetTypeInfoResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetTableTypesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetTableTypesResp{} + 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 *TCLIServiceGetTypeInfoResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTypeInfo_result"); err != nil { +func (p *TCLIServiceGetTableTypesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTableTypes_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTypeInfoResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetTableTypesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetTypeInfoResult) String() string { +func (p *TCLIServiceGetTableTypesResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTypeInfoResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetCatalogsArgs struct { - Req *TGetCatalogsReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetColumnsArgs struct { + Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetCatalogsArgs() *TCLIServiceGetCatalogsArgs { - return &TCLIServiceGetCatalogsArgs{} +func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs { + return &TCLIServiceGetColumnsArgs{} } -var TCLIServiceGetCatalogsArgs_Req_DEFAULT *TGetCatalogsReq -func (p *TCLIServiceGetCatalogsArgs) GetReq() *TGetCatalogsReq { +var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq +func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq { if !p.IsSetReq() { - return TCLIServiceGetCatalogsArgs_Req_DEFAULT + return TCLIServiceGetColumnsArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetCatalogsArgs) IsSetReq() bool { +func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetCatalogsArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetColumnsArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15195,97 +20586,97 @@ func (p *TCLIServiceGetCatalogsArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetCatalogsArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetCatalogsReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetColumnsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetColumnsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetCatalogsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetCatalogs_args"); err != nil { +func (p *TCLIServiceGetColumnsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetColumns_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetCatalogsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetColumnsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetCatalogsArgs) String() string { +func (p *TCLIServiceGetColumnsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetCatalogsArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetCatalogsResult struct { - Success *TGetCatalogsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetColumnsResult struct { + Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetCatalogsResult() *TCLIServiceGetCatalogsResult { - return &TCLIServiceGetCatalogsResult{} +func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult { + return &TCLIServiceGetColumnsResult{} } -var TCLIServiceGetCatalogsResult_Success_DEFAULT *TGetCatalogsResp -func (p *TCLIServiceGetCatalogsResult) GetSuccess() *TGetCatalogsResp { +var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp +func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp { if !p.IsSetSuccess() { - return TCLIServiceGetCatalogsResult_Success_DEFAULT + return TCLIServiceGetColumnsResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetCatalogsResult) IsSetSuccess() bool { +func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetCatalogsResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetColumnsResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15293,99 +20684,99 @@ func (p *TCLIServiceGetCatalogsResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetCatalogsResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetCatalogsResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetColumnsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetColumnsResp{} + 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 *TCLIServiceGetCatalogsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetCatalogs_result"); err != nil { +func (p *TCLIServiceGetColumnsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetColumns_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetCatalogsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetColumnsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetCatalogsResult) String() string { +func (p *TCLIServiceGetColumnsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetCatalogsResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetSchemasArgs struct { - Req *TGetSchemasReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetFunctionsArgs struct { + Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetSchemasArgs() *TCLIServiceGetSchemasArgs { - return &TCLIServiceGetSchemasArgs{} +func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs { + return &TCLIServiceGetFunctionsArgs{} } -var TCLIServiceGetSchemasArgs_Req_DEFAULT *TGetSchemasReq -func (p *TCLIServiceGetSchemasArgs) GetReq() *TGetSchemasReq { +var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq +func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq { if !p.IsSetReq() { - return TCLIServiceGetSchemasArgs_Req_DEFAULT + return TCLIServiceGetFunctionsArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetSchemasArgs) IsSetReq() bool { +func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetSchemasArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetFunctionsArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15393,97 +20784,97 @@ func (p *TCLIServiceGetSchemasArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetSchemasArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetSchemasReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetFunctionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetFunctionsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetSchemasArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetSchemas_args"); err != nil { +func (p *TCLIServiceGetFunctionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetFunctions_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetSchemasArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetFunctionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetSchemasArgs) String() string { +func (p *TCLIServiceGetFunctionsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetSchemasArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetSchemasResult struct { - Success *TGetSchemasResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetFunctionsResult struct { + Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetSchemasResult() *TCLIServiceGetSchemasResult { - return &TCLIServiceGetSchemasResult{} +func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult { + return &TCLIServiceGetFunctionsResult{} } -var TCLIServiceGetSchemasResult_Success_DEFAULT *TGetSchemasResp -func (p *TCLIServiceGetSchemasResult) GetSuccess() *TGetSchemasResp { +var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp +func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp { if !p.IsSetSuccess() { - return TCLIServiceGetSchemasResult_Success_DEFAULT + return TCLIServiceGetFunctionsResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetSchemasResult) IsSetSuccess() bool { +func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetSchemasResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetFunctionsResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15491,99 +20882,99 @@ func (p *TCLIServiceGetSchemasResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetSchemasResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetSchemasResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetFunctionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetFunctionsResp{} + 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 *TCLIServiceGetSchemasResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetSchemas_result"); err != nil { +func (p *TCLIServiceGetFunctionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetFunctions_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetSchemasResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetFunctionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetSchemasResult) String() string { +func (p *TCLIServiceGetFunctionsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetSchemasResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetTablesArgs struct { - Req *TGetTablesReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetPrimaryKeysArgs struct { + Req *TGetPrimaryKeysReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetTablesArgs() *TCLIServiceGetTablesArgs { - return &TCLIServiceGetTablesArgs{} +func NewTCLIServiceGetPrimaryKeysArgs() *TCLIServiceGetPrimaryKeysArgs { + return &TCLIServiceGetPrimaryKeysArgs{} } -var TCLIServiceGetTablesArgs_Req_DEFAULT *TGetTablesReq -func (p *TCLIServiceGetTablesArgs) GetReq() *TGetTablesReq { +var TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT *TGetPrimaryKeysReq +func (p *TCLIServiceGetPrimaryKeysArgs) GetReq() *TGetPrimaryKeysReq { if !p.IsSetReq() { - return TCLIServiceGetTablesArgs_Req_DEFAULT + return TCLIServiceGetPrimaryKeysArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetTablesArgs) IsSetReq() bool { +func (p *TCLIServiceGetPrimaryKeysArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetTablesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetPrimaryKeysArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15591,97 +20982,97 @@ func (p *TCLIServiceGetTablesArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTablesArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetTablesReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetPrimaryKeysArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetPrimaryKeysReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetTablesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTables_args"); err != nil { +func (p *TCLIServiceGetPrimaryKeysArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTablesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetPrimaryKeysArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetTablesArgs) String() string { +func (p *TCLIServiceGetPrimaryKeysArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTablesArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetPrimaryKeysArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetTablesResult struct { - Success *TGetTablesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetPrimaryKeysResult struct { + Success *TGetPrimaryKeysResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetTablesResult() *TCLIServiceGetTablesResult { - return &TCLIServiceGetTablesResult{} +func NewTCLIServiceGetPrimaryKeysResult() *TCLIServiceGetPrimaryKeysResult { + return &TCLIServiceGetPrimaryKeysResult{} } -var TCLIServiceGetTablesResult_Success_DEFAULT *TGetTablesResp -func (p *TCLIServiceGetTablesResult) GetSuccess() *TGetTablesResp { +var TCLIServiceGetPrimaryKeysResult_Success_DEFAULT *TGetPrimaryKeysResp +func (p *TCLIServiceGetPrimaryKeysResult) GetSuccess() *TGetPrimaryKeysResp { if !p.IsSetSuccess() { - return TCLIServiceGetTablesResult_Success_DEFAULT + return TCLIServiceGetPrimaryKeysResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetTablesResult) IsSetSuccess() bool { +func (p *TCLIServiceGetPrimaryKeysResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetTablesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetPrimaryKeysResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15689,99 +21080,99 @@ func (p *TCLIServiceGetTablesResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTablesResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetTablesResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetPrimaryKeysResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetPrimaryKeysResp{} + 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 *TCLIServiceGetTablesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTables_result"); err != nil { +func (p *TCLIServiceGetPrimaryKeysResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPrimaryKeys_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTablesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetPrimaryKeysResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetTablesResult) String() string { +func (p *TCLIServiceGetPrimaryKeysResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTablesResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetPrimaryKeysResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetTableTypesArgs struct { - Req *TGetTableTypesReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetCrossReferenceArgs struct { + Req *TGetCrossReferenceReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetTableTypesArgs() *TCLIServiceGetTableTypesArgs { - return &TCLIServiceGetTableTypesArgs{} +func NewTCLIServiceGetCrossReferenceArgs() *TCLIServiceGetCrossReferenceArgs { + return &TCLIServiceGetCrossReferenceArgs{} } -var TCLIServiceGetTableTypesArgs_Req_DEFAULT *TGetTableTypesReq -func (p *TCLIServiceGetTableTypesArgs) GetReq() *TGetTableTypesReq { +var TCLIServiceGetCrossReferenceArgs_Req_DEFAULT *TGetCrossReferenceReq +func (p *TCLIServiceGetCrossReferenceArgs) GetReq() *TGetCrossReferenceReq { if !p.IsSetReq() { - return TCLIServiceGetTableTypesArgs_Req_DEFAULT + return TCLIServiceGetCrossReferenceArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetTableTypesArgs) IsSetReq() bool { +func (p *TCLIServiceGetCrossReferenceArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetTableTypesArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetCrossReferenceArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15789,97 +21180,97 @@ func (p *TCLIServiceGetTableTypesArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTableTypesArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetTableTypesReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetCrossReferenceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetCrossReferenceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetTableTypesArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTableTypes_args"); err != nil { +func (p *TCLIServiceGetCrossReferenceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTableTypesArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetCrossReferenceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetTableTypesArgs) String() string { +func (p *TCLIServiceGetCrossReferenceArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTableTypesArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetCrossReferenceArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetTableTypesResult struct { - Success *TGetTableTypesResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetCrossReferenceResult struct { + Success *TGetCrossReferenceResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetTableTypesResult() *TCLIServiceGetTableTypesResult { - return &TCLIServiceGetTableTypesResult{} +func NewTCLIServiceGetCrossReferenceResult() *TCLIServiceGetCrossReferenceResult { + return &TCLIServiceGetCrossReferenceResult{} } -var TCLIServiceGetTableTypesResult_Success_DEFAULT *TGetTableTypesResp -func (p *TCLIServiceGetTableTypesResult) GetSuccess() *TGetTableTypesResp { +var TCLIServiceGetCrossReferenceResult_Success_DEFAULT *TGetCrossReferenceResp +func (p *TCLIServiceGetCrossReferenceResult) GetSuccess() *TGetCrossReferenceResp { if !p.IsSetSuccess() { - return TCLIServiceGetTableTypesResult_Success_DEFAULT + return TCLIServiceGetCrossReferenceResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetTableTypesResult) IsSetSuccess() bool { +func (p *TCLIServiceGetCrossReferenceResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetTableTypesResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetCrossReferenceResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15887,99 +21278,99 @@ func (p *TCLIServiceGetTableTypesResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetTableTypesResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetTableTypesResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetCrossReferenceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetCrossReferenceResp{} + 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 *TCLIServiceGetTableTypesResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetTableTypes_result"); err != nil { +func (p *TCLIServiceGetCrossReferenceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetCrossReference_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetTableTypesResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetCrossReferenceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetTableTypesResult) String() string { +func (p *TCLIServiceGetCrossReferenceResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetTableTypesResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetCrossReferenceResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetColumnsArgs struct { - Req *TGetColumnsReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetOperationStatusArgs struct { + Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetColumnsArgs() *TCLIServiceGetColumnsArgs { - return &TCLIServiceGetColumnsArgs{} +func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs { + return &TCLIServiceGetOperationStatusArgs{} } -var TCLIServiceGetColumnsArgs_Req_DEFAULT *TGetColumnsReq -func (p *TCLIServiceGetColumnsArgs) GetReq() *TGetColumnsReq { +var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq +func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq { if !p.IsSetReq() { - return TCLIServiceGetColumnsArgs_Req_DEFAULT + return TCLIServiceGetOperationStatusArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetColumnsArgs) IsSetReq() bool { +func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetColumnsArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetOperationStatusArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -15987,97 +21378,97 @@ func (p *TCLIServiceGetColumnsArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetColumnsArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetColumnsReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetOperationStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetOperationStatusReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetColumnsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetColumns_args"); err != nil { +func (p *TCLIServiceGetOperationStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetColumnsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetOperationStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetColumnsArgs) String() string { +func (p *TCLIServiceGetOperationStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetColumnsArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetColumnsResult struct { - Success *TGetColumnsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetOperationStatusResult struct { + Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetColumnsResult() *TCLIServiceGetColumnsResult { - return &TCLIServiceGetColumnsResult{} +func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult { + return &TCLIServiceGetOperationStatusResult{} } -var TCLIServiceGetColumnsResult_Success_DEFAULT *TGetColumnsResp -func (p *TCLIServiceGetColumnsResult) GetSuccess() *TGetColumnsResp { +var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp +func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp { if !p.IsSetSuccess() { - return TCLIServiceGetColumnsResult_Success_DEFAULT + return TCLIServiceGetOperationStatusResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetColumnsResult) IsSetSuccess() bool { +func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetColumnsResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetOperationStatusResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16085,99 +21476,99 @@ func (p *TCLIServiceGetColumnsResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetColumnsResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetColumnsResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetOperationStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetOperationStatusResp{} + 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 *TCLIServiceGetColumnsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetColumns_result"); err != nil { +func (p *TCLIServiceGetOperationStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetOperationStatus_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetColumnsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetOperationStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetColumnsResult) String() string { +func (p *TCLIServiceGetOperationStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetColumnsResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetFunctionsArgs struct { - Req *TGetFunctionsReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceCancelOperationArgs struct { + Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetFunctionsArgs() *TCLIServiceGetFunctionsArgs { - return &TCLIServiceGetFunctionsArgs{} +func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs { + return &TCLIServiceCancelOperationArgs{} } -var TCLIServiceGetFunctionsArgs_Req_DEFAULT *TGetFunctionsReq -func (p *TCLIServiceGetFunctionsArgs) GetReq() *TGetFunctionsReq { +var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq +func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq { if !p.IsSetReq() { - return TCLIServiceGetFunctionsArgs_Req_DEFAULT + return TCLIServiceCancelOperationArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetFunctionsArgs) IsSetReq() bool { +func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetFunctionsArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCancelOperationArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16185,97 +21576,97 @@ func (p *TCLIServiceGetFunctionsArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetFunctionsArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetFunctionsReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceCancelOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetFunctionsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetFunctions_args"); err != nil { +func (p *TCLIServiceCancelOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CancelOperation_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetFunctionsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceCancelOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetFunctionsArgs) String() string { +func (p *TCLIServiceCancelOperationArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetFunctionsArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetFunctionsResult struct { - Success *TGetFunctionsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceCancelOperationResult struct { + Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetFunctionsResult() *TCLIServiceGetFunctionsResult { - return &TCLIServiceGetFunctionsResult{} +func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult { + return &TCLIServiceCancelOperationResult{} } -var TCLIServiceGetFunctionsResult_Success_DEFAULT *TGetFunctionsResp -func (p *TCLIServiceGetFunctionsResult) GetSuccess() *TGetFunctionsResp { +var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp +func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp { if !p.IsSetSuccess() { - return TCLIServiceGetFunctionsResult_Success_DEFAULT + return TCLIServiceCancelOperationResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetFunctionsResult) IsSetSuccess() bool { +func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetFunctionsResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCancelOperationResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16283,99 +21674,99 @@ func (p *TCLIServiceGetFunctionsResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetFunctionsResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetFunctionsResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceCancelOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelOperationResp{} + 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 *TCLIServiceGetFunctionsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetFunctions_result"); err != nil { +func (p *TCLIServiceCancelOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CancelOperation_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetFunctionsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceCancelOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetFunctionsResult) String() string { +func (p *TCLIServiceCancelOperationResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetFunctionsResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetOperationStatusArgs struct { - Req *TGetOperationStatusReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceCloseOperationArgs struct { + Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetOperationStatusArgs() *TCLIServiceGetOperationStatusArgs { - return &TCLIServiceGetOperationStatusArgs{} +func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs { + return &TCLIServiceCloseOperationArgs{} } -var TCLIServiceGetOperationStatusArgs_Req_DEFAULT *TGetOperationStatusReq -func (p *TCLIServiceGetOperationStatusArgs) GetReq() *TGetOperationStatusReq { +var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq +func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq { if !p.IsSetReq() { - return TCLIServiceGetOperationStatusArgs_Req_DEFAULT + return TCLIServiceCloseOperationArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetOperationStatusArgs) IsSetReq() bool { +func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetOperationStatusArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCloseOperationArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16383,97 +21774,97 @@ func (p *TCLIServiceGetOperationStatusArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetOperationStatusArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetOperationStatusReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceCloseOperationArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCloseOperationReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetOperationStatusArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetOperationStatus_args"); err != nil { +func (p *TCLIServiceCloseOperationArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CloseOperation_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetOperationStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceCloseOperationArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetOperationStatusArgs) String() string { +func (p *TCLIServiceCloseOperationArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetOperationStatusArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetOperationStatusResult struct { - Success *TGetOperationStatusResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceCloseOperationResult struct { + Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetOperationStatusResult() *TCLIServiceGetOperationStatusResult { - return &TCLIServiceGetOperationStatusResult{} +func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult { + return &TCLIServiceCloseOperationResult{} } -var TCLIServiceGetOperationStatusResult_Success_DEFAULT *TGetOperationStatusResp -func (p *TCLIServiceGetOperationStatusResult) GetSuccess() *TGetOperationStatusResp { +var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp +func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp { if !p.IsSetSuccess() { - return TCLIServiceGetOperationStatusResult_Success_DEFAULT + return TCLIServiceCloseOperationResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetOperationStatusResult) IsSetSuccess() bool { +func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetOperationStatusResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCloseOperationResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16481,99 +21872,99 @@ func (p *TCLIServiceGetOperationStatusResult) Read(iprot thrift.TProtocol) error switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetOperationStatusResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetOperationStatusResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceCloseOperationResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCloseOperationResp{} + 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 *TCLIServiceGetOperationStatusResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetOperationStatus_result"); err != nil { +func (p *TCLIServiceCloseOperationResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CloseOperation_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetOperationStatusResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceCloseOperationResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetOperationStatusResult) String() string { +func (p *TCLIServiceCloseOperationResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetOperationStatusResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceCancelOperationArgs struct { - Req *TCancelOperationReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetResultSetMetadataArgs struct { + Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceCancelOperationArgs() *TCLIServiceCancelOperationArgs { - return &TCLIServiceCancelOperationArgs{} +func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs { + return &TCLIServiceGetResultSetMetadataArgs{} } -var TCLIServiceCancelOperationArgs_Req_DEFAULT *TCancelOperationReq -func (p *TCLIServiceCancelOperationArgs) GetReq() *TCancelOperationReq { +var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq +func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq { if !p.IsSetReq() { - return TCLIServiceCancelOperationArgs_Req_DEFAULT + return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceCancelOperationArgs) IsSetReq() bool { +func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceCancelOperationArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetResultSetMetadataArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16581,97 +21972,97 @@ func (p *TCLIServiceCancelOperationArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCancelOperationArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TCancelOperationReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetResultSetMetadataReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceCancelOperationArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CancelOperation_args"); err != nil { +func (p *TCLIServiceGetResultSetMetadataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCancelOperationArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceCancelOperationArgs) String() string { +func (p *TCLIServiceGetResultSetMetadataArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCancelOperationArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceCancelOperationResult struct { - Success *TCancelOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetResultSetMetadataResult struct { + Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceCancelOperationResult() *TCLIServiceCancelOperationResult { - return &TCLIServiceCancelOperationResult{} +func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult { + return &TCLIServiceGetResultSetMetadataResult{} } -var TCLIServiceCancelOperationResult_Success_DEFAULT *TCancelOperationResp -func (p *TCLIServiceCancelOperationResult) GetSuccess() *TCancelOperationResp { +var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp +func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp { if !p.IsSetSuccess() { - return TCLIServiceCancelOperationResult_Success_DEFAULT + return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceCancelOperationResult) IsSetSuccess() bool { +func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceCancelOperationResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetResultSetMetadataResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16679,99 +22070,99 @@ func (p *TCLIServiceCancelOperationResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCancelOperationResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TCancelOperationResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetResultSetMetadataResp{} + 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 *TCLIServiceCancelOperationResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CancelOperation_result"); err != nil { +func (p *TCLIServiceGetResultSetMetadataResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetResultSetMetadata_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCancelOperationResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetResultSetMetadataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceCancelOperationResult) String() string { +func (p *TCLIServiceGetResultSetMetadataResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCancelOperationResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceCloseOperationArgs struct { - Req *TCloseOperationReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceFetchResultsArgs struct { + Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceCloseOperationArgs() *TCLIServiceCloseOperationArgs { - return &TCLIServiceCloseOperationArgs{} +func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs { + return &TCLIServiceFetchResultsArgs{} } -var TCLIServiceCloseOperationArgs_Req_DEFAULT *TCloseOperationReq -func (p *TCLIServiceCloseOperationArgs) GetReq() *TCloseOperationReq { +var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq +func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq { if !p.IsSetReq() { - return TCLIServiceCloseOperationArgs_Req_DEFAULT + return TCLIServiceFetchResultsArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceCloseOperationArgs) IsSetReq() bool { +func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceCloseOperationArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceFetchResultsArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16779,97 +22170,99 @@ func (p *TCLIServiceCloseOperationArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCloseOperationArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TCloseOperationReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceFetchResultsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TFetchResultsReq{ + Orientation: 0, +} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceCloseOperationArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CloseOperation_args"); err != nil { +func (p *TCLIServiceFetchResultsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "FetchResults_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCloseOperationArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceFetchResultsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceCloseOperationArgs) String() string { +func (p *TCLIServiceFetchResultsArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCloseOperationArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceCloseOperationResult struct { - Success *TCloseOperationResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceFetchResultsResult struct { + Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceCloseOperationResult() *TCLIServiceCloseOperationResult { - return &TCLIServiceCloseOperationResult{} +func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult { + return &TCLIServiceFetchResultsResult{} } -var TCLIServiceCloseOperationResult_Success_DEFAULT *TCloseOperationResp -func (p *TCLIServiceCloseOperationResult) GetSuccess() *TCloseOperationResp { +var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp +func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp { if !p.IsSetSuccess() { - return TCLIServiceCloseOperationResult_Success_DEFAULT + return TCLIServiceFetchResultsResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceCloseOperationResult) IsSetSuccess() bool { +func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceCloseOperationResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceFetchResultsResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16877,99 +22270,99 @@ func (p *TCLIServiceCloseOperationResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCloseOperationResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TCloseOperationResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceFetchResultsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TFetchResultsResp{} + 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 *TCLIServiceCloseOperationResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CloseOperation_result"); err != nil { +func (p *TCLIServiceFetchResultsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "FetchResults_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCloseOperationResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceFetchResultsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceCloseOperationResult) String() string { +func (p *TCLIServiceFetchResultsResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCloseOperationResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetResultSetMetadataArgs struct { - Req *TGetResultSetMetadataReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetDelegationTokenArgs struct { + Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetResultSetMetadataArgs() *TCLIServiceGetResultSetMetadataArgs { - return &TCLIServiceGetResultSetMetadataArgs{} +func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs { + return &TCLIServiceGetDelegationTokenArgs{} } -var TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT *TGetResultSetMetadataReq -func (p *TCLIServiceGetResultSetMetadataArgs) GetReq() *TGetResultSetMetadataReq { +var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq +func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq { if !p.IsSetReq() { - return TCLIServiceGetResultSetMetadataArgs_Req_DEFAULT + return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetResultSetMetadataArgs) IsSetReq() bool { +func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetResultSetMetadataArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetDelegationTokenArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -16977,97 +22370,97 @@ func (p *TCLIServiceGetResultSetMetadataArgs) Read(iprot thrift.TProtocol) error switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetResultSetMetadataArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetResultSetMetadataReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetResultSetMetadataArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetResultSetMetadata_args"); err != nil { +func (p *TCLIServiceGetDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetResultSetMetadataArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetResultSetMetadataArgs) String() string { +func (p *TCLIServiceGetDelegationTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetResultSetMetadataResult struct { - Success *TGetResultSetMetadataResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetDelegationTokenResult struct { + Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetResultSetMetadataResult() *TCLIServiceGetResultSetMetadataResult { - return &TCLIServiceGetResultSetMetadataResult{} +func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult { + return &TCLIServiceGetDelegationTokenResult{} } -var TCLIServiceGetResultSetMetadataResult_Success_DEFAULT *TGetResultSetMetadataResp -func (p *TCLIServiceGetResultSetMetadataResult) GetSuccess() *TGetResultSetMetadataResp { +var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp +func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp { if !p.IsSetSuccess() { - return TCLIServiceGetResultSetMetadataResult_Success_DEFAULT + return TCLIServiceGetDelegationTokenResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetResultSetMetadataResult) IsSetSuccess() bool { +func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetResultSetMetadataResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetDelegationTokenResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17075,99 +22468,99 @@ func (p *TCLIServiceGetResultSetMetadataResult) Read(iprot thrift.TProtocol) err switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetResultSetMetadataResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetResultSetMetadataResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetDelegationTokenResp{} + 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 *TCLIServiceGetResultSetMetadataResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetResultSetMetadata_result"); err != nil { +func (p *TCLIServiceGetDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetDelegationToken_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetResultSetMetadataResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetResultSetMetadataResult) String() string { +func (p *TCLIServiceGetDelegationTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetResultSetMetadataResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceFetchResultsArgs struct { - Req *TFetchResultsReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceCancelDelegationTokenArgs struct { + Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceFetchResultsArgs() *TCLIServiceFetchResultsArgs { - return &TCLIServiceFetchResultsArgs{} +func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs { + return &TCLIServiceCancelDelegationTokenArgs{} } -var TCLIServiceFetchResultsArgs_Req_DEFAULT *TFetchResultsReq -func (p *TCLIServiceFetchResultsArgs) GetReq() *TFetchResultsReq { +var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq +func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq { if !p.IsSetReq() { - return TCLIServiceFetchResultsArgs_Req_DEFAULT + return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceFetchResultsArgs) IsSetReq() bool { +func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceFetchResultsArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCancelDelegationTokenArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17175,99 +22568,97 @@ func (p *TCLIServiceFetchResultsArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceFetchResultsArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TFetchResultsReq{ - Orientation: 0, -} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TCancelDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceFetchResultsArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("FetchResults_args"); err != nil { +func (p *TCLIServiceCancelDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceFetchResultsArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceFetchResultsArgs) String() string { +func (p *TCLIServiceCancelDelegationTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceFetchResultsArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceFetchResultsResult struct { - Success *TFetchResultsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceCancelDelegationTokenResult struct { + Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceFetchResultsResult() *TCLIServiceFetchResultsResult { - return &TCLIServiceFetchResultsResult{} +func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult { + return &TCLIServiceCancelDelegationTokenResult{} } -var TCLIServiceFetchResultsResult_Success_DEFAULT *TFetchResultsResp -func (p *TCLIServiceFetchResultsResult) GetSuccess() *TFetchResultsResp { +var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp +func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp { if !p.IsSetSuccess() { - return TCLIServiceFetchResultsResult_Success_DEFAULT + return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceFetchResultsResult) IsSetSuccess() bool { +func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceFetchResultsResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceCancelDelegationTokenResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17275,99 +22666,99 @@ func (p *TCLIServiceFetchResultsResult) Read(iprot thrift.TProtocol) error { switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceFetchResultsResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TFetchResultsResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TCancelDelegationTokenResp{} + 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 *TCLIServiceFetchResultsResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("FetchResults_result"); err != nil { +func (p *TCLIServiceCancelDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CancelDelegationToken_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceFetchResultsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceCancelDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceFetchResultsResult) String() string { +func (p *TCLIServiceCancelDelegationTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceFetchResultsResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceGetDelegationTokenArgs struct { - Req *TGetDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceRenewDelegationTokenArgs struct { + Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceGetDelegationTokenArgs() *TCLIServiceGetDelegationTokenArgs { - return &TCLIServiceGetDelegationTokenArgs{} +func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs { + return &TCLIServiceRenewDelegationTokenArgs{} } -var TCLIServiceGetDelegationTokenArgs_Req_DEFAULT *TGetDelegationTokenReq -func (p *TCLIServiceGetDelegationTokenArgs) GetReq() *TGetDelegationTokenReq { +var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq +func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq { if !p.IsSetReq() { - return TCLIServiceGetDelegationTokenArgs_Req_DEFAULT + return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceGetDelegationTokenArgs) IsSetReq() bool { +func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceGetDelegationTokenArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceRenewDelegationTokenArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17375,97 +22766,97 @@ func (p *TCLIServiceGetDelegationTokenArgs) Read(iprot thrift.TProtocol) error { switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetDelegationTokenArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TGetDelegationTokenReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TRenewDelegationTokenReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceGetDelegationTokenArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetDelegationToken_args"); err != nil { +func (p *TCLIServiceRenewDelegationTokenArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceGetDelegationTokenArgs) String() string { +func (p *TCLIServiceRenewDelegationTokenArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetDelegationTokenArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceGetDelegationTokenResult struct { - Success *TGetDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceRenewDelegationTokenResult struct { + Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceGetDelegationTokenResult() *TCLIServiceGetDelegationTokenResult { - return &TCLIServiceGetDelegationTokenResult{} +func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult { + return &TCLIServiceRenewDelegationTokenResult{} } -var TCLIServiceGetDelegationTokenResult_Success_DEFAULT *TGetDelegationTokenResp -func (p *TCLIServiceGetDelegationTokenResult) GetSuccess() *TGetDelegationTokenResp { +var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp +func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp { if !p.IsSetSuccess() { - return TCLIServiceGetDelegationTokenResult_Success_DEFAULT + return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceGetDelegationTokenResult) IsSetSuccess() bool { +func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceGetDelegationTokenResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceRenewDelegationTokenResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17473,99 +22864,99 @@ func (p *TCLIServiceGetDelegationTokenResult) Read(iprot thrift.TProtocol) error switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceGetDelegationTokenResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TGetDelegationTokenResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TRenewDelegationTokenResp{} + 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 *TCLIServiceGetDelegationTokenResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("GetDelegationToken_result"); err != nil { +func (p *TCLIServiceRenewDelegationTokenResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RenewDelegationToken_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceGetDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceRenewDelegationTokenResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceGetDelegationTokenResult) String() string { +func (p *TCLIServiceRenewDelegationTokenResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceGetDelegationTokenResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceCancelDelegationTokenArgs struct { - Req *TCancelDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceGetQueryIdArgs struct { + Req *TGetQueryIdReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceCancelDelegationTokenArgs() *TCLIServiceCancelDelegationTokenArgs { - return &TCLIServiceCancelDelegationTokenArgs{} +func NewTCLIServiceGetQueryIdArgs() *TCLIServiceGetQueryIdArgs { + return &TCLIServiceGetQueryIdArgs{} } -var TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT *TCancelDelegationTokenReq -func (p *TCLIServiceCancelDelegationTokenArgs) GetReq() *TCancelDelegationTokenReq { +var TCLIServiceGetQueryIdArgs_Req_DEFAULT *TGetQueryIdReq +func (p *TCLIServiceGetQueryIdArgs) GetReq() *TGetQueryIdReq { if !p.IsSetReq() { - return TCLIServiceCancelDelegationTokenArgs_Req_DEFAULT + return TCLIServiceGetQueryIdArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceCancelDelegationTokenArgs) IsSetReq() bool { +func (p *TCLIServiceGetQueryIdArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceCancelDelegationTokenArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetQueryIdArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17573,97 +22964,97 @@ func (p *TCLIServiceCancelDelegationTokenArgs) Read(iprot thrift.TProtocol) erro switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCancelDelegationTokenArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TCancelDelegationTokenReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceGetQueryIdArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TGetQueryIdReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceCancelDelegationTokenArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CancelDelegationToken_args"); err != nil { +func (p *TCLIServiceGetQueryIdArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetQueryId_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCancelDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceGetQueryIdArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceCancelDelegationTokenArgs) String() string { +func (p *TCLIServiceGetQueryIdArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetQueryIdArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceCancelDelegationTokenResult struct { - Success *TCancelDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceGetQueryIdResult struct { + Success *TGetQueryIdResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceCancelDelegationTokenResult() *TCLIServiceCancelDelegationTokenResult { - return &TCLIServiceCancelDelegationTokenResult{} +func NewTCLIServiceGetQueryIdResult() *TCLIServiceGetQueryIdResult { + return &TCLIServiceGetQueryIdResult{} } -var TCLIServiceCancelDelegationTokenResult_Success_DEFAULT *TCancelDelegationTokenResp -func (p *TCLIServiceCancelDelegationTokenResult) GetSuccess() *TCancelDelegationTokenResp { +var TCLIServiceGetQueryIdResult_Success_DEFAULT *TGetQueryIdResp +func (p *TCLIServiceGetQueryIdResult) GetSuccess() *TGetQueryIdResp { if !p.IsSetSuccess() { - return TCLIServiceCancelDelegationTokenResult_Success_DEFAULT + return TCLIServiceGetQueryIdResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceCancelDelegationTokenResult) IsSetSuccess() bool { +func (p *TCLIServiceGetQueryIdResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceCancelDelegationTokenResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceGetQueryIdResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17671,99 +23062,99 @@ func (p *TCLIServiceCancelDelegationTokenResult) Read(iprot thrift.TProtocol) er switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceCancelDelegationTokenResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TCancelDelegationTokenResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceGetQueryIdResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TGetQueryIdResp{} + 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 *TCLIServiceCancelDelegationTokenResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("CancelDelegationToken_result"); err != nil { +func (p *TCLIServiceGetQueryIdResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetQueryId_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceCancelDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceGetQueryIdResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceCancelDelegationTokenResult) String() string { +func (p *TCLIServiceGetQueryIdResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceCancelDelegationTokenResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceGetQueryIdResult(%+v)", *p) } // Attributes: // - Req -type TCLIServiceRenewDelegationTokenArgs struct { - Req *TRenewDelegationTokenReq `thrift:"req,1" db:"req" json:"req"` +type TCLIServiceSetClientInfoArgs struct { + Req *TSetClientInfoReq `thrift:"req,1" db:"req" json:"req"` } -func NewTCLIServiceRenewDelegationTokenArgs() *TCLIServiceRenewDelegationTokenArgs { - return &TCLIServiceRenewDelegationTokenArgs{} +func NewTCLIServiceSetClientInfoArgs() *TCLIServiceSetClientInfoArgs { + return &TCLIServiceSetClientInfoArgs{} } -var TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT *TRenewDelegationTokenReq -func (p *TCLIServiceRenewDelegationTokenArgs) GetReq() *TRenewDelegationTokenReq { +var TCLIServiceSetClientInfoArgs_Req_DEFAULT *TSetClientInfoReq +func (p *TCLIServiceSetClientInfoArgs) GetReq() *TSetClientInfoReq { if !p.IsSetReq() { - return TCLIServiceRenewDelegationTokenArgs_Req_DEFAULT + return TCLIServiceSetClientInfoArgs_Req_DEFAULT } return p.Req } -func (p *TCLIServiceRenewDelegationTokenArgs) IsSetReq() bool { +func (p *TCLIServiceSetClientInfoArgs) IsSetReq() bool { return p.Req != nil } -func (p *TCLIServiceRenewDelegationTokenArgs) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceSetClientInfoArgs) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17771,97 +23162,97 @@ func (p *TCLIServiceRenewDelegationTokenArgs) Read(iprot thrift.TProtocol) error switch fieldId { case 1: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField1(iprot); err != nil { + if err := p.ReadField1(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceRenewDelegationTokenArgs) ReadField1(iprot thrift.TProtocol) error { - p.Req = &TRenewDelegationTokenReq{} - if err := p.Req.Read(iprot); err != nil { +func (p *TCLIServiceSetClientInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TSetClientInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) } return nil } -func (p *TCLIServiceRenewDelegationTokenArgs) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("RenewDelegationToken_args"); err != nil { +func (p *TCLIServiceSetClientInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SetClientInfo_args"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField1(oprot); err != nil { return err } + if err := p.writeField1(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceRenewDelegationTokenArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { +func (p *TCLIServiceSetClientInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { + if err := p.Req.Write(ctx, oprot); err != nil { return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) } - if err := oprot.WriteFieldEnd(); err != nil { + if err := oprot.WriteFieldEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } return err } -func (p *TCLIServiceRenewDelegationTokenArgs) String() string { +func (p *TCLIServiceSetClientInfoArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenArgs(%+v)", *p) + return fmt.Sprintf("TCLIServiceSetClientInfoArgs(%+v)", *p) } // Attributes: // - Success -type TCLIServiceRenewDelegationTokenResult struct { - Success *TRenewDelegationTokenResp `thrift:"success,0" db:"success" json:"success,omitempty"` +type TCLIServiceSetClientInfoResult struct { + Success *TSetClientInfoResp `thrift:"success,0" db:"success" json:"success,omitempty"` } -func NewTCLIServiceRenewDelegationTokenResult() *TCLIServiceRenewDelegationTokenResult { - return &TCLIServiceRenewDelegationTokenResult{} +func NewTCLIServiceSetClientInfoResult() *TCLIServiceSetClientInfoResult { + return &TCLIServiceSetClientInfoResult{} } -var TCLIServiceRenewDelegationTokenResult_Success_DEFAULT *TRenewDelegationTokenResp -func (p *TCLIServiceRenewDelegationTokenResult) GetSuccess() *TRenewDelegationTokenResp { +var TCLIServiceSetClientInfoResult_Success_DEFAULT *TSetClientInfoResp +func (p *TCLIServiceSetClientInfoResult) GetSuccess() *TSetClientInfoResp { if !p.IsSetSuccess() { - return TCLIServiceRenewDelegationTokenResult_Success_DEFAULT + return TCLIServiceSetClientInfoResult_Success_DEFAULT } return p.Success } -func (p *TCLIServiceRenewDelegationTokenResult) IsSetSuccess() bool { +func (p *TCLIServiceSetClientInfoResult) IsSetSuccess() bool { return p.Success != nil } -func (p *TCLIServiceRenewDelegationTokenResult) Read(iprot thrift.TProtocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { +func (p *TCLIServiceSetClientInfoResult) 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() + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) if err != nil { return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) } @@ -17869,68 +23260,68 @@ func (p *TCLIServiceRenewDelegationTokenResult) Read(iprot thrift.TProtocol) err switch fieldId { case 0: if fieldTypeId == thrift.STRUCT { - if err := p.ReadField0(iprot); err != nil { + if err := p.ReadField0(ctx, iprot); err != nil { return err } } else { - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } default: - if err := iprot.Skip(fieldTypeId); err != nil { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { return err } } - if err := iprot.ReadFieldEnd(); err != nil { + if err := iprot.ReadFieldEnd(ctx); err != nil { return err } } - if err := iprot.ReadStructEnd(); err != nil { + if err := iprot.ReadStructEnd(ctx); err != nil { return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } return nil } -func (p *TCLIServiceRenewDelegationTokenResult) ReadField0(iprot thrift.TProtocol) error { - p.Success = &TRenewDelegationTokenResp{} - if err := p.Success.Read(iprot); err != nil { +func (p *TCLIServiceSetClientInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &TSetClientInfoResp{} + 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 *TCLIServiceRenewDelegationTokenResult) Write(oprot thrift.TProtocol) error { - if err := oprot.WriteStructBegin("RenewDelegationToken_result"); err != nil { +func (p *TCLIServiceSetClientInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SetClientInfo_result"); err != nil { return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } if p != nil { - if err := p.writeField0(oprot); err != nil { return err } + if err := p.writeField0(ctx, oprot); err != nil { return err } } - if err := oprot.WriteFieldStop(); err != nil { + if err := oprot.WriteFieldStop(ctx); err != nil { return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { + if err := oprot.WriteStructEnd(ctx); err != nil { return thrift.PrependError("write struct stop error: ", err) } return nil } -func (p *TCLIServiceRenewDelegationTokenResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *TCLIServiceSetClientInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + 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(oprot); err != nil { + 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(); err != nil { + 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 *TCLIServiceRenewDelegationTokenResult) String() string { +func (p *TCLIServiceSetClientInfoResult) String() string { if p == nil { return "" } - return fmt.Sprintf("TCLIServiceRenewDelegationTokenResult(%+v)", *p) + return fmt.Sprintf("TCLIServiceSetClientInfoResult(%+v)", *p) } diff --git a/hiveserver2/gen-go/tcliservice/t_c_l_i_service-remote/t_c_l_i_service-remote.go b/hiveserver2/gen-go/tcliservice/t_c_l_i_service-remote/t_c_l_i_service-remote.go new file mode 100755 index 0000000..68aafaf --- /dev/null +++ b/hiveserver2/gen-go/tcliservice/t_c_l_i_service-remote/t_c_l_i_service-remote.go @@ -0,0 +1,750 @@ +// Code generated by Thrift Compiler (0.14.1). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + "github.com/apache/thrift/lib/go/thrift" + "tcliservice" +) + +var _ = tcliservice.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " TOpenSessionResp OpenSession(TOpenSessionReq req)") + fmt.Fprintln(os.Stderr, " TCloseSessionResp CloseSession(TCloseSessionReq req)") + fmt.Fprintln(os.Stderr, " TGetInfoResp GetInfo(TGetInfoReq req)") + fmt.Fprintln(os.Stderr, " TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req)") + fmt.Fprintln(os.Stderr, " TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req)") + fmt.Fprintln(os.Stderr, " TGetCatalogsResp GetCatalogs(TGetCatalogsReq req)") + fmt.Fprintln(os.Stderr, " TGetSchemasResp GetSchemas(TGetSchemasReq req)") + fmt.Fprintln(os.Stderr, " TGetTablesResp GetTables(TGetTablesReq req)") + fmt.Fprintln(os.Stderr, " TGetTableTypesResp GetTableTypes(TGetTableTypesReq req)") + fmt.Fprintln(os.Stderr, " TGetColumnsResp GetColumns(TGetColumnsReq req)") + fmt.Fprintln(os.Stderr, " TGetFunctionsResp GetFunctions(TGetFunctionsReq req)") + fmt.Fprintln(os.Stderr, " TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req)") + fmt.Fprintln(os.Stderr, " TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req)") + fmt.Fprintln(os.Stderr, " TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req)") + fmt.Fprintln(os.Stderr, " TCancelOperationResp CancelOperation(TCancelOperationReq req)") + fmt.Fprintln(os.Stderr, " TCloseOperationResp CloseOperation(TCloseOperationReq req)") + fmt.Fprintln(os.Stderr, " TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req)") + fmt.Fprintln(os.Stderr, " TFetchResultsResp FetchResults(TFetchResultsReq req)") + fmt.Fprintln(os.Stderr, " TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req)") + fmt.Fprintln(os.Stderr, " TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req)") + fmt.Fprintln(os.Stderr, " TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req)") + fmt.Fprintln(os.Stderr, " TGetQueryIdResp GetQueryId(TGetQueryIdReq req)") + fmt.Fprintln(os.Stderr, " TSetClientInfoResp SetClientInfo(TSetClientInfoReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr)) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransport(trans) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactory() + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactory() + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryDefault() + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := tcliservice.NewTCLIServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "OpenSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "OpenSession requires 1 args") + flag.Usage() + } + arg128 := flag.Arg(1) + mbTrans129 := thrift.NewTMemoryBufferLen(len(arg128)) + defer mbTrans129.Close() + _, err130 := mbTrans129.WriteString(arg128) + if err130 != nil { + Usage() + return + } + factory131 := thrift.NewTJSONProtocolFactory() + jsProt132 := factory131.GetProtocol(mbTrans129) + argvalue0 := tcliservice.NewTOpenSessionReq() + err133 := argvalue0.Read(context.Background(), jsProt132) + if err133 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.OpenSession(context.Background(), value0)) + fmt.Print("\n") + break + case "CloseSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CloseSession requires 1 args") + flag.Usage() + } + arg134 := flag.Arg(1) + mbTrans135 := thrift.NewTMemoryBufferLen(len(arg134)) + defer mbTrans135.Close() + _, err136 := mbTrans135.WriteString(arg134) + if err136 != nil { + Usage() + return + } + factory137 := thrift.NewTJSONProtocolFactory() + jsProt138 := factory137.GetProtocol(mbTrans135) + argvalue0 := tcliservice.NewTCloseSessionReq() + err139 := argvalue0.Read(context.Background(), jsProt138) + if err139 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CloseSession(context.Background(), value0)) + fmt.Print("\n") + break + case "GetInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetInfo requires 1 args") + flag.Usage() + } + arg140 := flag.Arg(1) + mbTrans141 := thrift.NewTMemoryBufferLen(len(arg140)) + defer mbTrans141.Close() + _, err142 := mbTrans141.WriteString(arg140) + if err142 != nil { + Usage() + return + } + factory143 := thrift.NewTJSONProtocolFactory() + jsProt144 := factory143.GetProtocol(mbTrans141) + argvalue0 := tcliservice.NewTGetInfoReq() + err145 := argvalue0.Read(context.Background(), jsProt144) + if err145 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetInfo(context.Background(), value0)) + fmt.Print("\n") + break + case "ExecuteStatement": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ExecuteStatement requires 1 args") + flag.Usage() + } + arg146 := flag.Arg(1) + mbTrans147 := thrift.NewTMemoryBufferLen(len(arg146)) + defer mbTrans147.Close() + _, err148 := mbTrans147.WriteString(arg146) + if err148 != nil { + Usage() + return + } + factory149 := thrift.NewTJSONProtocolFactory() + jsProt150 := factory149.GetProtocol(mbTrans147) + argvalue0 := tcliservice.NewTExecuteStatementReq() + err151 := argvalue0.Read(context.Background(), jsProt150) + if err151 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ExecuteStatement(context.Background(), value0)) + fmt.Print("\n") + break + case "GetTypeInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTypeInfo requires 1 args") + flag.Usage() + } + arg152 := flag.Arg(1) + mbTrans153 := thrift.NewTMemoryBufferLen(len(arg152)) + defer mbTrans153.Close() + _, err154 := mbTrans153.WriteString(arg152) + if err154 != nil { + Usage() + return + } + factory155 := thrift.NewTJSONProtocolFactory() + jsProt156 := factory155.GetProtocol(mbTrans153) + argvalue0 := tcliservice.NewTGetTypeInfoReq() + err157 := argvalue0.Read(context.Background(), jsProt156) + if err157 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTypeInfo(context.Background(), value0)) + fmt.Print("\n") + break + case "GetCatalogs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetCatalogs requires 1 args") + flag.Usage() + } + arg158 := flag.Arg(1) + mbTrans159 := thrift.NewTMemoryBufferLen(len(arg158)) + defer mbTrans159.Close() + _, err160 := mbTrans159.WriteString(arg158) + if err160 != nil { + Usage() + return + } + factory161 := thrift.NewTJSONProtocolFactory() + jsProt162 := factory161.GetProtocol(mbTrans159) + argvalue0 := tcliservice.NewTGetCatalogsReq() + err163 := argvalue0.Read(context.Background(), jsProt162) + if err163 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetCatalogs(context.Background(), value0)) + fmt.Print("\n") + break + case "GetSchemas": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSchemas requires 1 args") + flag.Usage() + } + arg164 := flag.Arg(1) + mbTrans165 := thrift.NewTMemoryBufferLen(len(arg164)) + defer mbTrans165.Close() + _, err166 := mbTrans165.WriteString(arg164) + if err166 != nil { + Usage() + return + } + factory167 := thrift.NewTJSONProtocolFactory() + jsProt168 := factory167.GetProtocol(mbTrans165) + argvalue0 := tcliservice.NewTGetSchemasReq() + err169 := argvalue0.Read(context.Background(), jsProt168) + if err169 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSchemas(context.Background(), value0)) + fmt.Print("\n") + break + case "GetTables": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTables requires 1 args") + flag.Usage() + } + arg170 := flag.Arg(1) + mbTrans171 := thrift.NewTMemoryBufferLen(len(arg170)) + defer mbTrans171.Close() + _, err172 := mbTrans171.WriteString(arg170) + if err172 != nil { + Usage() + return + } + factory173 := thrift.NewTJSONProtocolFactory() + jsProt174 := factory173.GetProtocol(mbTrans171) + argvalue0 := tcliservice.NewTGetTablesReq() + err175 := argvalue0.Read(context.Background(), jsProt174) + if err175 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTables(context.Background(), value0)) + fmt.Print("\n") + break + case "GetTableTypes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTableTypes requires 1 args") + flag.Usage() + } + arg176 := flag.Arg(1) + mbTrans177 := thrift.NewTMemoryBufferLen(len(arg176)) + defer mbTrans177.Close() + _, err178 := mbTrans177.WriteString(arg176) + if err178 != nil { + Usage() + return + } + factory179 := thrift.NewTJSONProtocolFactory() + jsProt180 := factory179.GetProtocol(mbTrans177) + argvalue0 := tcliservice.NewTGetTableTypesReq() + err181 := argvalue0.Read(context.Background(), jsProt180) + if err181 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTableTypes(context.Background(), value0)) + fmt.Print("\n") + break + case "GetColumns": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetColumns requires 1 args") + flag.Usage() + } + arg182 := flag.Arg(1) + mbTrans183 := thrift.NewTMemoryBufferLen(len(arg182)) + defer mbTrans183.Close() + _, err184 := mbTrans183.WriteString(arg182) + if err184 != nil { + Usage() + return + } + factory185 := thrift.NewTJSONProtocolFactory() + jsProt186 := factory185.GetProtocol(mbTrans183) + argvalue0 := tcliservice.NewTGetColumnsReq() + err187 := argvalue0.Read(context.Background(), jsProt186) + if err187 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetColumns(context.Background(), value0)) + fmt.Print("\n") + break + case "GetFunctions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetFunctions requires 1 args") + flag.Usage() + } + arg188 := flag.Arg(1) + mbTrans189 := thrift.NewTMemoryBufferLen(len(arg188)) + defer mbTrans189.Close() + _, err190 := mbTrans189.WriteString(arg188) + if err190 != nil { + Usage() + return + } + factory191 := thrift.NewTJSONProtocolFactory() + jsProt192 := factory191.GetProtocol(mbTrans189) + argvalue0 := tcliservice.NewTGetFunctionsReq() + err193 := argvalue0.Read(context.Background(), jsProt192) + if err193 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetFunctions(context.Background(), value0)) + fmt.Print("\n") + break + case "GetPrimaryKeys": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPrimaryKeys requires 1 args") + flag.Usage() + } + arg194 := flag.Arg(1) + mbTrans195 := thrift.NewTMemoryBufferLen(len(arg194)) + defer mbTrans195.Close() + _, err196 := mbTrans195.WriteString(arg194) + if err196 != nil { + Usage() + return + } + factory197 := thrift.NewTJSONProtocolFactory() + jsProt198 := factory197.GetProtocol(mbTrans195) + argvalue0 := tcliservice.NewTGetPrimaryKeysReq() + err199 := argvalue0.Read(context.Background(), jsProt198) + if err199 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPrimaryKeys(context.Background(), value0)) + fmt.Print("\n") + break + case "GetCrossReference": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetCrossReference requires 1 args") + flag.Usage() + } + arg200 := flag.Arg(1) + mbTrans201 := thrift.NewTMemoryBufferLen(len(arg200)) + defer mbTrans201.Close() + _, err202 := mbTrans201.WriteString(arg200) + if err202 != nil { + Usage() + return + } + factory203 := thrift.NewTJSONProtocolFactory() + jsProt204 := factory203.GetProtocol(mbTrans201) + argvalue0 := tcliservice.NewTGetCrossReferenceReq() + err205 := argvalue0.Read(context.Background(), jsProt204) + if err205 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetCrossReference(context.Background(), value0)) + fmt.Print("\n") + break + case "GetOperationStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetOperationStatus requires 1 args") + flag.Usage() + } + arg206 := flag.Arg(1) + mbTrans207 := thrift.NewTMemoryBufferLen(len(arg206)) + defer mbTrans207.Close() + _, err208 := mbTrans207.WriteString(arg206) + if err208 != nil { + Usage() + return + } + factory209 := thrift.NewTJSONProtocolFactory() + jsProt210 := factory209.GetProtocol(mbTrans207) + argvalue0 := tcliservice.NewTGetOperationStatusReq() + err211 := argvalue0.Read(context.Background(), jsProt210) + if err211 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetOperationStatus(context.Background(), value0)) + fmt.Print("\n") + break + case "CancelOperation": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CancelOperation requires 1 args") + flag.Usage() + } + arg212 := flag.Arg(1) + mbTrans213 := thrift.NewTMemoryBufferLen(len(arg212)) + defer mbTrans213.Close() + _, err214 := mbTrans213.WriteString(arg212) + if err214 != nil { + Usage() + return + } + factory215 := thrift.NewTJSONProtocolFactory() + jsProt216 := factory215.GetProtocol(mbTrans213) + argvalue0 := tcliservice.NewTCancelOperationReq() + err217 := argvalue0.Read(context.Background(), jsProt216) + if err217 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CancelOperation(context.Background(), value0)) + fmt.Print("\n") + break + case "CloseOperation": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CloseOperation requires 1 args") + flag.Usage() + } + arg218 := flag.Arg(1) + mbTrans219 := thrift.NewTMemoryBufferLen(len(arg218)) + defer mbTrans219.Close() + _, err220 := mbTrans219.WriteString(arg218) + if err220 != nil { + Usage() + return + } + factory221 := thrift.NewTJSONProtocolFactory() + jsProt222 := factory221.GetProtocol(mbTrans219) + argvalue0 := tcliservice.NewTCloseOperationReq() + err223 := argvalue0.Read(context.Background(), jsProt222) + if err223 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CloseOperation(context.Background(), value0)) + fmt.Print("\n") + break + case "GetResultSetMetadata": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetResultSetMetadata requires 1 args") + flag.Usage() + } + arg224 := flag.Arg(1) + mbTrans225 := thrift.NewTMemoryBufferLen(len(arg224)) + defer mbTrans225.Close() + _, err226 := mbTrans225.WriteString(arg224) + if err226 != nil { + Usage() + return + } + factory227 := thrift.NewTJSONProtocolFactory() + jsProt228 := factory227.GetProtocol(mbTrans225) + argvalue0 := tcliservice.NewTGetResultSetMetadataReq() + err229 := argvalue0.Read(context.Background(), jsProt228) + if err229 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetResultSetMetadata(context.Background(), value0)) + fmt.Print("\n") + break + case "FetchResults": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "FetchResults requires 1 args") + flag.Usage() + } + arg230 := flag.Arg(1) + mbTrans231 := thrift.NewTMemoryBufferLen(len(arg230)) + defer mbTrans231.Close() + _, err232 := mbTrans231.WriteString(arg230) + if err232 != nil { + Usage() + return + } + factory233 := thrift.NewTJSONProtocolFactory() + jsProt234 := factory233.GetProtocol(mbTrans231) + argvalue0 := tcliservice.NewTFetchResultsReq() + err235 := argvalue0.Read(context.Background(), jsProt234) + if err235 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.FetchResults(context.Background(), value0)) + fmt.Print("\n") + break + case "GetDelegationToken": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetDelegationToken requires 1 args") + flag.Usage() + } + arg236 := flag.Arg(1) + mbTrans237 := thrift.NewTMemoryBufferLen(len(arg236)) + defer mbTrans237.Close() + _, err238 := mbTrans237.WriteString(arg236) + if err238 != nil { + Usage() + return + } + factory239 := thrift.NewTJSONProtocolFactory() + jsProt240 := factory239.GetProtocol(mbTrans237) + argvalue0 := tcliservice.NewTGetDelegationTokenReq() + err241 := argvalue0.Read(context.Background(), jsProt240) + if err241 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetDelegationToken(context.Background(), value0)) + fmt.Print("\n") + break + case "CancelDelegationToken": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CancelDelegationToken requires 1 args") + flag.Usage() + } + arg242 := flag.Arg(1) + mbTrans243 := thrift.NewTMemoryBufferLen(len(arg242)) + defer mbTrans243.Close() + _, err244 := mbTrans243.WriteString(arg242) + if err244 != nil { + Usage() + return + } + factory245 := thrift.NewTJSONProtocolFactory() + jsProt246 := factory245.GetProtocol(mbTrans243) + argvalue0 := tcliservice.NewTCancelDelegationTokenReq() + err247 := argvalue0.Read(context.Background(), jsProt246) + if err247 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CancelDelegationToken(context.Background(), value0)) + fmt.Print("\n") + break + case "RenewDelegationToken": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RenewDelegationToken requires 1 args") + flag.Usage() + } + arg248 := flag.Arg(1) + mbTrans249 := thrift.NewTMemoryBufferLen(len(arg248)) + defer mbTrans249.Close() + _, err250 := mbTrans249.WriteString(arg248) + if err250 != nil { + Usage() + return + } + factory251 := thrift.NewTJSONProtocolFactory() + jsProt252 := factory251.GetProtocol(mbTrans249) + argvalue0 := tcliservice.NewTRenewDelegationTokenReq() + err253 := argvalue0.Read(context.Background(), jsProt252) + if err253 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RenewDelegationToken(context.Background(), value0)) + fmt.Print("\n") + break + case "GetQueryId": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetQueryId requires 1 args") + flag.Usage() + } + arg254 := flag.Arg(1) + mbTrans255 := thrift.NewTMemoryBufferLen(len(arg254)) + defer mbTrans255.Close() + _, err256 := mbTrans255.WriteString(arg254) + if err256 != nil { + Usage() + return + } + factory257 := thrift.NewTJSONProtocolFactory() + jsProt258 := factory257.GetProtocol(mbTrans255) + argvalue0 := tcliservice.NewTGetQueryIdReq() + err259 := argvalue0.Read(context.Background(), jsProt258) + if err259 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetQueryId(context.Background(), value0)) + fmt.Print("\n") + break + case "SetClientInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetClientInfo requires 1 args") + flag.Usage() + } + arg260 := flag.Arg(1) + mbTrans261 := thrift.NewTMemoryBufferLen(len(arg260)) + defer mbTrans261.Close() + _, err262 := mbTrans261.WriteString(arg260) + if err262 != nil { + Usage() + return + } + factory263 := thrift.NewTJSONProtocolFactory() + jsProt264 := factory263.GetProtocol(mbTrans261) + argvalue0 := tcliservice.NewTSetClientInfoReq() + err265 := argvalue0.Read(context.Background(), jsProt264) + if err265 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetClientInfo(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +}