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

var thrift = require('thrift');
var Thrift = thrift.Thrift;
var Q = thrift.Q;


var ttypes = module.exports = {};
ttypes.TProtocolVersion = {
  'HIVE_CLI_SERVICE_PROTOCOL_V1' : 0,
  'HIVE_CLI_SERVICE_PROTOCOL_V2' : 1,
  'HIVE_CLI_SERVICE_PROTOCOL_V3' : 2,
  'HIVE_CLI_SERVICE_PROTOCOL_V4' : 3,
  'HIVE_CLI_SERVICE_PROTOCOL_V5' : 4,
  'HIVE_CLI_SERVICE_PROTOCOL_V6' : 5,
  'HIVE_CLI_SERVICE_PROTOCOL_V7' : 6,
  'HIVE_CLI_SERVICE_PROTOCOL_V8' : 7,
  'HIVE_CLI_SERVICE_PROTOCOL_V9' : 8,
  'HIVE_CLI_SERVICE_PROTOCOL_V10' : 9
};
ttypes.TTypeId = {
  'BOOLEAN_TYPE' : 0,
  'TINYINT_TYPE' : 1,
  'SMALLINT_TYPE' : 2,
  'INT_TYPE' : 3,
  'BIGINT_TYPE' : 4,
  'FLOAT_TYPE' : 5,
  'DOUBLE_TYPE' : 6,
  'STRING_TYPE' : 7,
  'TIMESTAMP_TYPE' : 8,
  'BINARY_TYPE' : 9,
  'ARRAY_TYPE' : 10,
  'MAP_TYPE' : 11,
  'STRUCT_TYPE' : 12,
  'UNION_TYPE' : 13,
  'USER_DEFINED_TYPE' : 14,
  'DECIMAL_TYPE' : 15,
  'NULL_TYPE' : 16,
  'DATE_TYPE' : 17,
  'VARCHAR_TYPE' : 18,
  'CHAR_TYPE' : 19,
  'INTERVAL_YEAR_MONTH_TYPE' : 20,
  'INTERVAL_DAY_TIME_TYPE' : 21
};
ttypes.TStatusCode = {
  'SUCCESS_STATUS' : 0,
  'SUCCESS_WITH_INFO_STATUS' : 1,
  'STILL_EXECUTING_STATUS' : 2,
  'ERROR_STATUS' : 3,
  'INVALID_HANDLE_STATUS' : 4
};
ttypes.TOperationState = {
  'INITIALIZED_STATE' : 0,
  'RUNNING_STATE' : 1,
  'FINISHED_STATE' : 2,
  'CANCELED_STATE' : 3,
  'CLOSED_STATE' : 4,
  'ERROR_STATE' : 5,
  'UKNOWN_STATE' : 6,
  'PENDING_STATE' : 7,
  'TIMEDOUT_STATE' : 8
};
ttypes.TOperationType = {
  'EXECUTE_STATEMENT' : 0,
  'GET_TYPE_INFO' : 1,
  'GET_CATALOGS' : 2,
  'GET_SCHEMAS' : 3,
  'GET_TABLES' : 4,
  'GET_TABLE_TYPES' : 5,
  'GET_COLUMNS' : 6,
  'GET_FUNCTIONS' : 7,
  'UNKNOWN' : 8
};
ttypes.TGetInfoType = {
  'CLI_MAX_DRIVER_CONNECTIONS' : 0,
  'CLI_MAX_CONCURRENT_ACTIVITIES' : 1,
  'CLI_DATA_SOURCE_NAME' : 2,
  'CLI_FETCH_DIRECTION' : 8,
  'CLI_SERVER_NAME' : 13,
  'CLI_SEARCH_PATTERN_ESCAPE' : 14,
  'CLI_DBMS_NAME' : 17,
  'CLI_DBMS_VER' : 18,
  'CLI_ACCESSIBLE_TABLES' : 19,
  'CLI_ACCESSIBLE_PROCEDURES' : 20,
  'CLI_CURSOR_COMMIT_BEHAVIOR' : 23,
  'CLI_DATA_SOURCE_READ_ONLY' : 25,
  'CLI_DEFAULT_TXN_ISOLATION' : 26,
  'CLI_IDENTIFIER_CASE' : 28,
  'CLI_IDENTIFIER_QUOTE_CHAR' : 29,
  'CLI_MAX_COLUMN_NAME_LEN' : 30,
  'CLI_MAX_CURSOR_NAME_LEN' : 31,
  'CLI_MAX_SCHEMA_NAME_LEN' : 32,
  'CLI_MAX_CATALOG_NAME_LEN' : 34,
  'CLI_MAX_TABLE_NAME_LEN' : 35,
  'CLI_SCROLL_CONCURRENCY' : 43,
  'CLI_TXN_CAPABLE' : 46,
  'CLI_USER_NAME' : 47,
  'CLI_TXN_ISOLATION_OPTION' : 72,
  'CLI_INTEGRITY' : 73,
  'CLI_GETDATA_EXTENSIONS' : 81,
  'CLI_NULL_COLLATION' : 85,
  'CLI_ALTER_TABLE' : 86,
  'CLI_ORDER_BY_COLUMNS_IN_SELECT' : 90,
  'CLI_SPECIAL_CHARACTERS' : 94,
  'CLI_MAX_COLUMNS_IN_GROUP_BY' : 97,
  'CLI_MAX_COLUMNS_IN_INDEX' : 98,
  'CLI_MAX_COLUMNS_IN_ORDER_BY' : 99,
  'CLI_MAX_COLUMNS_IN_SELECT' : 100,
  'CLI_MAX_COLUMNS_IN_TABLE' : 101,
  'CLI_MAX_INDEX_SIZE' : 102,
  'CLI_MAX_ROW_SIZE' : 104,
  'CLI_MAX_STATEMENT_LEN' : 105,
  'CLI_MAX_TABLES_IN_SELECT' : 106,
  'CLI_MAX_USER_NAME_LEN' : 107,
  'CLI_OJ_CAPABILITIES' : 115,
  'CLI_XOPEN_CLI_YEAR' : 10000,
  'CLI_CURSOR_SENSITIVITY' : 10001,
  'CLI_DESCRIBE_PARAMETER' : 10002,
  'CLI_CATALOG_NAME' : 10003,
  'CLI_COLLATION_SEQ' : 10004,
  'CLI_MAX_IDENTIFIER_LEN' : 10005
};
ttypes.TFetchOrientation = {
  'FETCH_NEXT' : 0,
  'FETCH_PRIOR' : 1,
  'FETCH_RELATIVE' : 2,
  'FETCH_ABSOLUTE' : 3,
  'FETCH_FIRST' : 4,
  'FETCH_LAST' : 5
};
ttypes.TJobExecutionStatus = {
  'IN_PROGRESS' : 0,
  'COMPLETE' : 1,
  'NOT_AVAILABLE' : 2
};
var TTypeQualifierValue = module.exports.TTypeQualifierValue = function(args) {
  this.i32Value = null;
  this.stringValue = null;
  if (args) {
    if (args.i32Value !== undefined && args.i32Value !== null) {
      this.i32Value = args.i32Value;
    }
    if (args.stringValue !== undefined && args.stringValue !== null) {
      this.stringValue = args.stringValue;
    }
  }
};
TTypeQualifierValue.prototype = {};
TTypeQualifierValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.i32Value = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.stringValue = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TTypeQualifierValue.prototype.write = function(output) {
  output.writeStructBegin('TTypeQualifierValue');
  if (this.i32Value !== null && this.i32Value !== undefined) {
    output.writeFieldBegin('i32Value', Thrift.Type.I32, 1);
    output.writeI32(this.i32Value);
    output.writeFieldEnd();
  }
  if (this.stringValue !== null && this.stringValue !== undefined) {
    output.writeFieldBegin('stringValue', Thrift.Type.STRING, 2);
    output.writeString(this.stringValue);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TTypeQualifiers = module.exports.TTypeQualifiers = function(args) {
  this.qualifiers = null;
  if (args) {
    if (args.qualifiers !== undefined && args.qualifiers !== null) {
      this.qualifiers = Thrift.copyMap(args.qualifiers, [ttypes.TTypeQualifierValue]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field qualifiers is unset!');
    }
  }
};
TTypeQualifiers.prototype = {};
TTypeQualifiers.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.MAP) {
        this.qualifiers = {};
        var _rtmp31 = input.readMapBegin();
        var _size0 = _rtmp31.size || 0;
        for (var _i2 = 0; _i2 < _size0; ++_i2) {
          var key3 = null;
          var val4 = null;
          key3 = input.readString();
          val4 = new ttypes.TTypeQualifierValue();
          val4.read(input);
          this.qualifiers[key3] = val4;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TTypeQualifiers.prototype.write = function(output) {
  output.writeStructBegin('TTypeQualifiers');
  if (this.qualifiers !== null && this.qualifiers !== undefined) {
    output.writeFieldBegin('qualifiers', Thrift.Type.MAP, 1);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRUCT, Thrift.objectLength(this.qualifiers));
    for (var kiter5 in this.qualifiers) {
      if (this.qualifiers.hasOwnProperty(kiter5)) {
        var viter6 = this.qualifiers[kiter5];
        output.writeString(kiter5);
        viter6.write(output);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TPrimitiveTypeEntry = module.exports.TPrimitiveTypeEntry = function(args) {
  this.type = null;
  this.typeQualifiers = null;
  if (args) {
    if (args.type !== undefined && args.type !== null) {
      this.type = args.type;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field type is unset!');
    }
    if (args.typeQualifiers !== undefined && args.typeQualifiers !== null) {
      this.typeQualifiers = new ttypes.TTypeQualifiers(args.typeQualifiers);
    }
  }
};
TPrimitiveTypeEntry.prototype = {};
TPrimitiveTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.type = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.typeQualifiers = new ttypes.TTypeQualifiers();
        this.typeQualifiers.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TPrimitiveTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TPrimitiveTypeEntry');
  if (this.type !== null && this.type !== undefined) {
    output.writeFieldBegin('type', Thrift.Type.I32, 1);
    output.writeI32(this.type);
    output.writeFieldEnd();
  }
  if (this.typeQualifiers !== null && this.typeQualifiers !== undefined) {
    output.writeFieldBegin('typeQualifiers', Thrift.Type.STRUCT, 2);
    this.typeQualifiers.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TArrayTypeEntry = module.exports.TArrayTypeEntry = function(args) {
  this.objectTypePtr = null;
  if (args) {
    if (args.objectTypePtr !== undefined && args.objectTypePtr !== null) {
      this.objectTypePtr = args.objectTypePtr;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field objectTypePtr is unset!');
    }
  }
};
TArrayTypeEntry.prototype = {};
TArrayTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.objectTypePtr = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TArrayTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TArrayTypeEntry');
  if (this.objectTypePtr !== null && this.objectTypePtr !== undefined) {
    output.writeFieldBegin('objectTypePtr', Thrift.Type.I32, 1);
    output.writeI32(this.objectTypePtr);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TMapTypeEntry = module.exports.TMapTypeEntry = function(args) {
  this.keyTypePtr = null;
  this.valueTypePtr = null;
  if (args) {
    if (args.keyTypePtr !== undefined && args.keyTypePtr !== null) {
      this.keyTypePtr = args.keyTypePtr;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field keyTypePtr is unset!');
    }
    if (args.valueTypePtr !== undefined && args.valueTypePtr !== null) {
      this.valueTypePtr = args.valueTypePtr;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field valueTypePtr is unset!');
    }
  }
};
TMapTypeEntry.prototype = {};
TMapTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.keyTypePtr = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.valueTypePtr = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TMapTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TMapTypeEntry');
  if (this.keyTypePtr !== null && this.keyTypePtr !== undefined) {
    output.writeFieldBegin('keyTypePtr', Thrift.Type.I32, 1);
    output.writeI32(this.keyTypePtr);
    output.writeFieldEnd();
  }
  if (this.valueTypePtr !== null && this.valueTypePtr !== undefined) {
    output.writeFieldBegin('valueTypePtr', Thrift.Type.I32, 2);
    output.writeI32(this.valueTypePtr);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TStructTypeEntry = module.exports.TStructTypeEntry = function(args) {
  this.nameToTypePtr = null;
  if (args) {
    if (args.nameToTypePtr !== undefined && args.nameToTypePtr !== null) {
      this.nameToTypePtr = Thrift.copyMap(args.nameToTypePtr, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nameToTypePtr is unset!');
    }
  }
};
TStructTypeEntry.prototype = {};
TStructTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.MAP) {
        this.nameToTypePtr = {};
        var _rtmp38 = input.readMapBegin();
        var _size7 = _rtmp38.size || 0;
        for (var _i9 = 0; _i9 < _size7; ++_i9) {
          var key10 = null;
          var val11 = null;
          key10 = input.readString();
          val11 = input.readI32();
          this.nameToTypePtr[key10] = val11;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TStructTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TStructTypeEntry');
  if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {
    output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));
    for (var kiter12 in this.nameToTypePtr) {
      if (this.nameToTypePtr.hasOwnProperty(kiter12)) {
        var viter13 = this.nameToTypePtr[kiter12];
        output.writeString(kiter12);
        output.writeI32(viter13);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TUnionTypeEntry = module.exports.TUnionTypeEntry = function(args) {
  this.nameToTypePtr = null;
  if (args) {
    if (args.nameToTypePtr !== undefined && args.nameToTypePtr !== null) {
      this.nameToTypePtr = Thrift.copyMap(args.nameToTypePtr, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nameToTypePtr is unset!');
    }
  }
};
TUnionTypeEntry.prototype = {};
TUnionTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.MAP) {
        this.nameToTypePtr = {};
        var _rtmp315 = input.readMapBegin();
        var _size14 = _rtmp315.size || 0;
        for (var _i16 = 0; _i16 < _size14; ++_i16) {
          var key17 = null;
          var val18 = null;
          key17 = input.readString();
          val18 = input.readI32();
          this.nameToTypePtr[key17] = val18;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TUnionTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TUnionTypeEntry');
  if (this.nameToTypePtr !== null && this.nameToTypePtr !== undefined) {
    output.writeFieldBegin('nameToTypePtr', Thrift.Type.MAP, 1);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I32, Thrift.objectLength(this.nameToTypePtr));
    for (var kiter19 in this.nameToTypePtr) {
      if (this.nameToTypePtr.hasOwnProperty(kiter19)) {
        var viter20 = this.nameToTypePtr[kiter19];
        output.writeString(kiter19);
        output.writeI32(viter20);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TUserDefinedTypeEntry = module.exports.TUserDefinedTypeEntry = function(args) {
  this.typeClassName = null;
  if (args) {
    if (args.typeClassName !== undefined && args.typeClassName !== null) {
      this.typeClassName = args.typeClassName;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field typeClassName is unset!');
    }
  }
};
TUserDefinedTypeEntry.prototype = {};
TUserDefinedTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.typeClassName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TUserDefinedTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TUserDefinedTypeEntry');
  if (this.typeClassName !== null && this.typeClassName !== undefined) {
    output.writeFieldBegin('typeClassName', Thrift.Type.STRING, 1);
    output.writeString(this.typeClassName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TTypeEntry = module.exports.TTypeEntry = function(args) {
  this.primitiveEntry = null;
  this.arrayEntry = null;
  this.mapEntry = null;
  this.structEntry = null;
  this.unionEntry = null;
  this.userDefinedTypeEntry = null;
  if (args) {
    if (args.primitiveEntry !== undefined && args.primitiveEntry !== null) {
      this.primitiveEntry = new ttypes.TPrimitiveTypeEntry(args.primitiveEntry);
    }
    if (args.arrayEntry !== undefined && args.arrayEntry !== null) {
      this.arrayEntry = new ttypes.TArrayTypeEntry(args.arrayEntry);
    }
    if (args.mapEntry !== undefined && args.mapEntry !== null) {
      this.mapEntry = new ttypes.TMapTypeEntry(args.mapEntry);
    }
    if (args.structEntry !== undefined && args.structEntry !== null) {
      this.structEntry = new ttypes.TStructTypeEntry(args.structEntry);
    }
    if (args.unionEntry !== undefined && args.unionEntry !== null) {
      this.unionEntry = new ttypes.TUnionTypeEntry(args.unionEntry);
    }
    if (args.userDefinedTypeEntry !== undefined && args.userDefinedTypeEntry !== null) {
      this.userDefinedTypeEntry = new ttypes.TUserDefinedTypeEntry(args.userDefinedTypeEntry);
    }
  }
};
TTypeEntry.prototype = {};
TTypeEntry.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.primitiveEntry = new ttypes.TPrimitiveTypeEntry();
        this.primitiveEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.arrayEntry = new ttypes.TArrayTypeEntry();
        this.arrayEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.mapEntry = new ttypes.TMapTypeEntry();
        this.mapEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRUCT) {
        this.structEntry = new ttypes.TStructTypeEntry();
        this.structEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRUCT) {
        this.unionEntry = new ttypes.TUnionTypeEntry();
        this.unionEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRUCT) {
        this.userDefinedTypeEntry = new ttypes.TUserDefinedTypeEntry();
        this.userDefinedTypeEntry.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TTypeEntry.prototype.write = function(output) {
  output.writeStructBegin('TTypeEntry');
  if (this.primitiveEntry !== null && this.primitiveEntry !== undefined) {
    output.writeFieldBegin('primitiveEntry', Thrift.Type.STRUCT, 1);
    this.primitiveEntry.write(output);
    output.writeFieldEnd();
  }
  if (this.arrayEntry !== null && this.arrayEntry !== undefined) {
    output.writeFieldBegin('arrayEntry', Thrift.Type.STRUCT, 2);
    this.arrayEntry.write(output);
    output.writeFieldEnd();
  }
  if (this.mapEntry !== null && this.mapEntry !== undefined) {
    output.writeFieldBegin('mapEntry', Thrift.Type.STRUCT, 3);
    this.mapEntry.write(output);
    output.writeFieldEnd();
  }
  if (this.structEntry !== null && this.structEntry !== undefined) {
    output.writeFieldBegin('structEntry', Thrift.Type.STRUCT, 4);
    this.structEntry.write(output);
    output.writeFieldEnd();
  }
  if (this.unionEntry !== null && this.unionEntry !== undefined) {
    output.writeFieldBegin('unionEntry', Thrift.Type.STRUCT, 5);
    this.unionEntry.write(output);
    output.writeFieldEnd();
  }
  if (this.userDefinedTypeEntry !== null && this.userDefinedTypeEntry !== undefined) {
    output.writeFieldBegin('userDefinedTypeEntry', Thrift.Type.STRUCT, 6);
    this.userDefinedTypeEntry.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TTypeDesc = module.exports.TTypeDesc = function(args) {
  this.types = null;
  if (args) {
    if (args.types !== undefined && args.types !== null) {
      this.types = Thrift.copyList(args.types, [ttypes.TTypeEntry]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field types is unset!');
    }
  }
};
TTypeDesc.prototype = {};
TTypeDesc.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.types = [];
        var _rtmp322 = input.readListBegin();
        var _size21 = _rtmp322.size || 0;
        for (var _i23 = 0; _i23 < _size21; ++_i23) {
          var elem24 = null;
          elem24 = new ttypes.TTypeEntry();
          elem24.read(input);
          this.types.push(elem24);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TTypeDesc.prototype.write = function(output) {
  output.writeStructBegin('TTypeDesc');
  if (this.types !== null && this.types !== undefined) {
    output.writeFieldBegin('types', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.types.length);
    for (var iter25 in this.types) {
      if (this.types.hasOwnProperty(iter25)) {
        iter25 = this.types[iter25];
        iter25.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TColumnDesc = module.exports.TColumnDesc = function(args) {
  this.columnName = null;
  this.typeDesc = null;
  this.position = null;
  this.comment = null;
  if (args) {
    if (args.columnName !== undefined && args.columnName !== null) {
      this.columnName = args.columnName;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field columnName is unset!');
    }
    if (args.typeDesc !== undefined && args.typeDesc !== null) {
      this.typeDesc = new ttypes.TTypeDesc(args.typeDesc);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field typeDesc is unset!');
    }
    if (args.position !== undefined && args.position !== null) {
      this.position = args.position;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field position is unset!');
    }
    if (args.comment !== undefined && args.comment !== null) {
      this.comment = args.comment;
    }
  }
};
TColumnDesc.prototype = {};
TColumnDesc.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.columnName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.typeDesc = new ttypes.TTypeDesc();
        this.typeDesc.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I32) {
        this.position = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.comment = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TColumnDesc.prototype.write = function(output) {
  output.writeStructBegin('TColumnDesc');
  if (this.columnName !== null && this.columnName !== undefined) {
    output.writeFieldBegin('columnName', Thrift.Type.STRING, 1);
    output.writeString(this.columnName);
    output.writeFieldEnd();
  }
  if (this.typeDesc !== null && this.typeDesc !== undefined) {
    output.writeFieldBegin('typeDesc', Thrift.Type.STRUCT, 2);
    this.typeDesc.write(output);
    output.writeFieldEnd();
  }
  if (this.position !== null && this.position !== undefined) {
    output.writeFieldBegin('position', Thrift.Type.I32, 3);
    output.writeI32(this.position);
    output.writeFieldEnd();
  }
  if (this.comment !== null && this.comment !== undefined) {
    output.writeFieldBegin('comment', Thrift.Type.STRING, 4);
    output.writeString(this.comment);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TTableSchema = module.exports.TTableSchema = function(args) {
  this.columns = null;
  if (args) {
    if (args.columns !== undefined && args.columns !== null) {
      this.columns = Thrift.copyList(args.columns, [ttypes.TColumnDesc]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field columns is unset!');
    }
  }
};
TTableSchema.prototype = {};
TTableSchema.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.columns = [];
        var _rtmp327 = input.readListBegin();
        var _size26 = _rtmp327.size || 0;
        for (var _i28 = 0; _i28 < _size26; ++_i28) {
          var elem29 = null;
          elem29 = new ttypes.TColumnDesc();
          elem29.read(input);
          this.columns.push(elem29);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TTableSchema.prototype.write = function(output) {
  output.writeStructBegin('TTableSchema');
  if (this.columns !== null && this.columns !== undefined) {
    output.writeFieldBegin('columns', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);
    for (var iter30 in this.columns) {
      if (this.columns.hasOwnProperty(iter30)) {
        iter30 = this.columns[iter30];
        iter30.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TBoolValue = module.exports.TBoolValue = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TBoolValue.prototype = {};
TBoolValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.BOOL) {
        this.value = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TBoolValue.prototype.write = function(output) {
  output.writeStructBegin('TBoolValue');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.BOOL, 1);
    output.writeBool(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TByteValue = module.exports.TByteValue = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TByteValue.prototype = {};
TByteValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.BYTE) {
        this.value = input.readByte();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TByteValue.prototype.write = function(output) {
  output.writeStructBegin('TByteValue');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.BYTE, 1);
    output.writeByte(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI16Value = module.exports.TI16Value = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TI16Value.prototype = {};
TI16Value.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I16) {
        this.value = input.readI16();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI16Value.prototype.write = function(output) {
  output.writeStructBegin('TI16Value');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.I16, 1);
    output.writeI16(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI32Value = module.exports.TI32Value = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TI32Value.prototype = {};
TI32Value.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.value = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI32Value.prototype.write = function(output) {
  output.writeStructBegin('TI32Value');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.I32, 1);
    output.writeI32(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI64Value = module.exports.TI64Value = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TI64Value.prototype = {};
TI64Value.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I64) {
        this.value = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI64Value.prototype.write = function(output) {
  output.writeStructBegin('TI64Value');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.I64, 1);
    output.writeI64(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TDoubleValue = module.exports.TDoubleValue = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TDoubleValue.prototype = {};
TDoubleValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.DOUBLE) {
        this.value = input.readDouble();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TDoubleValue.prototype.write = function(output) {
  output.writeStructBegin('TDoubleValue');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.DOUBLE, 1);
    output.writeDouble(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TStringValue = module.exports.TStringValue = function(args) {
  this.value = null;
  if (args) {
    if (args.value !== undefined && args.value !== null) {
      this.value = args.value;
    }
  }
};
TStringValue.prototype = {};
TStringValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.value = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TStringValue.prototype.write = function(output) {
  output.writeStructBegin('TStringValue');
  if (this.value !== null && this.value !== undefined) {
    output.writeFieldBegin('value', Thrift.Type.STRING, 1);
    output.writeString(this.value);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TColumnValue = module.exports.TColumnValue = function(args) {
  this.boolVal = null;
  this.byteVal = null;
  this.i16Val = null;
  this.i32Val = null;
  this.i64Val = null;
  this.doubleVal = null;
  this.stringVal = null;
  if (args) {
    if (args.boolVal !== undefined && args.boolVal !== null) {
      this.boolVal = new ttypes.TBoolValue(args.boolVal);
    }
    if (args.byteVal !== undefined && args.byteVal !== null) {
      this.byteVal = new ttypes.TByteValue(args.byteVal);
    }
    if (args.i16Val !== undefined && args.i16Val !== null) {
      this.i16Val = new ttypes.TI16Value(args.i16Val);
    }
    if (args.i32Val !== undefined && args.i32Val !== null) {
      this.i32Val = new ttypes.TI32Value(args.i32Val);
    }
    if (args.i64Val !== undefined && args.i64Val !== null) {
      this.i64Val = new ttypes.TI64Value(args.i64Val);
    }
    if (args.doubleVal !== undefined && args.doubleVal !== null) {
      this.doubleVal = new ttypes.TDoubleValue(args.doubleVal);
    }
    if (args.stringVal !== undefined && args.stringVal !== null) {
      this.stringVal = new ttypes.TStringValue(args.stringVal);
    }
  }
};
TColumnValue.prototype = {};
TColumnValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.boolVal = new ttypes.TBoolValue();
        this.boolVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.byteVal = new ttypes.TByteValue();
        this.byteVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.i16Val = new ttypes.TI16Value();
        this.i16Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRUCT) {
        this.i32Val = new ttypes.TI32Value();
        this.i32Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRUCT) {
        this.i64Val = new ttypes.TI64Value();
        this.i64Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRUCT) {
        this.doubleVal = new ttypes.TDoubleValue();
        this.doubleVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.STRUCT) {
        this.stringVal = new ttypes.TStringValue();
        this.stringVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TColumnValue.prototype.write = function(output) {
  output.writeStructBegin('TColumnValue');
  if (this.boolVal !== null && this.boolVal !== undefined) {
    output.writeFieldBegin('boolVal', Thrift.Type.STRUCT, 1);
    this.boolVal.write(output);
    output.writeFieldEnd();
  }
  if (this.byteVal !== null && this.byteVal !== undefined) {
    output.writeFieldBegin('byteVal', Thrift.Type.STRUCT, 2);
    this.byteVal.write(output);
    output.writeFieldEnd();
  }
  if (this.i16Val !== null && this.i16Val !== undefined) {
    output.writeFieldBegin('i16Val', Thrift.Type.STRUCT, 3);
    this.i16Val.write(output);
    output.writeFieldEnd();
  }
  if (this.i32Val !== null && this.i32Val !== undefined) {
    output.writeFieldBegin('i32Val', Thrift.Type.STRUCT, 4);
    this.i32Val.write(output);
    output.writeFieldEnd();
  }
  if (this.i64Val !== null && this.i64Val !== undefined) {
    output.writeFieldBegin('i64Val', Thrift.Type.STRUCT, 5);
    this.i64Val.write(output);
    output.writeFieldEnd();
  }
  if (this.doubleVal !== null && this.doubleVal !== undefined) {
    output.writeFieldBegin('doubleVal', Thrift.Type.STRUCT, 6);
    this.doubleVal.write(output);
    output.writeFieldEnd();
  }
  if (this.stringVal !== null && this.stringVal !== undefined) {
    output.writeFieldBegin('stringVal', Thrift.Type.STRUCT, 7);
    this.stringVal.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TRow = module.exports.TRow = function(args) {
  this.colVals = null;
  if (args) {
    if (args.colVals !== undefined && args.colVals !== null) {
      this.colVals = Thrift.copyList(args.colVals, [ttypes.TColumnValue]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field colVals is unset!');
    }
  }
};
TRow.prototype = {};
TRow.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.colVals = [];
        var _rtmp332 = input.readListBegin();
        var _size31 = _rtmp332.size || 0;
        for (var _i33 = 0; _i33 < _size31; ++_i33) {
          var elem34 = null;
          elem34 = new ttypes.TColumnValue();
          elem34.read(input);
          this.colVals.push(elem34);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TRow.prototype.write = function(output) {
  output.writeStructBegin('TRow');
  if (this.colVals !== null && this.colVals !== undefined) {
    output.writeFieldBegin('colVals', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRUCT, this.colVals.length);
    for (var iter35 in this.colVals) {
      if (this.colVals.hasOwnProperty(iter35)) {
        iter35 = this.colVals[iter35];
        iter35.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TBoolColumn = module.exports.TBoolColumn = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TBoolColumn.prototype = {};
TBoolColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp337 = input.readListBegin();
        var _size36 = _rtmp337.size || 0;
        for (var _i38 = 0; _i38 < _size36; ++_i38) {
          var elem39 = null;
          elem39 = input.readBool();
          this.values.push(elem39);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TBoolColumn.prototype.write = function(output) {
  output.writeStructBegin('TBoolColumn');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.BOOL, this.values.length);
    for (var iter40 in this.values) {
      if (this.values.hasOwnProperty(iter40)) {
        iter40 = this.values[iter40];
        output.writeBool(iter40);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TByteColumn = module.exports.TByteColumn = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TByteColumn.prototype = {};
TByteColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp342 = input.readListBegin();
        var _size41 = _rtmp342.size || 0;
        for (var _i43 = 0; _i43 < _size41; ++_i43) {
          var elem44 = null;
          elem44 = input.readByte();
          this.values.push(elem44);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TByteColumn.prototype.write = function(output) {
  output.writeStructBegin('TByteColumn');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.BYTE, this.values.length);
    for (var iter45 in this.values) {
      if (this.values.hasOwnProperty(iter45)) {
        iter45 = this.values[iter45];
        output.writeByte(iter45);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI16Column = module.exports.TI16Column = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TI16Column.prototype = {};
TI16Column.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp347 = input.readListBegin();
        var _size46 = _rtmp347.size || 0;
        for (var _i48 = 0; _i48 < _size46; ++_i48) {
          var elem49 = null;
          elem49 = input.readI16();
          this.values.push(elem49);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI16Column.prototype.write = function(output) {
  output.writeStructBegin('TI16Column');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.I16, this.values.length);
    for (var iter50 in this.values) {
      if (this.values.hasOwnProperty(iter50)) {
        iter50 = this.values[iter50];
        output.writeI16(iter50);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI32Column = module.exports.TI32Column = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TI32Column.prototype = {};
TI32Column.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp352 = input.readListBegin();
        var _size51 = _rtmp352.size || 0;
        for (var _i53 = 0; _i53 < _size51; ++_i53) {
          var elem54 = null;
          elem54 = input.readI32();
          this.values.push(elem54);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI32Column.prototype.write = function(output) {
  output.writeStructBegin('TI32Column');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.I32, this.values.length);
    for (var iter55 in this.values) {
      if (this.values.hasOwnProperty(iter55)) {
        iter55 = this.values[iter55];
        output.writeI32(iter55);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TI64Column = module.exports.TI64Column = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TI64Column.prototype = {};
TI64Column.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp357 = input.readListBegin();
        var _size56 = _rtmp357.size || 0;
        for (var _i58 = 0; _i58 < _size56; ++_i58) {
          var elem59 = null;
          elem59 = input.readI64();
          this.values.push(elem59);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TI64Column.prototype.write = function(output) {
  output.writeStructBegin('TI64Column');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.I64, this.values.length);
    for (var iter60 in this.values) {
      if (this.values.hasOwnProperty(iter60)) {
        iter60 = this.values[iter60];
        output.writeI64(iter60);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TDoubleColumn = module.exports.TDoubleColumn = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TDoubleColumn.prototype = {};
TDoubleColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp362 = input.readListBegin();
        var _size61 = _rtmp362.size || 0;
        for (var _i63 = 0; _i63 < _size61; ++_i63) {
          var elem64 = null;
          elem64 = input.readDouble();
          this.values.push(elem64);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TDoubleColumn.prototype.write = function(output) {
  output.writeStructBegin('TDoubleColumn');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.DOUBLE, this.values.length);
    for (var iter65 in this.values) {
      if (this.values.hasOwnProperty(iter65)) {
        iter65 = this.values[iter65];
        output.writeDouble(iter65);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TStringColumn = module.exports.TStringColumn = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TStringColumn.prototype = {};
TStringColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp367 = input.readListBegin();
        var _size66 = _rtmp367.size || 0;
        for (var _i68 = 0; _i68 < _size66; ++_i68) {
          var elem69 = null;
          elem69 = input.readString();
          this.values.push(elem69);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TStringColumn.prototype.write = function(output) {
  output.writeStructBegin('TStringColumn');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRING, this.values.length);
    for (var iter70 in this.values) {
      if (this.values.hasOwnProperty(iter70)) {
        iter70 = this.values[iter70];
        output.writeString(iter70);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TBinaryColumn = module.exports.TBinaryColumn = function(args) {
  this.values = null;
  this.nulls = null;
  if (args) {
    if (args.values !== undefined && args.values !== null) {
      this.values = Thrift.copyList(args.values, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field values is unset!');
    }
    if (args.nulls !== undefined && args.nulls !== null) {
      this.nulls = args.nulls;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field nulls is unset!');
    }
  }
};
TBinaryColumn.prototype = {};
TBinaryColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.values = [];
        var _rtmp372 = input.readListBegin();
        var _size71 = _rtmp372.size || 0;
        for (var _i73 = 0; _i73 < _size71; ++_i73) {
          var elem74 = null;
          elem74 = input.readBinary();
          this.values.push(elem74);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.nulls = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TBinaryColumn.prototype.write = function(output) {
  output.writeStructBegin('TBinaryColumn');
  if (this.values !== null && this.values !== undefined) {
    output.writeFieldBegin('values', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRING, this.values.length);
    for (var iter75 in this.values) {
      if (this.values.hasOwnProperty(iter75)) {
        iter75 = this.values[iter75];
        output.writeBinary(iter75);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.nulls !== null && this.nulls !== undefined) {
    output.writeFieldBegin('nulls', Thrift.Type.STRING, 2);
    output.writeBinary(this.nulls);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TColumn = module.exports.TColumn = function(args) {
  this.boolVal = null;
  this.byteVal = null;
  this.i16Val = null;
  this.i32Val = null;
  this.i64Val = null;
  this.doubleVal = null;
  this.stringVal = null;
  this.binaryVal = null;
  if (args) {
    if (args.boolVal !== undefined && args.boolVal !== null) {
      this.boolVal = new ttypes.TBoolColumn(args.boolVal);
    }
    if (args.byteVal !== undefined && args.byteVal !== null) {
      this.byteVal = new ttypes.TByteColumn(args.byteVal);
    }
    if (args.i16Val !== undefined && args.i16Val !== null) {
      this.i16Val = new ttypes.TI16Column(args.i16Val);
    }
    if (args.i32Val !== undefined && args.i32Val !== null) {
      this.i32Val = new ttypes.TI32Column(args.i32Val);
    }
    if (args.i64Val !== undefined && args.i64Val !== null) {
      this.i64Val = new ttypes.TI64Column(args.i64Val);
    }
    if (args.doubleVal !== undefined && args.doubleVal !== null) {
      this.doubleVal = new ttypes.TDoubleColumn(args.doubleVal);
    }
    if (args.stringVal !== undefined && args.stringVal !== null) {
      this.stringVal = new ttypes.TStringColumn(args.stringVal);
    }
    if (args.binaryVal !== undefined && args.binaryVal !== null) {
      this.binaryVal = new ttypes.TBinaryColumn(args.binaryVal);
    }
  }
};
TColumn.prototype = {};
TColumn.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.boolVal = new ttypes.TBoolColumn();
        this.boolVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.byteVal = new ttypes.TByteColumn();
        this.byteVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.i16Val = new ttypes.TI16Column();
        this.i16Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRUCT) {
        this.i32Val = new ttypes.TI32Column();
        this.i32Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRUCT) {
        this.i64Val = new ttypes.TI64Column();
        this.i64Val.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRUCT) {
        this.doubleVal = new ttypes.TDoubleColumn();
        this.doubleVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.STRUCT) {
        this.stringVal = new ttypes.TStringColumn();
        this.stringVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 8:
      if (ftype == Thrift.Type.STRUCT) {
        this.binaryVal = new ttypes.TBinaryColumn();
        this.binaryVal.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TColumn.prototype.write = function(output) {
  output.writeStructBegin('TColumn');
  if (this.boolVal !== null && this.boolVal !== undefined) {
    output.writeFieldBegin('boolVal', Thrift.Type.STRUCT, 1);
    this.boolVal.write(output);
    output.writeFieldEnd();
  }
  if (this.byteVal !== null && this.byteVal !== undefined) {
    output.writeFieldBegin('byteVal', Thrift.Type.STRUCT, 2);
    this.byteVal.write(output);
    output.writeFieldEnd();
  }
  if (this.i16Val !== null && this.i16Val !== undefined) {
    output.writeFieldBegin('i16Val', Thrift.Type.STRUCT, 3);
    this.i16Val.write(output);
    output.writeFieldEnd();
  }
  if (this.i32Val !== null && this.i32Val !== undefined) {
    output.writeFieldBegin('i32Val', Thrift.Type.STRUCT, 4);
    this.i32Val.write(output);
    output.writeFieldEnd();
  }
  if (this.i64Val !== null && this.i64Val !== undefined) {
    output.writeFieldBegin('i64Val', Thrift.Type.STRUCT, 5);
    this.i64Val.write(output);
    output.writeFieldEnd();
  }
  if (this.doubleVal !== null && this.doubleVal !== undefined) {
    output.writeFieldBegin('doubleVal', Thrift.Type.STRUCT, 6);
    this.doubleVal.write(output);
    output.writeFieldEnd();
  }
  if (this.stringVal !== null && this.stringVal !== undefined) {
    output.writeFieldBegin('stringVal', Thrift.Type.STRUCT, 7);
    this.stringVal.write(output);
    output.writeFieldEnd();
  }
  if (this.binaryVal !== null && this.binaryVal !== undefined) {
    output.writeFieldBegin('binaryVal', Thrift.Type.STRUCT, 8);
    this.binaryVal.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TRowSet = module.exports.TRowSet = function(args) {
  this.startRowOffset = null;
  this.rows = null;
  this.columns = null;
  this.binaryColumns = null;
  this.columnCount = null;
  if (args) {
    if (args.startRowOffset !== undefined && args.startRowOffset !== null) {
      this.startRowOffset = args.startRowOffset;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startRowOffset is unset!');
    }
    if (args.rows !== undefined && args.rows !== null) {
      this.rows = Thrift.copyList(args.rows, [ttypes.TRow]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field rows is unset!');
    }
    if (args.columns !== undefined && args.columns !== null) {
      this.columns = Thrift.copyList(args.columns, [ttypes.TColumn]);
    }
    if (args.binaryColumns !== undefined && args.binaryColumns !== null) {
      this.binaryColumns = args.binaryColumns;
    }
    if (args.columnCount !== undefined && args.columnCount !== null) {
      this.columnCount = args.columnCount;
    }
  }
};
TRowSet.prototype = {};
TRowSet.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I64) {
        this.startRowOffset = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.LIST) {
        this.rows = [];
        var _rtmp377 = input.readListBegin();
        var _size76 = _rtmp377.size || 0;
        for (var _i78 = 0; _i78 < _size76; ++_i78) {
          var elem79 = null;
          elem79 = new ttypes.TRow();
          elem79.read(input);
          this.rows.push(elem79);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.LIST) {
        this.columns = [];
        var _rtmp381 = input.readListBegin();
        var _size80 = _rtmp381.size || 0;
        for (var _i82 = 0; _i82 < _size80; ++_i82) {
          var elem83 = null;
          elem83 = new ttypes.TColumn();
          elem83.read(input);
          this.columns.push(elem83);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.binaryColumns = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.I32) {
        this.columnCount = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TRowSet.prototype.write = function(output) {
  output.writeStructBegin('TRowSet');
  if (this.startRowOffset !== null && this.startRowOffset !== undefined) {
    output.writeFieldBegin('startRowOffset', Thrift.Type.I64, 1);
    output.writeI64(this.startRowOffset);
    output.writeFieldEnd();
  }
  if (this.rows !== null && this.rows !== undefined) {
    output.writeFieldBegin('rows', Thrift.Type.LIST, 2);
    output.writeListBegin(Thrift.Type.STRUCT, this.rows.length);
    for (var iter84 in this.rows) {
      if (this.rows.hasOwnProperty(iter84)) {
        iter84 = this.rows[iter84];
        iter84.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.columns !== null && this.columns !== undefined) {
    output.writeFieldBegin('columns', Thrift.Type.LIST, 3);
    output.writeListBegin(Thrift.Type.STRUCT, this.columns.length);
    for (var iter85 in this.columns) {
      if (this.columns.hasOwnProperty(iter85)) {
        iter85 = this.columns[iter85];
        iter85.write(output);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.binaryColumns !== null && this.binaryColumns !== undefined) {
    output.writeFieldBegin('binaryColumns', Thrift.Type.STRING, 4);
    output.writeBinary(this.binaryColumns);
    output.writeFieldEnd();
  }
  if (this.columnCount !== null && this.columnCount !== undefined) {
    output.writeFieldBegin('columnCount', Thrift.Type.I32, 5);
    output.writeI32(this.columnCount);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TStatus = module.exports.TStatus = function(args) {
  this.statusCode = null;
  this.infoMessages = null;
  this.sqlState = null;
  this.errorCode = null;
  this.errorMessage = null;
  if (args) {
    if (args.statusCode !== undefined && args.statusCode !== null) {
      this.statusCode = args.statusCode;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statusCode is unset!');
    }
    if (args.infoMessages !== undefined && args.infoMessages !== null) {
      this.infoMessages = Thrift.copyList(args.infoMessages, [null]);
    }
    if (args.sqlState !== undefined && args.sqlState !== null) {
      this.sqlState = args.sqlState;
    }
    if (args.errorCode !== undefined && args.errorCode !== null) {
      this.errorCode = args.errorCode;
    }
    if (args.errorMessage !== undefined && args.errorMessage !== null) {
      this.errorMessage = args.errorMessage;
    }
  }
};
TStatus.prototype = {};
TStatus.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.statusCode = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.LIST) {
        this.infoMessages = [];
        var _rtmp387 = input.readListBegin();
        var _size86 = _rtmp387.size || 0;
        for (var _i88 = 0; _i88 < _size86; ++_i88) {
          var elem89 = null;
          elem89 = input.readString();
          this.infoMessages.push(elem89);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.sqlState = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.I32) {
        this.errorCode = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.errorMessage = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TStatus.prototype.write = function(output) {
  output.writeStructBegin('TStatus');
  if (this.statusCode !== null && this.statusCode !== undefined) {
    output.writeFieldBegin('statusCode', Thrift.Type.I32, 1);
    output.writeI32(this.statusCode);
    output.writeFieldEnd();
  }
  if (this.infoMessages !== null && this.infoMessages !== undefined) {
    output.writeFieldBegin('infoMessages', Thrift.Type.LIST, 2);
    output.writeListBegin(Thrift.Type.STRING, this.infoMessages.length);
    for (var iter90 in this.infoMessages) {
      if (this.infoMessages.hasOwnProperty(iter90)) {
        iter90 = this.infoMessages[iter90];
        output.writeString(iter90);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.sqlState !== null && this.sqlState !== undefined) {
    output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3);
    output.writeString(this.sqlState);
    output.writeFieldEnd();
  }
  if (this.errorCode !== null && this.errorCode !== undefined) {
    output.writeFieldBegin('errorCode', Thrift.Type.I32, 4);
    output.writeI32(this.errorCode);
    output.writeFieldEnd();
  }
  if (this.errorMessage !== null && this.errorMessage !== undefined) {
    output.writeFieldBegin('errorMessage', Thrift.Type.STRING, 5);
    output.writeString(this.errorMessage);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var THandleIdentifier = module.exports.THandleIdentifier = function(args) {
  this.guid = null;
  this.secret = null;
  if (args) {
    if (args.guid !== undefined && args.guid !== null) {
      this.guid = args.guid;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field guid is unset!');
    }
    if (args.secret !== undefined && args.secret !== null) {
      this.secret = args.secret;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field secret is unset!');
    }
  }
};
THandleIdentifier.prototype = {};
THandleIdentifier.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.guid = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.secret = input.readBinary();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

THandleIdentifier.prototype.write = function(output) {
  output.writeStructBegin('THandleIdentifier');
  if (this.guid !== null && this.guid !== undefined) {
    output.writeFieldBegin('guid', Thrift.Type.STRING, 1);
    output.writeBinary(this.guid);
    output.writeFieldEnd();
  }
  if (this.secret !== null && this.secret !== undefined) {
    output.writeFieldBegin('secret', Thrift.Type.STRING, 2);
    output.writeBinary(this.secret);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TSessionHandle = module.exports.TSessionHandle = function(args) {
  this.sessionId = null;
  if (args) {
    if (args.sessionId !== undefined && args.sessionId !== null) {
      this.sessionId = new ttypes.THandleIdentifier(args.sessionId);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionId is unset!');
    }
  }
};
TSessionHandle.prototype = {};
TSessionHandle.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionId = new ttypes.THandleIdentifier();
        this.sessionId.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TSessionHandle.prototype.write = function(output) {
  output.writeStructBegin('TSessionHandle');
  if (this.sessionId !== null && this.sessionId !== undefined) {
    output.writeFieldBegin('sessionId', Thrift.Type.STRUCT, 1);
    this.sessionId.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TOperationHandle = module.exports.TOperationHandle = function(args) {
  this.operationId = null;
  this.operationType = null;
  this.hasResultSet = null;
  this.modifiedRowCount = null;
  if (args) {
    if (args.operationId !== undefined && args.operationId !== null) {
      this.operationId = new ttypes.THandleIdentifier(args.operationId);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationId is unset!');
    }
    if (args.operationType !== undefined && args.operationType !== null) {
      this.operationType = args.operationType;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationType is unset!');
    }
    if (args.hasResultSet !== undefined && args.hasResultSet !== null) {
      this.hasResultSet = args.hasResultSet;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hasResultSet is unset!');
    }
    if (args.modifiedRowCount !== undefined && args.modifiedRowCount !== null) {
      this.modifiedRowCount = args.modifiedRowCount;
    }
  }
};
TOperationHandle.prototype = {};
TOperationHandle.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationId = new ttypes.THandleIdentifier();
        this.operationId.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.operationType = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.BOOL) {
        this.hasResultSet = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.DOUBLE) {
        this.modifiedRowCount = input.readDouble();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TOperationHandle.prototype.write = function(output) {
  output.writeStructBegin('TOperationHandle');
  if (this.operationId !== null && this.operationId !== undefined) {
    output.writeFieldBegin('operationId', Thrift.Type.STRUCT, 1);
    this.operationId.write(output);
    output.writeFieldEnd();
  }
  if (this.operationType !== null && this.operationType !== undefined) {
    output.writeFieldBegin('operationType', Thrift.Type.I32, 2);
    output.writeI32(this.operationType);
    output.writeFieldEnd();
  }
  if (this.hasResultSet !== null && this.hasResultSet !== undefined) {
    output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 3);
    output.writeBool(this.hasResultSet);
    output.writeFieldEnd();
  }
  if (this.modifiedRowCount !== null && this.modifiedRowCount !== undefined) {
    output.writeFieldBegin('modifiedRowCount', Thrift.Type.DOUBLE, 4);
    output.writeDouble(this.modifiedRowCount);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TOpenSessionReq = module.exports.TOpenSessionReq = function(args) {
  this.client_protocol = 9;
  this.username = null;
  this.password = null;
  this.configuration = null;
  if (args) {
    if (args.client_protocol !== undefined && args.client_protocol !== null) {
      this.client_protocol = args.client_protocol;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field client_protocol is unset!');
    }
    if (args.username !== undefined && args.username !== null) {
      this.username = args.username;
    }
    if (args.password !== undefined && args.password !== null) {
      this.password = args.password;
    }
    if (args.configuration !== undefined && args.configuration !== null) {
      this.configuration = Thrift.copyMap(args.configuration, [null]);
    }
  }
};
TOpenSessionReq.prototype = {};
TOpenSessionReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.I32) {
        this.client_protocol = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.username = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.password = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.MAP) {
        this.configuration = {};
        var _rtmp392 = input.readMapBegin();
        var _size91 = _rtmp392.size || 0;
        for (var _i93 = 0; _i93 < _size91; ++_i93) {
          var key94 = null;
          var val95 = null;
          key94 = input.readString();
          val95 = input.readString();
          this.configuration[key94] = val95;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TOpenSessionReq.prototype.write = function(output) {
  output.writeStructBegin('TOpenSessionReq');
  if (this.client_protocol !== null && this.client_protocol !== undefined) {
    output.writeFieldBegin('client_protocol', Thrift.Type.I32, 1);
    output.writeI32(this.client_protocol);
    output.writeFieldEnd();
  }
  if (this.username !== null && this.username !== undefined) {
    output.writeFieldBegin('username', Thrift.Type.STRING, 2);
    output.writeString(this.username);
    output.writeFieldEnd();
  }
  if (this.password !== null && this.password !== undefined) {
    output.writeFieldBegin('password', Thrift.Type.STRING, 3);
    output.writeString(this.password);
    output.writeFieldEnd();
  }
  if (this.configuration !== null && this.configuration !== undefined) {
    output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));
    for (var kiter96 in this.configuration) {
      if (this.configuration.hasOwnProperty(kiter96)) {
        var viter97 = this.configuration[kiter96];
        output.writeString(kiter96);
        output.writeString(viter97);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TOpenSessionResp = module.exports.TOpenSessionResp = function(args) {
  this.status = null;
  this.serverProtocolVersion = 9;
  this.sessionHandle = null;
  this.configuration = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.serverProtocolVersion !== undefined && args.serverProtocolVersion !== null) {
      this.serverProtocolVersion = args.serverProtocolVersion;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field serverProtocolVersion is unset!');
    }
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    }
    if (args.configuration !== undefined && args.configuration !== null) {
      this.configuration = Thrift.copyMap(args.configuration, [null]);
    }
  }
};
TOpenSessionResp.prototype = {};
TOpenSessionResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.serverProtocolVersion = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.MAP) {
        this.configuration = {};
        var _rtmp399 = input.readMapBegin();
        var _size98 = _rtmp399.size || 0;
        for (var _i100 = 0; _i100 < _size98; ++_i100) {
          var key101 = null;
          var val102 = null;
          key101 = input.readString();
          val102 = input.readString();
          this.configuration[key101] = val102;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TOpenSessionResp.prototype.write = function(output) {
  output.writeStructBegin('TOpenSessionResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.serverProtocolVersion !== null && this.serverProtocolVersion !== undefined) {
    output.writeFieldBegin('serverProtocolVersion', Thrift.Type.I32, 2);
    output.writeI32(this.serverProtocolVersion);
    output.writeFieldEnd();
  }
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 3);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.configuration !== null && this.configuration !== undefined) {
    output.writeFieldBegin('configuration', Thrift.Type.MAP, 4);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.configuration));
    for (var kiter103 in this.configuration) {
      if (this.configuration.hasOwnProperty(kiter103)) {
        var viter104 = this.configuration[kiter103];
        output.writeString(kiter103);
        output.writeString(viter104);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCloseSessionReq = module.exports.TCloseSessionReq = function(args) {
  this.sessionHandle = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
  }
};
TCloseSessionReq.prototype = {};
TCloseSessionReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCloseSessionReq.prototype.write = function(output) {
  output.writeStructBegin('TCloseSessionReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCloseSessionResp = module.exports.TCloseSessionResp = function(args) {
  this.status = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
  }
};
TCloseSessionResp.prototype = {};
TCloseSessionResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCloseSessionResp.prototype.write = function(output) {
  output.writeStructBegin('TCloseSessionResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetInfoValue = module.exports.TGetInfoValue = function(args) {
  this.stringValue = null;
  this.smallIntValue = null;
  this.integerBitmask = null;
  this.integerFlag = null;
  this.binaryValue = null;
  this.lenValue = null;
  if (args) {
    if (args.stringValue !== undefined && args.stringValue !== null) {
      this.stringValue = args.stringValue;
    }
    if (args.smallIntValue !== undefined && args.smallIntValue !== null) {
      this.smallIntValue = args.smallIntValue;
    }
    if (args.integerBitmask !== undefined && args.integerBitmask !== null) {
      this.integerBitmask = args.integerBitmask;
    }
    if (args.integerFlag !== undefined && args.integerFlag !== null) {
      this.integerFlag = args.integerFlag;
    }
    if (args.binaryValue !== undefined && args.binaryValue !== null) {
      this.binaryValue = args.binaryValue;
    }
    if (args.lenValue !== undefined && args.lenValue !== null) {
      this.lenValue = args.lenValue;
    }
  }
};
TGetInfoValue.prototype = {};
TGetInfoValue.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRING) {
        this.stringValue = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I16) {
        this.smallIntValue = input.readI16();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I32) {
        this.integerBitmask = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.I32) {
        this.integerFlag = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.I32) {
        this.binaryValue = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.I64) {
        this.lenValue = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetInfoValue.prototype.write = function(output) {
  output.writeStructBegin('TGetInfoValue');
  if (this.stringValue !== null && this.stringValue !== undefined) {
    output.writeFieldBegin('stringValue', Thrift.Type.STRING, 1);
    output.writeString(this.stringValue);
    output.writeFieldEnd();
  }
  if (this.smallIntValue !== null && this.smallIntValue !== undefined) {
    output.writeFieldBegin('smallIntValue', Thrift.Type.I16, 2);
    output.writeI16(this.smallIntValue);
    output.writeFieldEnd();
  }
  if (this.integerBitmask !== null && this.integerBitmask !== undefined) {
    output.writeFieldBegin('integerBitmask', Thrift.Type.I32, 3);
    output.writeI32(this.integerBitmask);
    output.writeFieldEnd();
  }
  if (this.integerFlag !== null && this.integerFlag !== undefined) {
    output.writeFieldBegin('integerFlag', Thrift.Type.I32, 4);
    output.writeI32(this.integerFlag);
    output.writeFieldEnd();
  }
  if (this.binaryValue !== null && this.binaryValue !== undefined) {
    output.writeFieldBegin('binaryValue', Thrift.Type.I32, 5);
    output.writeI32(this.binaryValue);
    output.writeFieldEnd();
  }
  if (this.lenValue !== null && this.lenValue !== undefined) {
    output.writeFieldBegin('lenValue', Thrift.Type.I64, 6);
    output.writeI64(this.lenValue);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetInfoReq = module.exports.TGetInfoReq = function(args) {
  this.sessionHandle = null;
  this.infoType = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.infoType !== undefined && args.infoType !== null) {
      this.infoType = args.infoType;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field infoType is unset!');
    }
  }
};
TGetInfoReq.prototype = {};
TGetInfoReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.infoType = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetInfoReq.prototype.write = function(output) {
  output.writeStructBegin('TGetInfoReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.infoType !== null && this.infoType !== undefined) {
    output.writeFieldBegin('infoType', Thrift.Type.I32, 2);
    output.writeI32(this.infoType);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetInfoResp = module.exports.TGetInfoResp = function(args) {
  this.status = null;
  this.infoValue = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.infoValue !== undefined && args.infoValue !== null) {
      this.infoValue = new ttypes.TGetInfoValue(args.infoValue);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field infoValue is unset!');
    }
  }
};
TGetInfoResp.prototype = {};
TGetInfoResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.infoValue = new ttypes.TGetInfoValue();
        this.infoValue.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetInfoResp.prototype.write = function(output) {
  output.writeStructBegin('TGetInfoResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.infoValue !== null && this.infoValue !== undefined) {
    output.writeFieldBegin('infoValue', Thrift.Type.STRUCT, 2);
    this.infoValue.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TExecuteStatementReq = module.exports.TExecuteStatementReq = function(args) {
  this.sessionHandle = null;
  this.statement = null;
  this.confOverlay = null;
  this.runAsync = false;
  this.queryTimeout = 0;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.statement !== undefined && args.statement !== null) {
      this.statement = args.statement;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field statement is unset!');
    }
    if (args.confOverlay !== undefined && args.confOverlay !== null) {
      this.confOverlay = Thrift.copyMap(args.confOverlay, [null]);
    }
    if (args.runAsync !== undefined && args.runAsync !== null) {
      this.runAsync = args.runAsync;
    }
    if (args.queryTimeout !== undefined && args.queryTimeout !== null) {
      this.queryTimeout = args.queryTimeout;
    }
  }
};
TExecuteStatementReq.prototype = {};
TExecuteStatementReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.statement = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.MAP) {
        this.confOverlay = {};
        var _rtmp3106 = input.readMapBegin();
        var _size105 = _rtmp3106.size || 0;
        for (var _i107 = 0; _i107 < _size105; ++_i107) {
          var key108 = null;
          var val109 = null;
          key108 = input.readString();
          val109 = input.readString();
          this.confOverlay[key108] = val109;
        }
        input.readMapEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.BOOL) {
        this.runAsync = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.I64) {
        this.queryTimeout = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TExecuteStatementReq.prototype.write = function(output) {
  output.writeStructBegin('TExecuteStatementReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.statement !== null && this.statement !== undefined) {
    output.writeFieldBegin('statement', Thrift.Type.STRING, 2);
    output.writeString(this.statement);
    output.writeFieldEnd();
  }
  if (this.confOverlay !== null && this.confOverlay !== undefined) {
    output.writeFieldBegin('confOverlay', Thrift.Type.MAP, 3);
    output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.STRING, Thrift.objectLength(this.confOverlay));
    for (var kiter110 in this.confOverlay) {
      if (this.confOverlay.hasOwnProperty(kiter110)) {
        var viter111 = this.confOverlay[kiter110];
        output.writeString(kiter110);
        output.writeString(viter111);
      }
    }
    output.writeMapEnd();
    output.writeFieldEnd();
  }
  if (this.runAsync !== null && this.runAsync !== undefined) {
    output.writeFieldBegin('runAsync', Thrift.Type.BOOL, 4);
    output.writeBool(this.runAsync);
    output.writeFieldEnd();
  }
  if (this.queryTimeout !== null && this.queryTimeout !== undefined) {
    output.writeFieldBegin('queryTimeout', Thrift.Type.I64, 5);
    output.writeI64(this.queryTimeout);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TExecuteStatementResp = module.exports.TExecuteStatementResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TExecuteStatementResp.prototype = {};
TExecuteStatementResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TExecuteStatementResp.prototype.write = function(output) {
  output.writeStructBegin('TExecuteStatementResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTypeInfoReq = module.exports.TGetTypeInfoReq = function(args) {
  this.sessionHandle = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
  }
};
TGetTypeInfoReq.prototype = {};
TGetTypeInfoReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTypeInfoReq.prototype.write = function(output) {
  output.writeStructBegin('TGetTypeInfoReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTypeInfoResp = module.exports.TGetTypeInfoResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetTypeInfoResp.prototype = {};
TGetTypeInfoResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTypeInfoResp.prototype.write = function(output) {
  output.writeStructBegin('TGetTypeInfoResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetCatalogsReq = module.exports.TGetCatalogsReq = function(args) {
  this.sessionHandle = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
  }
};
TGetCatalogsReq.prototype = {};
TGetCatalogsReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetCatalogsReq.prototype.write = function(output) {
  output.writeStructBegin('TGetCatalogsReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetCatalogsResp = module.exports.TGetCatalogsResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetCatalogsResp.prototype = {};
TGetCatalogsResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetCatalogsResp.prototype.write = function(output) {
  output.writeStructBegin('TGetCatalogsResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetSchemasReq = module.exports.TGetSchemasReq = function(args) {
  this.sessionHandle = null;
  this.catalogName = null;
  this.schemaName = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.catalogName !== undefined && args.catalogName !== null) {
      this.catalogName = args.catalogName;
    }
    if (args.schemaName !== undefined && args.schemaName !== null) {
      this.schemaName = args.schemaName;
    }
  }
};
TGetSchemasReq.prototype = {};
TGetSchemasReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.catalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.schemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetSchemasReq.prototype.write = function(output) {
  output.writeStructBegin('TGetSchemasReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.catalogName !== null && this.catalogName !== undefined) {
    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
    output.writeString(this.catalogName);
    output.writeFieldEnd();
  }
  if (this.schemaName !== null && this.schemaName !== undefined) {
    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
    output.writeString(this.schemaName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetSchemasResp = module.exports.TGetSchemasResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetSchemasResp.prototype = {};
TGetSchemasResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetSchemasResp.prototype.write = function(output) {
  output.writeStructBegin('TGetSchemasResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTablesReq = module.exports.TGetTablesReq = function(args) {
  this.sessionHandle = null;
  this.catalogName = null;
  this.schemaName = null;
  this.tableName = null;
  this.tableTypes = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.catalogName !== undefined && args.catalogName !== null) {
      this.catalogName = args.catalogName;
    }
    if (args.schemaName !== undefined && args.schemaName !== null) {
      this.schemaName = args.schemaName;
    }
    if (args.tableName !== undefined && args.tableName !== null) {
      this.tableName = args.tableName;
    }
    if (args.tableTypes !== undefined && args.tableTypes !== null) {
      this.tableTypes = Thrift.copyList(args.tableTypes, [null]);
    }
  }
};
TGetTablesReq.prototype = {};
TGetTablesReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.catalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.schemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.tableName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.LIST) {
        this.tableTypes = [];
        var _rtmp3113 = input.readListBegin();
        var _size112 = _rtmp3113.size || 0;
        for (var _i114 = 0; _i114 < _size112; ++_i114) {
          var elem115 = null;
          elem115 = input.readString();
          this.tableTypes.push(elem115);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTablesReq.prototype.write = function(output) {
  output.writeStructBegin('TGetTablesReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.catalogName !== null && this.catalogName !== undefined) {
    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
    output.writeString(this.catalogName);
    output.writeFieldEnd();
  }
  if (this.schemaName !== null && this.schemaName !== undefined) {
    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
    output.writeString(this.schemaName);
    output.writeFieldEnd();
  }
  if (this.tableName !== null && this.tableName !== undefined) {
    output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);
    output.writeString(this.tableName);
    output.writeFieldEnd();
  }
  if (this.tableTypes !== null && this.tableTypes !== undefined) {
    output.writeFieldBegin('tableTypes', Thrift.Type.LIST, 5);
    output.writeListBegin(Thrift.Type.STRING, this.tableTypes.length);
    for (var iter116 in this.tableTypes) {
      if (this.tableTypes.hasOwnProperty(iter116)) {
        iter116 = this.tableTypes[iter116];
        output.writeString(iter116);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTablesResp = module.exports.TGetTablesResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetTablesResp.prototype = {};
TGetTablesResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTablesResp.prototype.write = function(output) {
  output.writeStructBegin('TGetTablesResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTableTypesReq = module.exports.TGetTableTypesReq = function(args) {
  this.sessionHandle = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
  }
};
TGetTableTypesReq.prototype = {};
TGetTableTypesReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTableTypesReq.prototype.write = function(output) {
  output.writeStructBegin('TGetTableTypesReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetTableTypesResp = module.exports.TGetTableTypesResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetTableTypesResp.prototype = {};
TGetTableTypesResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetTableTypesResp.prototype.write = function(output) {
  output.writeStructBegin('TGetTableTypesResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetColumnsReq = module.exports.TGetColumnsReq = function(args) {
  this.sessionHandle = null;
  this.catalogName = null;
  this.schemaName = null;
  this.tableName = null;
  this.columnName = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.catalogName !== undefined && args.catalogName !== null) {
      this.catalogName = args.catalogName;
    }
    if (args.schemaName !== undefined && args.schemaName !== null) {
      this.schemaName = args.schemaName;
    }
    if (args.tableName !== undefined && args.tableName !== null) {
      this.tableName = args.tableName;
    }
    if (args.columnName !== undefined && args.columnName !== null) {
      this.columnName = args.columnName;
    }
  }
};
TGetColumnsReq.prototype = {};
TGetColumnsReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.catalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.schemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.tableName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.columnName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetColumnsReq.prototype.write = function(output) {
  output.writeStructBegin('TGetColumnsReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.catalogName !== null && this.catalogName !== undefined) {
    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
    output.writeString(this.catalogName);
    output.writeFieldEnd();
  }
  if (this.schemaName !== null && this.schemaName !== undefined) {
    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
    output.writeString(this.schemaName);
    output.writeFieldEnd();
  }
  if (this.tableName !== null && this.tableName !== undefined) {
    output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);
    output.writeString(this.tableName);
    output.writeFieldEnd();
  }
  if (this.columnName !== null && this.columnName !== undefined) {
    output.writeFieldBegin('columnName', Thrift.Type.STRING, 5);
    output.writeString(this.columnName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetColumnsResp = module.exports.TGetColumnsResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetColumnsResp.prototype = {};
TGetColumnsResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetColumnsResp.prototype.write = function(output) {
  output.writeStructBegin('TGetColumnsResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetFunctionsReq = module.exports.TGetFunctionsReq = function(args) {
  this.sessionHandle = null;
  this.catalogName = null;
  this.schemaName = null;
  this.functionName = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.catalogName !== undefined && args.catalogName !== null) {
      this.catalogName = args.catalogName;
    }
    if (args.schemaName !== undefined && args.schemaName !== null) {
      this.schemaName = args.schemaName;
    }
    if (args.functionName !== undefined && args.functionName !== null) {
      this.functionName = args.functionName;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field functionName is unset!');
    }
  }
};
TGetFunctionsReq.prototype = {};
TGetFunctionsReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.catalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.schemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.functionName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetFunctionsReq.prototype.write = function(output) {
  output.writeStructBegin('TGetFunctionsReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.catalogName !== null && this.catalogName !== undefined) {
    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
    output.writeString(this.catalogName);
    output.writeFieldEnd();
  }
  if (this.schemaName !== null && this.schemaName !== undefined) {
    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
    output.writeString(this.schemaName);
    output.writeFieldEnd();
  }
  if (this.functionName !== null && this.functionName !== undefined) {
    output.writeFieldBegin('functionName', Thrift.Type.STRING, 4);
    output.writeString(this.functionName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetFunctionsResp = module.exports.TGetFunctionsResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetFunctionsResp.prototype = {};
TGetFunctionsResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetFunctionsResp.prototype.write = function(output) {
  output.writeStructBegin('TGetFunctionsResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetPrimaryKeysReq = module.exports.TGetPrimaryKeysReq = function(args) {
  this.sessionHandle = null;
  this.catalogName = null;
  this.schemaName = null;
  this.tableName = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.catalogName !== undefined && args.catalogName !== null) {
      this.catalogName = args.catalogName;
    }
    if (args.schemaName !== undefined && args.schemaName !== null) {
      this.schemaName = args.schemaName;
    }
    if (args.tableName !== undefined && args.tableName !== null) {
      this.tableName = args.tableName;
    }
  }
};
TGetPrimaryKeysReq.prototype = {};
TGetPrimaryKeysReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.catalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.schemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.tableName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetPrimaryKeysReq.prototype.write = function(output) {
  output.writeStructBegin('TGetPrimaryKeysReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.catalogName !== null && this.catalogName !== undefined) {
    output.writeFieldBegin('catalogName', Thrift.Type.STRING, 2);
    output.writeString(this.catalogName);
    output.writeFieldEnd();
  }
  if (this.schemaName !== null && this.schemaName !== undefined) {
    output.writeFieldBegin('schemaName', Thrift.Type.STRING, 3);
    output.writeString(this.schemaName);
    output.writeFieldEnd();
  }
  if (this.tableName !== null && this.tableName !== undefined) {
    output.writeFieldBegin('tableName', Thrift.Type.STRING, 4);
    output.writeString(this.tableName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetPrimaryKeysResp = module.exports.TGetPrimaryKeysResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetPrimaryKeysResp.prototype = {};
TGetPrimaryKeysResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetPrimaryKeysResp.prototype.write = function(output) {
  output.writeStructBegin('TGetPrimaryKeysResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetCrossReferenceReq = module.exports.TGetCrossReferenceReq = function(args) {
  this.sessionHandle = null;
  this.parentCatalogName = null;
  this.parentSchemaName = null;
  this.parentTableName = null;
  this.foreignCatalogName = null;
  this.foreignSchemaName = null;
  this.foreignTableName = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.parentCatalogName !== undefined && args.parentCatalogName !== null) {
      this.parentCatalogName = args.parentCatalogName;
    }
    if (args.parentSchemaName !== undefined && args.parentSchemaName !== null) {
      this.parentSchemaName = args.parentSchemaName;
    }
    if (args.parentTableName !== undefined && args.parentTableName !== null) {
      this.parentTableName = args.parentTableName;
    }
    if (args.foreignCatalogName !== undefined && args.foreignCatalogName !== null) {
      this.foreignCatalogName = args.foreignCatalogName;
    }
    if (args.foreignSchemaName !== undefined && args.foreignSchemaName !== null) {
      this.foreignSchemaName = args.foreignSchemaName;
    }
    if (args.foreignTableName !== undefined && args.foreignTableName !== null) {
      this.foreignTableName = args.foreignTableName;
    }
  }
};
TGetCrossReferenceReq.prototype = {};
TGetCrossReferenceReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.parentCatalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.parentSchemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.STRING) {
        this.parentTableName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.foreignCatalogName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRING) {
        this.foreignSchemaName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.STRING) {
        this.foreignTableName = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetCrossReferenceReq.prototype.write = function(output) {
  output.writeStructBegin('TGetCrossReferenceReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.parentCatalogName !== null && this.parentCatalogName !== undefined) {
    output.writeFieldBegin('parentCatalogName', Thrift.Type.STRING, 2);
    output.writeString(this.parentCatalogName);
    output.writeFieldEnd();
  }
  if (this.parentSchemaName !== null && this.parentSchemaName !== undefined) {
    output.writeFieldBegin('parentSchemaName', Thrift.Type.STRING, 3);
    output.writeString(this.parentSchemaName);
    output.writeFieldEnd();
  }
  if (this.parentTableName !== null && this.parentTableName !== undefined) {
    output.writeFieldBegin('parentTableName', Thrift.Type.STRING, 4);
    output.writeString(this.parentTableName);
    output.writeFieldEnd();
  }
  if (this.foreignCatalogName !== null && this.foreignCatalogName !== undefined) {
    output.writeFieldBegin('foreignCatalogName', Thrift.Type.STRING, 5);
    output.writeString(this.foreignCatalogName);
    output.writeFieldEnd();
  }
  if (this.foreignSchemaName !== null && this.foreignSchemaName !== undefined) {
    output.writeFieldBegin('foreignSchemaName', Thrift.Type.STRING, 6);
    output.writeString(this.foreignSchemaName);
    output.writeFieldEnd();
  }
  if (this.foreignTableName !== null && this.foreignTableName !== undefined) {
    output.writeFieldBegin('foreignTableName', Thrift.Type.STRING, 7);
    output.writeString(this.foreignTableName);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetCrossReferenceResp = module.exports.TGetCrossReferenceResp = function(args) {
  this.status = null;
  this.operationHandle = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    }
  }
};
TGetCrossReferenceResp.prototype = {};
TGetCrossReferenceResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetCrossReferenceResp.prototype.write = function(output) {
  output.writeStructBegin('TGetCrossReferenceResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 2);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetOperationStatusReq = module.exports.TGetOperationStatusReq = function(args) {
  this.operationHandle = null;
  this.getProgressUpdate = null;
  if (args) {
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!');
    }
    if (args.getProgressUpdate !== undefined && args.getProgressUpdate !== null) {
      this.getProgressUpdate = args.getProgressUpdate;
    }
  }
};
TGetOperationStatusReq.prototype = {};
TGetOperationStatusReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.BOOL) {
        this.getProgressUpdate = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetOperationStatusReq.prototype.write = function(output) {
  output.writeStructBegin('TGetOperationStatusReq');
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.getProgressUpdate !== null && this.getProgressUpdate !== undefined) {
    output.writeFieldBegin('getProgressUpdate', Thrift.Type.BOOL, 2);
    output.writeBool(this.getProgressUpdate);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetOperationStatusResp = module.exports.TGetOperationStatusResp = function(args) {
  this.status = null;
  this.operationState = null;
  this.sqlState = null;
  this.errorCode = null;
  this.errorMessage = null;
  this.taskStatus = null;
  this.operationStarted = null;
  this.operationCompleted = null;
  this.hasResultSet = null;
  this.progressUpdateResponse = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.operationState !== undefined && args.operationState !== null) {
      this.operationState = args.operationState;
    }
    if (args.sqlState !== undefined && args.sqlState !== null) {
      this.sqlState = args.sqlState;
    }
    if (args.errorCode !== undefined && args.errorCode !== null) {
      this.errorCode = args.errorCode;
    }
    if (args.errorMessage !== undefined && args.errorMessage !== null) {
      this.errorMessage = args.errorMessage;
    }
    if (args.taskStatus !== undefined && args.taskStatus !== null) {
      this.taskStatus = args.taskStatus;
    }
    if (args.operationStarted !== undefined && args.operationStarted !== null) {
      this.operationStarted = args.operationStarted;
    }
    if (args.operationCompleted !== undefined && args.operationCompleted !== null) {
      this.operationCompleted = args.operationCompleted;
    }
    if (args.hasResultSet !== undefined && args.hasResultSet !== null) {
      this.hasResultSet = args.hasResultSet;
    }
    if (args.progressUpdateResponse !== undefined && args.progressUpdateResponse !== null) {
      this.progressUpdateResponse = new ttypes.TProgressUpdateResp(args.progressUpdateResponse);
    }
  }
};
TGetOperationStatusResp.prototype = {};
TGetOperationStatusResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.operationState = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.sqlState = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.I32) {
        this.errorCode = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.errorMessage = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.STRING) {
        this.taskStatus = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 7:
      if (ftype == Thrift.Type.I64) {
        this.operationStarted = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 8:
      if (ftype == Thrift.Type.I64) {
        this.operationCompleted = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 9:
      if (ftype == Thrift.Type.BOOL) {
        this.hasResultSet = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 10:
      if (ftype == Thrift.Type.STRUCT) {
        this.progressUpdateResponse = new ttypes.TProgressUpdateResp();
        this.progressUpdateResponse.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetOperationStatusResp.prototype.write = function(output) {
  output.writeStructBegin('TGetOperationStatusResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.operationState !== null && this.operationState !== undefined) {
    output.writeFieldBegin('operationState', Thrift.Type.I32, 2);
    output.writeI32(this.operationState);
    output.writeFieldEnd();
  }
  if (this.sqlState !== null && this.sqlState !== undefined) {
    output.writeFieldBegin('sqlState', Thrift.Type.STRING, 3);
    output.writeString(this.sqlState);
    output.writeFieldEnd();
  }
  if (this.errorCode !== null && this.errorCode !== undefined) {
    output.writeFieldBegin('errorCode', Thrift.Type.I32, 4);
    output.writeI32(this.errorCode);
    output.writeFieldEnd();
  }
  if (this.errorMessage !== null && this.errorMessage !== undefined) {
    output.writeFieldBegin('errorMessage', Thrift.Type.STRING, 5);
    output.writeString(this.errorMessage);
    output.writeFieldEnd();
  }
  if (this.taskStatus !== null && this.taskStatus !== undefined) {
    output.writeFieldBegin('taskStatus', Thrift.Type.STRING, 6);
    output.writeString(this.taskStatus);
    output.writeFieldEnd();
  }
  if (this.operationStarted !== null && this.operationStarted !== undefined) {
    output.writeFieldBegin('operationStarted', Thrift.Type.I64, 7);
    output.writeI64(this.operationStarted);
    output.writeFieldEnd();
  }
  if (this.operationCompleted !== null && this.operationCompleted !== undefined) {
    output.writeFieldBegin('operationCompleted', Thrift.Type.I64, 8);
    output.writeI64(this.operationCompleted);
    output.writeFieldEnd();
  }
  if (this.hasResultSet !== null && this.hasResultSet !== undefined) {
    output.writeFieldBegin('hasResultSet', Thrift.Type.BOOL, 9);
    output.writeBool(this.hasResultSet);
    output.writeFieldEnd();
  }
  if (this.progressUpdateResponse !== null && this.progressUpdateResponse !== undefined) {
    output.writeFieldBegin('progressUpdateResponse', Thrift.Type.STRUCT, 10);
    this.progressUpdateResponse.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCancelOperationReq = module.exports.TCancelOperationReq = function(args) {
  this.operationHandle = null;
  if (args) {
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!');
    }
  }
};
TCancelOperationReq.prototype = {};
TCancelOperationReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCancelOperationReq.prototype.write = function(output) {
  output.writeStructBegin('TCancelOperationReq');
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCancelOperationResp = module.exports.TCancelOperationResp = function(args) {
  this.status = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
  }
};
TCancelOperationResp.prototype = {};
TCancelOperationResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCancelOperationResp.prototype.write = function(output) {
  output.writeStructBegin('TCancelOperationResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCloseOperationReq = module.exports.TCloseOperationReq = function(args) {
  this.operationHandle = null;
  if (args) {
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!');
    }
  }
};
TCloseOperationReq.prototype = {};
TCloseOperationReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCloseOperationReq.prototype.write = function(output) {
  output.writeStructBegin('TCloseOperationReq');
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCloseOperationResp = module.exports.TCloseOperationResp = function(args) {
  this.status = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
  }
};
TCloseOperationResp.prototype = {};
TCloseOperationResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCloseOperationResp.prototype.write = function(output) {
  output.writeStructBegin('TCloseOperationResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetResultSetMetadataReq = module.exports.TGetResultSetMetadataReq = function(args) {
  this.operationHandle = null;
  if (args) {
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!');
    }
  }
};
TGetResultSetMetadataReq.prototype = {};
TGetResultSetMetadataReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetResultSetMetadataReq.prototype.write = function(output) {
  output.writeStructBegin('TGetResultSetMetadataReq');
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetResultSetMetadataResp = module.exports.TGetResultSetMetadataResp = function(args) {
  this.status = null;
  this.schema = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.schema !== undefined && args.schema !== null) {
      this.schema = new ttypes.TTableSchema(args.schema);
    }
  }
};
TGetResultSetMetadataResp.prototype = {};
TGetResultSetMetadataResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRUCT) {
        this.schema = new ttypes.TTableSchema();
        this.schema.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetResultSetMetadataResp.prototype.write = function(output) {
  output.writeStructBegin('TGetResultSetMetadataResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.schema !== null && this.schema !== undefined) {
    output.writeFieldBegin('schema', Thrift.Type.STRUCT, 2);
    this.schema.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TFetchResultsReq = module.exports.TFetchResultsReq = function(args) {
  this.operationHandle = null;
  this.orientation = 0;
  this.maxRows = null;
  this.fetchType = 0;
  if (args) {
    if (args.operationHandle !== undefined && args.operationHandle !== null) {
      this.operationHandle = new ttypes.TOperationHandle(args.operationHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field operationHandle is unset!');
    }
    if (args.orientation !== undefined && args.orientation !== null) {
      this.orientation = args.orientation;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field orientation is unset!');
    }
    if (args.maxRows !== undefined && args.maxRows !== null) {
      this.maxRows = args.maxRows;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field maxRows is unset!');
    }
    if (args.fetchType !== undefined && args.fetchType !== null) {
      this.fetchType = args.fetchType;
    }
  }
};
TFetchResultsReq.prototype = {};
TFetchResultsReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.operationHandle = new ttypes.TOperationHandle();
        this.operationHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.I32) {
        this.orientation = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.I64) {
        this.maxRows = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.I16) {
        this.fetchType = input.readI16();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TFetchResultsReq.prototype.write = function(output) {
  output.writeStructBegin('TFetchResultsReq');
  if (this.operationHandle !== null && this.operationHandle !== undefined) {
    output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
    this.operationHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.orientation !== null && this.orientation !== undefined) {
    output.writeFieldBegin('orientation', Thrift.Type.I32, 2);
    output.writeI32(this.orientation);
    output.writeFieldEnd();
  }
  if (this.maxRows !== null && this.maxRows !== undefined) {
    output.writeFieldBegin('maxRows', Thrift.Type.I64, 3);
    output.writeI64(this.maxRows);
    output.writeFieldEnd();
  }
  if (this.fetchType !== null && this.fetchType !== undefined) {
    output.writeFieldBegin('fetchType', Thrift.Type.I16, 4);
    output.writeI16(this.fetchType);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TFetchResultsResp = module.exports.TFetchResultsResp = function(args) {
  this.status = null;
  this.hasMoreRows = null;
  this.results = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.hasMoreRows !== undefined && args.hasMoreRows !== null) {
      this.hasMoreRows = args.hasMoreRows;
    }
    if (args.results !== undefined && args.results !== null) {
      this.results = new ttypes.TRowSet(args.results);
    }
  }
};
TFetchResultsResp.prototype = {};
TFetchResultsResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.BOOL) {
        this.hasMoreRows = input.readBool();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRUCT) {
        this.results = new ttypes.TRowSet();
        this.results.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TFetchResultsResp.prototype.write = function(output) {
  output.writeStructBegin('TFetchResultsResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.hasMoreRows !== null && this.hasMoreRows !== undefined) {
    output.writeFieldBegin('hasMoreRows', Thrift.Type.BOOL, 2);
    output.writeBool(this.hasMoreRows);
    output.writeFieldEnd();
  }
  if (this.results !== null && this.results !== undefined) {
    output.writeFieldBegin('results', Thrift.Type.STRUCT, 3);
    this.results.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetDelegationTokenReq = module.exports.TGetDelegationTokenReq = function(args) {
  this.sessionHandle = null;
  this.owner = null;
  this.renewer = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.owner !== undefined && args.owner !== null) {
      this.owner = args.owner;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field owner is unset!');
    }
    if (args.renewer !== undefined && args.renewer !== null) {
      this.renewer = args.renewer;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field renewer is unset!');
    }
  }
};
TGetDelegationTokenReq.prototype = {};
TGetDelegationTokenReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.owner = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.STRING) {
        this.renewer = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetDelegationTokenReq.prototype.write = function(output) {
  output.writeStructBegin('TGetDelegationTokenReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.owner !== null && this.owner !== undefined) {
    output.writeFieldBegin('owner', Thrift.Type.STRING, 2);
    output.writeString(this.owner);
    output.writeFieldEnd();
  }
  if (this.renewer !== null && this.renewer !== undefined) {
    output.writeFieldBegin('renewer', Thrift.Type.STRING, 3);
    output.writeString(this.renewer);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TGetDelegationTokenResp = module.exports.TGetDelegationTokenResp = function(args) {
  this.status = null;
  this.delegationToken = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.delegationToken !== undefined && args.delegationToken !== null) {
      this.delegationToken = args.delegationToken;
    }
  }
};
TGetDelegationTokenResp.prototype = {};
TGetDelegationTokenResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.delegationToken = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TGetDelegationTokenResp.prototype.write = function(output) {
  output.writeStructBegin('TGetDelegationTokenResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  if (this.delegationToken !== null && this.delegationToken !== undefined) {
    output.writeFieldBegin('delegationToken', Thrift.Type.STRING, 2);
    output.writeString(this.delegationToken);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCancelDelegationTokenReq = module.exports.TCancelDelegationTokenReq = function(args) {
  this.sessionHandle = null;
  this.delegationToken = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.delegationToken !== undefined && args.delegationToken !== null) {
      this.delegationToken = args.delegationToken;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field delegationToken is unset!');
    }
  }
};
TCancelDelegationTokenReq.prototype = {};
TCancelDelegationTokenReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.delegationToken = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCancelDelegationTokenReq.prototype.write = function(output) {
  output.writeStructBegin('TCancelDelegationTokenReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.delegationToken !== null && this.delegationToken !== undefined) {
    output.writeFieldBegin('delegationToken', Thrift.Type.STRING, 2);
    output.writeString(this.delegationToken);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TCancelDelegationTokenResp = module.exports.TCancelDelegationTokenResp = function(args) {
  this.status = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
  }
};
TCancelDelegationTokenResp.prototype = {};
TCancelDelegationTokenResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TCancelDelegationTokenResp.prototype.write = function(output) {
  output.writeStructBegin('TCancelDelegationTokenResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TRenewDelegationTokenReq = module.exports.TRenewDelegationTokenReq = function(args) {
  this.sessionHandle = null;
  this.delegationToken = null;
  if (args) {
    if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
      this.sessionHandle = new ttypes.TSessionHandle(args.sessionHandle);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field sessionHandle is unset!');
    }
    if (args.delegationToken !== undefined && args.delegationToken !== null) {
      this.delegationToken = args.delegationToken;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field delegationToken is unset!');
    }
  }
};
TRenewDelegationTokenReq.prototype = {};
TRenewDelegationTokenReq.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.sessionHandle = new ttypes.TSessionHandle();
        this.sessionHandle.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.STRING) {
        this.delegationToken = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TRenewDelegationTokenReq.prototype.write = function(output) {
  output.writeStructBegin('TRenewDelegationTokenReq');
  if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
    output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 1);
    this.sessionHandle.write(output);
    output.writeFieldEnd();
  }
  if (this.delegationToken !== null && this.delegationToken !== undefined) {
    output.writeFieldBegin('delegationToken', Thrift.Type.STRING, 2);
    output.writeString(this.delegationToken);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TRenewDelegationTokenResp = module.exports.TRenewDelegationTokenResp = function(args) {
  this.status = null;
  if (args) {
    if (args.status !== undefined && args.status !== null) {
      this.status = new ttypes.TStatus(args.status);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
  }
};
TRenewDelegationTokenResp.prototype = {};
TRenewDelegationTokenResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.STRUCT) {
        this.status = new ttypes.TStatus();
        this.status.read(input);
      } else {
        input.skip(ftype);
      }
      break;
      case 0:
        input.skip(ftype);
        break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TRenewDelegationTokenResp.prototype.write = function(output) {
  output.writeStructBegin('TRenewDelegationTokenResp');
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
    this.status.write(output);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

var TProgressUpdateResp = module.exports.TProgressUpdateResp = function(args) {
  this.headerNames = null;
  this.rows = null;
  this.progressedPercentage = null;
  this.status = null;
  this.footerSummary = null;
  this.startTime = null;
  if (args) {
    if (args.headerNames !== undefined && args.headerNames !== null) {
      this.headerNames = Thrift.copyList(args.headerNames, [null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field headerNames is unset!');
    }
    if (args.rows !== undefined && args.rows !== null) {
      this.rows = Thrift.copyList(args.rows, [Thrift.copyList, null]);
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field rows is unset!');
    }
    if (args.progressedPercentage !== undefined && args.progressedPercentage !== null) {
      this.progressedPercentage = args.progressedPercentage;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field progressedPercentage is unset!');
    }
    if (args.status !== undefined && args.status !== null) {
      this.status = args.status;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
    }
    if (args.footerSummary !== undefined && args.footerSummary !== null) {
      this.footerSummary = args.footerSummary;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field footerSummary is unset!');
    }
    if (args.startTime !== undefined && args.startTime !== null) {
      this.startTime = args.startTime;
    } else {
      throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field startTime is unset!');
    }
  }
};
TProgressUpdateResp.prototype = {};
TProgressUpdateResp.prototype.read = function(input) {
  input.readStructBegin();
  while (true) {
    var ret = input.readFieldBegin();
    var ftype = ret.ftype;
    var fid = ret.fid;
    if (ftype == Thrift.Type.STOP) {
      break;
    }
    switch (fid) {
      case 1:
      if (ftype == Thrift.Type.LIST) {
        this.headerNames = [];
        var _rtmp3118 = input.readListBegin();
        var _size117 = _rtmp3118.size || 0;
        for (var _i119 = 0; _i119 < _size117; ++_i119) {
          var elem120 = null;
          elem120 = input.readString();
          this.headerNames.push(elem120);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 2:
      if (ftype == Thrift.Type.LIST) {
        this.rows = [];
        var _rtmp3122 = input.readListBegin();
        var _size121 = _rtmp3122.size || 0;
        for (var _i123 = 0; _i123 < _size121; ++_i123) {
          var elem124 = null;
          elem124 = [];
          var _rtmp3126 = input.readListBegin();
          var _size125 = _rtmp3126.size || 0;
          for (var _i127 = 0; _i127 < _size125; ++_i127) {
            var elem128 = null;
            elem128 = input.readString();
            elem124.push(elem128);
          }
          input.readListEnd();
          this.rows.push(elem124);
        }
        input.readListEnd();
      } else {
        input.skip(ftype);
      }
      break;
      case 3:
      if (ftype == Thrift.Type.DOUBLE) {
        this.progressedPercentage = input.readDouble();
      } else {
        input.skip(ftype);
      }
      break;
      case 4:
      if (ftype == Thrift.Type.I32) {
        this.status = input.readI32();
      } else {
        input.skip(ftype);
      }
      break;
      case 5:
      if (ftype == Thrift.Type.STRING) {
        this.footerSummary = input.readString();
      } else {
        input.skip(ftype);
      }
      break;
      case 6:
      if (ftype == Thrift.Type.I64) {
        this.startTime = input.readI64();
      } else {
        input.skip(ftype);
      }
      break;
      default:
        input.skip(ftype);
    }
    input.readFieldEnd();
  }
  input.readStructEnd();
  return;
};

TProgressUpdateResp.prototype.write = function(output) {
  output.writeStructBegin('TProgressUpdateResp');
  if (this.headerNames !== null && this.headerNames !== undefined) {
    output.writeFieldBegin('headerNames', Thrift.Type.LIST, 1);
    output.writeListBegin(Thrift.Type.STRING, this.headerNames.length);
    for (var iter129 in this.headerNames) {
      if (this.headerNames.hasOwnProperty(iter129)) {
        iter129 = this.headerNames[iter129];
        output.writeString(iter129);
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.rows !== null && this.rows !== undefined) {
    output.writeFieldBegin('rows', Thrift.Type.LIST, 2);
    output.writeListBegin(Thrift.Type.LIST, this.rows.length);
    for (var iter130 in this.rows) {
      if (this.rows.hasOwnProperty(iter130)) {
        iter130 = this.rows[iter130];
        output.writeListBegin(Thrift.Type.STRING, iter130.length);
        for (var iter131 in iter130) {
          if (iter130.hasOwnProperty(iter131)) {
            iter131 = iter130[iter131];
            output.writeString(iter131);
          }
        }
        output.writeListEnd();
      }
    }
    output.writeListEnd();
    output.writeFieldEnd();
  }
  if (this.progressedPercentage !== null && this.progressedPercentage !== undefined) {
    output.writeFieldBegin('progressedPercentage', Thrift.Type.DOUBLE, 3);
    output.writeDouble(this.progressedPercentage);
    output.writeFieldEnd();
  }
  if (this.status !== null && this.status !== undefined) {
    output.writeFieldBegin('status', Thrift.Type.I32, 4);
    output.writeI32(this.status);
    output.writeFieldEnd();
  }
  if (this.footerSummary !== null && this.footerSummary !== undefined) {
    output.writeFieldBegin('footerSummary', Thrift.Type.STRING, 5);
    output.writeString(this.footerSummary);
    output.writeFieldEnd();
  }
  if (this.startTime !== null && this.startTime !== undefined) {
    output.writeFieldBegin('startTime', Thrift.Type.I64, 6);
    output.writeI64(this.startTime);
    output.writeFieldEnd();
  }
  output.writeFieldStop();
  output.writeStructEnd();
  return;
};

ttypes.PRIMITIVE_TYPES = [0,1,2,3,4,5,6,7,8,9,15,16,17,18,19,20,21];
ttypes.COMPLEX_TYPES = [10,11,12,13,14];
ttypes.COLLECTION_TYPES = [10,11];
ttypes.TYPE_NAMES = {
  10 : 'ARRAY',
  4 : 'BIGINT',
  9 : 'BINARY',
  0 : 'BOOLEAN',
  19 : 'CHAR',
  17 : 'DATE',
  15 : 'DECIMAL',
  6 : 'DOUBLE',
  5 : 'FLOAT',
  21 : 'INTERVAL_DAY_TIME',
  20 : 'INTERVAL_YEAR_MONTH',
  3 : 'INT',
  11 : 'MAP',
  16 : 'NULL',
  2 : 'SMALLINT',
  7 : 'STRING',
  12 : 'STRUCT',
  8 : 'TIMESTAMP',
  1 : 'TINYINT',
  13 : 'UNIONTYPE',
  18 : 'VARCHAR'
};
ttypes.CHARACTER_MAXIMUM_LENGTH = 'characterMaximumLength';
ttypes.PRECISION = 'precision';
ttypes.SCALE = 'scale';
