| /** |
| * Autogenerated by Thrift Compiler (0.14.1) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| using System; |
| using System.Collections; |
| using System.Collections.Generic; |
| using System.Text; |
| using System.IO; |
| using System.Linq; |
| using System.Threading; |
| using System.Threading.Tasks; |
| using Microsoft.Extensions.Logging; |
| using Thrift; |
| using Thrift.Collections; |
| |
| using Thrift.Protocol; |
| using Thrift.Protocol.Entities; |
| using Thrift.Protocol.Utilities; |
| using Thrift.Transport; |
| using Thrift.Transport.Client; |
| using Thrift.Transport.Server; |
| using Thrift.Processor; |
| |
| |
| #pragma warning disable IDE0079 // remove unnecessary pragmas |
| #pragma warning disable IDE1006 // parts of the code use IDL spelling |
| |
| |
| public partial class TSExecuteStatementResp : TBase |
| { |
| private long _queryId; |
| private List<string> _columns; |
| private string _operationType; |
| private bool _ignoreTimeStamp; |
| private List<string> _dataTypeList; |
| private TSQueryDataSet _queryDataSet; |
| private TSQueryNonAlignDataSet _nonAlignQueryDataSet; |
| private Dictionary<string, int> _columnNameIndexMap; |
| |
| public TSStatus Status { get; set; } |
| |
| public long QueryId |
| { |
| get |
| { |
| return _queryId; |
| } |
| set |
| { |
| __isset.queryId = true; |
| this._queryId = value; |
| } |
| } |
| |
| public List<string> Columns |
| { |
| get |
| { |
| return _columns; |
| } |
| set |
| { |
| __isset.columns = true; |
| this._columns = value; |
| } |
| } |
| |
| public string OperationType |
| { |
| get |
| { |
| return _operationType; |
| } |
| set |
| { |
| __isset.operationType = true; |
| this._operationType = value; |
| } |
| } |
| |
| public bool IgnoreTimeStamp |
| { |
| get |
| { |
| return _ignoreTimeStamp; |
| } |
| set |
| { |
| __isset.ignoreTimeStamp = true; |
| this._ignoreTimeStamp = value; |
| } |
| } |
| |
| public List<string> DataTypeList |
| { |
| get |
| { |
| return _dataTypeList; |
| } |
| set |
| { |
| __isset.dataTypeList = true; |
| this._dataTypeList = value; |
| } |
| } |
| |
| public TSQueryDataSet QueryDataSet |
| { |
| get |
| { |
| return _queryDataSet; |
| } |
| set |
| { |
| __isset.queryDataSet = true; |
| this._queryDataSet = value; |
| } |
| } |
| |
| public TSQueryNonAlignDataSet NonAlignQueryDataSet |
| { |
| get |
| { |
| return _nonAlignQueryDataSet; |
| } |
| set |
| { |
| __isset.nonAlignQueryDataSet = true; |
| this._nonAlignQueryDataSet = value; |
| } |
| } |
| |
| public Dictionary<string, int> ColumnNameIndexMap |
| { |
| get |
| { |
| return _columnNameIndexMap; |
| } |
| set |
| { |
| __isset.columnNameIndexMap = true; |
| this._columnNameIndexMap = value; |
| } |
| } |
| |
| |
| public Isset __isset; |
| public struct Isset |
| { |
| public bool queryId; |
| public bool columns; |
| public bool operationType; |
| public bool ignoreTimeStamp; |
| public bool dataTypeList; |
| public bool queryDataSet; |
| public bool nonAlignQueryDataSet; |
| public bool columnNameIndexMap; |
| } |
| |
| public TSExecuteStatementResp() |
| { |
| } |
| |
| public TSExecuteStatementResp(TSStatus status) : this() |
| { |
| this.Status = status; |
| } |
| |
| public TSExecuteStatementResp DeepCopy() |
| { |
| var tmp28 = new TSExecuteStatementResp(); |
| if((Status != null)) |
| { |
| tmp28.Status = (TSStatus)this.Status.DeepCopy(); |
| } |
| if(__isset.queryId) |
| { |
| tmp28.QueryId = this.QueryId; |
| } |
| tmp28.__isset.queryId = this.__isset.queryId; |
| if((Columns != null) && __isset.columns) |
| { |
| tmp28.Columns = this.Columns.DeepCopy(); |
| } |
| tmp28.__isset.columns = this.__isset.columns; |
| if((OperationType != null) && __isset.operationType) |
| { |
| tmp28.OperationType = this.OperationType; |
| } |
| tmp28.__isset.operationType = this.__isset.operationType; |
| if(__isset.ignoreTimeStamp) |
| { |
| tmp28.IgnoreTimeStamp = this.IgnoreTimeStamp; |
| } |
| tmp28.__isset.ignoreTimeStamp = this.__isset.ignoreTimeStamp; |
| if((DataTypeList != null) && __isset.dataTypeList) |
| { |
| tmp28.DataTypeList = this.DataTypeList.DeepCopy(); |
| } |
| tmp28.__isset.dataTypeList = this.__isset.dataTypeList; |
| if((QueryDataSet != null) && __isset.queryDataSet) |
| { |
| tmp28.QueryDataSet = (TSQueryDataSet)this.QueryDataSet.DeepCopy(); |
| } |
| tmp28.__isset.queryDataSet = this.__isset.queryDataSet; |
| if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) |
| { |
| tmp28.NonAlignQueryDataSet = (TSQueryNonAlignDataSet)this.NonAlignQueryDataSet.DeepCopy(); |
| } |
| tmp28.__isset.nonAlignQueryDataSet = this.__isset.nonAlignQueryDataSet; |
| if((ColumnNameIndexMap != null) && __isset.columnNameIndexMap) |
| { |
| tmp28.ColumnNameIndexMap = this.ColumnNameIndexMap.DeepCopy(); |
| } |
| tmp28.__isset.columnNameIndexMap = this.__isset.columnNameIndexMap; |
| return tmp28; |
| } |
| |
| public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken) |
| { |
| iprot.IncrementRecursionDepth(); |
| try |
| { |
| bool isset_status = false; |
| TField field; |
| await iprot.ReadStructBeginAsync(cancellationToken); |
| while (true) |
| { |
| field = await iprot.ReadFieldBeginAsync(cancellationToken); |
| if (field.Type == TType.Stop) |
| { |
| break; |
| } |
| |
| switch (field.ID) |
| { |
| case 1: |
| if (field.Type == TType.Struct) |
| { |
| Status = new TSStatus(); |
| await Status.ReadAsync(iprot, cancellationToken); |
| isset_status = true; |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 2: |
| if (field.Type == TType.I64) |
| { |
| QueryId = await iprot.ReadI64Async(cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 3: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list29 = await iprot.ReadListBeginAsync(cancellationToken); |
| Columns = new List<string>(_list29.Count); |
| for(int _i30 = 0; _i30 < _list29.Count; ++_i30) |
| { |
| string _elem31; |
| _elem31 = await iprot.ReadStringAsync(cancellationToken); |
| Columns.Add(_elem31); |
| } |
| await iprot.ReadListEndAsync(cancellationToken); |
| } |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 4: |
| if (field.Type == TType.String) |
| { |
| OperationType = await iprot.ReadStringAsync(cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 5: |
| if (field.Type == TType.Bool) |
| { |
| IgnoreTimeStamp = await iprot.ReadBoolAsync(cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 6: |
| if (field.Type == TType.List) |
| { |
| { |
| TList _list32 = await iprot.ReadListBeginAsync(cancellationToken); |
| DataTypeList = new List<string>(_list32.Count); |
| for(int _i33 = 0; _i33 < _list32.Count; ++_i33) |
| { |
| string _elem34; |
| _elem34 = await iprot.ReadStringAsync(cancellationToken); |
| DataTypeList.Add(_elem34); |
| } |
| await iprot.ReadListEndAsync(cancellationToken); |
| } |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 7: |
| if (field.Type == TType.Struct) |
| { |
| QueryDataSet = new TSQueryDataSet(); |
| await QueryDataSet.ReadAsync(iprot, cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 8: |
| if (field.Type == TType.Struct) |
| { |
| NonAlignQueryDataSet = new TSQueryNonAlignDataSet(); |
| await NonAlignQueryDataSet.ReadAsync(iprot, cancellationToken); |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| case 9: |
| if (field.Type == TType.Map) |
| { |
| { |
| TMap _map35 = await iprot.ReadMapBeginAsync(cancellationToken); |
| ColumnNameIndexMap = new Dictionary<string, int>(_map35.Count); |
| for(int _i36 = 0; _i36 < _map35.Count; ++_i36) |
| { |
| string _key37; |
| int _val38; |
| _key37 = await iprot.ReadStringAsync(cancellationToken); |
| _val38 = await iprot.ReadI32Async(cancellationToken); |
| ColumnNameIndexMap[_key37] = _val38; |
| } |
| await iprot.ReadMapEndAsync(cancellationToken); |
| } |
| } |
| else |
| { |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| } |
| break; |
| default: |
| await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken); |
| break; |
| } |
| |
| await iprot.ReadFieldEndAsync(cancellationToken); |
| } |
| |
| await iprot.ReadStructEndAsync(cancellationToken); |
| if (!isset_status) |
| { |
| throw new TProtocolException(TProtocolException.INVALID_DATA); |
| } |
| } |
| finally |
| { |
| iprot.DecrementRecursionDepth(); |
| } |
| } |
| |
| public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken) |
| { |
| oprot.IncrementRecursionDepth(); |
| try |
| { |
| var struc = new TStruct("TSExecuteStatementResp"); |
| await oprot.WriteStructBeginAsync(struc, cancellationToken); |
| var field = new TField(); |
| if((Status != null)) |
| { |
| field.Name = "status"; |
| field.Type = TType.Struct; |
| field.ID = 1; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await Status.WriteAsync(oprot, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if(__isset.queryId) |
| { |
| field.Name = "queryId"; |
| field.Type = TType.I64; |
| field.ID = 2; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteI64Async(QueryId, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((Columns != null) && __isset.columns) |
| { |
| field.Name = "columns"; |
| field.Type = TType.List; |
| field.ID = 3; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.String, Columns.Count), cancellationToken); |
| foreach (string _iter39 in Columns) |
| { |
| await oprot.WriteStringAsync(_iter39, cancellationToken); |
| } |
| await oprot.WriteListEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((OperationType != null) && __isset.operationType) |
| { |
| field.Name = "operationType"; |
| field.Type = TType.String; |
| field.ID = 4; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteStringAsync(OperationType, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if(__isset.ignoreTimeStamp) |
| { |
| field.Name = "ignoreTimeStamp"; |
| field.Type = TType.Bool; |
| field.ID = 5; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await oprot.WriteBoolAsync(IgnoreTimeStamp, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((DataTypeList != null) && __isset.dataTypeList) |
| { |
| field.Name = "dataTypeList"; |
| field.Type = TType.List; |
| field.ID = 6; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteListBeginAsync(new TList(TType.String, DataTypeList.Count), cancellationToken); |
| foreach (string _iter40 in DataTypeList) |
| { |
| await oprot.WriteStringAsync(_iter40, cancellationToken); |
| } |
| await oprot.WriteListEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((QueryDataSet != null) && __isset.queryDataSet) |
| { |
| field.Name = "queryDataSet"; |
| field.Type = TType.Struct; |
| field.ID = 7; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await QueryDataSet.WriteAsync(oprot, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) |
| { |
| field.Name = "nonAlignQueryDataSet"; |
| field.Type = TType.Struct; |
| field.ID = 8; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| await NonAlignQueryDataSet.WriteAsync(oprot, cancellationToken); |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| if((ColumnNameIndexMap != null) && __isset.columnNameIndexMap) |
| { |
| field.Name = "columnNameIndexMap"; |
| field.Type = TType.Map; |
| field.ID = 9; |
| await oprot.WriteFieldBeginAsync(field, cancellationToken); |
| { |
| await oprot.WriteMapBeginAsync(new TMap(TType.String, TType.I32, ColumnNameIndexMap.Count), cancellationToken); |
| foreach (string _iter41 in ColumnNameIndexMap.Keys) |
| { |
| await oprot.WriteStringAsync(_iter41, cancellationToken); |
| await oprot.WriteI32Async(ColumnNameIndexMap[_iter41], cancellationToken); |
| } |
| await oprot.WriteMapEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldEndAsync(cancellationToken); |
| } |
| await oprot.WriteFieldStopAsync(cancellationToken); |
| await oprot.WriteStructEndAsync(cancellationToken); |
| } |
| finally |
| { |
| oprot.DecrementRecursionDepth(); |
| } |
| } |
| |
| public override bool Equals(object that) |
| { |
| if (!(that is TSExecuteStatementResp other)) return false; |
| if (ReferenceEquals(this, other)) return true; |
| return System.Object.Equals(Status, other.Status) |
| && ((__isset.queryId == other.__isset.queryId) && ((!__isset.queryId) || (System.Object.Equals(QueryId, other.QueryId)))) |
| && ((__isset.columns == other.__isset.columns) && ((!__isset.columns) || (TCollections.Equals(Columns, other.Columns)))) |
| && ((__isset.operationType == other.__isset.operationType) && ((!__isset.operationType) || (System.Object.Equals(OperationType, other.OperationType)))) |
| && ((__isset.ignoreTimeStamp == other.__isset.ignoreTimeStamp) && ((!__isset.ignoreTimeStamp) || (System.Object.Equals(IgnoreTimeStamp, other.IgnoreTimeStamp)))) |
| && ((__isset.dataTypeList == other.__isset.dataTypeList) && ((!__isset.dataTypeList) || (TCollections.Equals(DataTypeList, other.DataTypeList)))) |
| && ((__isset.queryDataSet == other.__isset.queryDataSet) && ((!__isset.queryDataSet) || (System.Object.Equals(QueryDataSet, other.QueryDataSet)))) |
| && ((__isset.nonAlignQueryDataSet == other.__isset.nonAlignQueryDataSet) && ((!__isset.nonAlignQueryDataSet) || (System.Object.Equals(NonAlignQueryDataSet, other.NonAlignQueryDataSet)))) |
| && ((__isset.columnNameIndexMap == other.__isset.columnNameIndexMap) && ((!__isset.columnNameIndexMap) || (TCollections.Equals(ColumnNameIndexMap, other.ColumnNameIndexMap)))); |
| } |
| |
| public override int GetHashCode() { |
| int hashcode = 157; |
| unchecked { |
| if((Status != null)) |
| { |
| hashcode = (hashcode * 397) + Status.GetHashCode(); |
| } |
| if(__isset.queryId) |
| { |
| hashcode = (hashcode * 397) + QueryId.GetHashCode(); |
| } |
| if((Columns != null) && __isset.columns) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(Columns); |
| } |
| if((OperationType != null) && __isset.operationType) |
| { |
| hashcode = (hashcode * 397) + OperationType.GetHashCode(); |
| } |
| if(__isset.ignoreTimeStamp) |
| { |
| hashcode = (hashcode * 397) + IgnoreTimeStamp.GetHashCode(); |
| } |
| if((DataTypeList != null) && __isset.dataTypeList) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(DataTypeList); |
| } |
| if((QueryDataSet != null) && __isset.queryDataSet) |
| { |
| hashcode = (hashcode * 397) + QueryDataSet.GetHashCode(); |
| } |
| if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) |
| { |
| hashcode = (hashcode * 397) + NonAlignQueryDataSet.GetHashCode(); |
| } |
| if((ColumnNameIndexMap != null) && __isset.columnNameIndexMap) |
| { |
| hashcode = (hashcode * 397) + TCollections.GetHashCode(ColumnNameIndexMap); |
| } |
| } |
| return hashcode; |
| } |
| |
| public override string ToString() |
| { |
| var sb = new StringBuilder("TSExecuteStatementResp("); |
| if((Status != null)) |
| { |
| sb.Append(", Status: "); |
| Status.ToString(sb); |
| } |
| if(__isset.queryId) |
| { |
| sb.Append(", QueryId: "); |
| QueryId.ToString(sb); |
| } |
| if((Columns != null) && __isset.columns) |
| { |
| sb.Append(", Columns: "); |
| Columns.ToString(sb); |
| } |
| if((OperationType != null) && __isset.operationType) |
| { |
| sb.Append(", OperationType: "); |
| OperationType.ToString(sb); |
| } |
| if(__isset.ignoreTimeStamp) |
| { |
| sb.Append(", IgnoreTimeStamp: "); |
| IgnoreTimeStamp.ToString(sb); |
| } |
| if((DataTypeList != null) && __isset.dataTypeList) |
| { |
| sb.Append(", DataTypeList: "); |
| DataTypeList.ToString(sb); |
| } |
| if((QueryDataSet != null) && __isset.queryDataSet) |
| { |
| sb.Append(", QueryDataSet: "); |
| QueryDataSet.ToString(sb); |
| } |
| if((NonAlignQueryDataSet != null) && __isset.nonAlignQueryDataSet) |
| { |
| sb.Append(", NonAlignQueryDataSet: "); |
| NonAlignQueryDataSet.ToString(sb); |
| } |
| if((ColumnNameIndexMap != null) && __isset.columnNameIndexMap) |
| { |
| sb.Append(", ColumnNameIndexMap: "); |
| ColumnNameIndexMap.ToString(sb); |
| } |
| sb.Append(')'); |
| return sb.ToString(); |
| } |
| } |
| |