UNPKG

nopala

Version:

Impala and Hive client for Nodejs

1,127 lines (1,103 loc) 32.8 kB
// // 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.TPrimitiveType = { 'INVALID_TYPE' : 0, 'NULL_TYPE' : 1, 'BOOLEAN' : 2, 'TINYINT' : 3, 'SMALLINT' : 4, 'INT' : 5, 'BIGINT' : 6, 'FLOAT' : 7, 'DOUBLE' : 8, 'DATE' : 9, 'DATETIME' : 10, 'TIMESTAMP' : 11, 'STRING' : 12, 'BINARY' : 13, 'DECIMAL' : 14, 'CHAR' : 15, 'VARCHAR' : 16, 'FIXED_UDA_INTERMEDIATE' : 17 }; ttypes.TTypeNodeType = { 'SCALAR' : 0, 'ARRAY' : 1, 'MAP' : 2, 'STRUCT' : 3 }; ttypes.TStmtType = { 'QUERY' : 0, 'DDL' : 1, 'DML' : 2, 'EXPLAIN' : 3, 'LOAD' : 4, 'SET' : 5, 'ADMIN_FN' : 6, 'TESTCASE' : 7 }; ttypes.TExplainLevel = { 'MINIMAL' : 0, 'STANDARD' : 1, 'EXTENDED' : 2, 'VERBOSE' : 3 }; ttypes.TRuntimeFilterMode = { 'OFF' : 0, 'LOCAL' : 1, 'GLOBAL' : 2 }; ttypes.TPrefetchMode = { 'NONE' : 0, 'HT_BUCKET' : 1 }; ttypes.TFunctionCategory = { 'SCALAR' : 0, 'AGGREGATE' : 1, 'ANALYTIC' : 2 }; ttypes.TFunctionBinaryType = { 'BUILTIN' : 0, 'JAVA' : 1, 'NATIVE' : 2, 'IR' : 3 }; var TScalarType = module.exports.TScalarType = function(args) { this.type = null; this.len = null; this.precision = null; this.scale = 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.len !== undefined && args.len !== null) { this.len = args.len; } if (args.precision !== undefined && args.precision !== null) { this.precision = args.precision; } if (args.scale !== undefined && args.scale !== null) { this.scale = args.scale; } } }; TScalarType.prototype = {}; TScalarType.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.I32) { this.len = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.precision = input.readI32(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.I32) { this.scale = input.readI32(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TScalarType.prototype.write = function(output) { output.writeStructBegin('TScalarType'); if (this.type !== null && this.type !== undefined) { output.writeFieldBegin('type', Thrift.Type.I32, 1); output.writeI32(this.type); output.writeFieldEnd(); } if (this.len !== null && this.len !== undefined) { output.writeFieldBegin('len', Thrift.Type.I32, 2); output.writeI32(this.len); output.writeFieldEnd(); } if (this.precision !== null && this.precision !== undefined) { output.writeFieldBegin('precision', Thrift.Type.I32, 3); output.writeI32(this.precision); output.writeFieldEnd(); } if (this.scale !== null && this.scale !== undefined) { output.writeFieldBegin('scale', Thrift.Type.I32, 4); output.writeI32(this.scale); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TStructField = module.exports.TStructField = function(args) { this.name = null; this.comment = null; if (args) { if (args.name !== undefined && args.name !== null) { this.name = args.name; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); } if (args.comment !== undefined && args.comment !== null) { this.comment = args.comment; } } }; TStructField.prototype = {}; TStructField.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.name = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.comment = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TStructField.prototype.write = function(output) { output.writeStructBegin('TStructField'); if (this.name !== null && this.name !== undefined) { output.writeFieldBegin('name', Thrift.Type.STRING, 1); output.writeString(this.name); output.writeFieldEnd(); } if (this.comment !== null && this.comment !== undefined) { output.writeFieldBegin('comment', Thrift.Type.STRING, 2); output.writeString(this.comment); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TTypeNode = module.exports.TTypeNode = function(args) { this.type = null; this.scalar_type = null; this.struct_fields = 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.scalar_type !== undefined && args.scalar_type !== null) { this.scalar_type = new ttypes.TScalarType(args.scalar_type); } if (args.struct_fields !== undefined && args.struct_fields !== null) { this.struct_fields = Thrift.copyList(args.struct_fields, [ttypes.TStructField]); } } }; TTypeNode.prototype = {}; TTypeNode.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.scalar_type = new ttypes.TScalarType(); this.scalar_type.read(input); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.LIST) { this.struct_fields = []; var _rtmp31 = input.readListBegin(); var _size0 = _rtmp31.size || 0; for (var _i2 = 0; _i2 < _size0; ++_i2) { var elem3 = null; elem3 = new ttypes.TStructField(); elem3.read(input); this.struct_fields.push(elem3); } input.readListEnd(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TTypeNode.prototype.write = function(output) { output.writeStructBegin('TTypeNode'); if (this.type !== null && this.type !== undefined) { output.writeFieldBegin('type', Thrift.Type.I32, 1); output.writeI32(this.type); output.writeFieldEnd(); } if (this.scalar_type !== null && this.scalar_type !== undefined) { output.writeFieldBegin('scalar_type', Thrift.Type.STRUCT, 2); this.scalar_type.write(output); output.writeFieldEnd(); } if (this.struct_fields !== null && this.struct_fields !== undefined) { output.writeFieldBegin('struct_fields', Thrift.Type.LIST, 3); output.writeListBegin(Thrift.Type.STRUCT, this.struct_fields.length); for (var iter4 in this.struct_fields) { if (this.struct_fields.hasOwnProperty(iter4)) { iter4 = this.struct_fields[iter4]; iter4.write(output); } } output.writeListEnd(); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TColumnType = module.exports.TColumnType = function(args) { this.types = null; if (args) { if (args.types !== undefined && args.types !== null) { this.types = Thrift.copyList(args.types, [ttypes.TTypeNode]); } } }; TColumnType.prototype = {}; TColumnType.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 _rtmp36 = input.readListBegin(); var _size5 = _rtmp36.size || 0; for (var _i7 = 0; _i7 < _size5; ++_i7) { var elem8 = null; elem8 = new ttypes.TTypeNode(); elem8.read(input); this.types.push(elem8); } input.readListEnd(); } else { input.skip(ftype); } break; case 0: input.skip(ftype); break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TColumnType.prototype.write = function(output) { output.writeStructBegin('TColumnType'); if (this.types !== null && this.types !== undefined) { output.writeFieldBegin('types', Thrift.Type.LIST, 1); output.writeListBegin(Thrift.Type.STRUCT, this.types.length); for (var iter9 in this.types) { if (this.types.hasOwnProperty(iter9)) { iter9 = this.types[iter9]; iter9.write(output); } } output.writeListEnd(); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TNetworkAddress = module.exports.TNetworkAddress = function(args) { this.hostname = null; this.port = null; if (args) { if (args.hostname !== undefined && args.hostname !== null) { this.hostname = args.hostname; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hostname is unset!'); } if (args.port !== undefined && args.port !== null) { this.port = args.port; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field port is unset!'); } } }; TNetworkAddress.prototype = {}; TNetworkAddress.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.hostname = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.port = input.readI32(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TNetworkAddress.prototype.write = function(output) { output.writeStructBegin('TNetworkAddress'); if (this.hostname !== null && this.hostname !== undefined) { output.writeFieldBegin('hostname', Thrift.Type.STRING, 1); output.writeString(this.hostname); output.writeFieldEnd(); } if (this.port !== null && this.port !== undefined) { output.writeFieldBegin('port', Thrift.Type.I32, 2); output.writeI32(this.port); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TUniqueId = module.exports.TUniqueId = function(args) { this.hi = null; this.lo = null; if (args) { if (args.hi !== undefined && args.hi !== null) { this.hi = args.hi; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field hi is unset!'); } if (args.lo !== undefined && args.lo !== null) { this.lo = args.lo; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field lo is unset!'); } } }; TUniqueId.prototype = {}; TUniqueId.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.hi = input.readI64(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I64) { this.lo = input.readI64(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TUniqueId.prototype.write = function(output) { output.writeStructBegin('TUniqueId'); if (this.hi !== null && this.hi !== undefined) { output.writeFieldBegin('hi', Thrift.Type.I64, 1); output.writeI64(this.hi); output.writeFieldEnd(); } if (this.lo !== null && this.lo !== undefined) { output.writeFieldBegin('lo', Thrift.Type.I64, 2); output.writeI64(this.lo); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TFunctionName = module.exports.TFunctionName = function(args) { this.db_name = null; this.function_name = null; if (args) { if (args.db_name !== undefined && args.db_name !== null) { this.db_name = args.db_name; } if (args.function_name !== undefined && args.function_name !== null) { this.function_name = args.function_name; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field function_name is unset!'); } } }; TFunctionName.prototype = {}; TFunctionName.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.db_name = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.function_name = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TFunctionName.prototype.write = function(output) { output.writeStructBegin('TFunctionName'); if (this.db_name !== null && this.db_name !== undefined) { output.writeFieldBegin('db_name', Thrift.Type.STRING, 1); output.writeString(this.db_name); output.writeFieldEnd(); } if (this.function_name !== null && this.function_name !== undefined) { output.writeFieldBegin('function_name', Thrift.Type.STRING, 2); output.writeString(this.function_name); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TScalarFunction = module.exports.TScalarFunction = function(args) { this.symbol = null; this.prepare_fn_symbol = null; this.close_fn_symbol = null; if (args) { if (args.symbol !== undefined && args.symbol !== null) { this.symbol = args.symbol; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field symbol is unset!'); } if (args.prepare_fn_symbol !== undefined && args.prepare_fn_symbol !== null) { this.prepare_fn_symbol = args.prepare_fn_symbol; } if (args.close_fn_symbol !== undefined && args.close_fn_symbol !== null) { this.close_fn_symbol = args.close_fn_symbol; } } }; TScalarFunction.prototype = {}; TScalarFunction.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.symbol = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.prepare_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.STRING) { this.close_fn_symbol = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TScalarFunction.prototype.write = function(output) { output.writeStructBegin('TScalarFunction'); if (this.symbol !== null && this.symbol !== undefined) { output.writeFieldBegin('symbol', Thrift.Type.STRING, 1); output.writeString(this.symbol); output.writeFieldEnd(); } if (this.prepare_fn_symbol !== null && this.prepare_fn_symbol !== undefined) { output.writeFieldBegin('prepare_fn_symbol', Thrift.Type.STRING, 2); output.writeString(this.prepare_fn_symbol); output.writeFieldEnd(); } if (this.close_fn_symbol !== null && this.close_fn_symbol !== undefined) { output.writeFieldBegin('close_fn_symbol', Thrift.Type.STRING, 3); output.writeString(this.close_fn_symbol); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TAggregateFunction = module.exports.TAggregateFunction = function(args) { this.intermediate_type = null; this.is_analytic_only_fn = null; this.update_fn_symbol = null; this.init_fn_symbol = null; this.serialize_fn_symbol = null; this.merge_fn_symbol = null; this.finalize_fn_symbol = null; this.get_value_fn_symbol = null; this.remove_fn_symbol = null; this.ignores_distinct = null; if (args) { if (args.intermediate_type !== undefined && args.intermediate_type !== null) { this.intermediate_type = new ttypes.TColumnType(args.intermediate_type); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field intermediate_type is unset!'); } if (args.is_analytic_only_fn !== undefined && args.is_analytic_only_fn !== null) { this.is_analytic_only_fn = args.is_analytic_only_fn; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field is_analytic_only_fn is unset!'); } if (args.update_fn_symbol !== undefined && args.update_fn_symbol !== null) { this.update_fn_symbol = args.update_fn_symbol; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field update_fn_symbol is unset!'); } if (args.init_fn_symbol !== undefined && args.init_fn_symbol !== null) { this.init_fn_symbol = args.init_fn_symbol; } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field init_fn_symbol is unset!'); } if (args.serialize_fn_symbol !== undefined && args.serialize_fn_symbol !== null) { this.serialize_fn_symbol = args.serialize_fn_symbol; } if (args.merge_fn_symbol !== undefined && args.merge_fn_symbol !== null) { this.merge_fn_symbol = args.merge_fn_symbol; } if (args.finalize_fn_symbol !== undefined && args.finalize_fn_symbol !== null) { this.finalize_fn_symbol = args.finalize_fn_symbol; } if (args.get_value_fn_symbol !== undefined && args.get_value_fn_symbol !== null) { this.get_value_fn_symbol = args.get_value_fn_symbol; } if (args.remove_fn_symbol !== undefined && args.remove_fn_symbol !== null) { this.remove_fn_symbol = args.remove_fn_symbol; } if (args.ignores_distinct !== undefined && args.ignores_distinct !== null) { this.ignores_distinct = args.ignores_distinct; } } }; TAggregateFunction.prototype = {}; TAggregateFunction.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.intermediate_type = new ttypes.TColumnType(); this.intermediate_type.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.BOOL) { this.is_analytic_only_fn = input.readBool(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.STRING) { this.update_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.STRING) { this.init_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.STRING) { this.serialize_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.STRING) { this.merge_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.STRING) { this.finalize_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.STRING) { this.get_value_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 9: if (ftype == Thrift.Type.STRING) { this.remove_fn_symbol = input.readString(); } else { input.skip(ftype); } break; case 10: if (ftype == Thrift.Type.BOOL) { this.ignores_distinct = input.readBool(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TAggregateFunction.prototype.write = function(output) { output.writeStructBegin('TAggregateFunction'); if (this.intermediate_type !== null && this.intermediate_type !== undefined) { output.writeFieldBegin('intermediate_type', Thrift.Type.STRUCT, 1); this.intermediate_type.write(output); output.writeFieldEnd(); } if (this.is_analytic_only_fn !== null && this.is_analytic_only_fn !== undefined) { output.writeFieldBegin('is_analytic_only_fn', Thrift.Type.BOOL, 2); output.writeBool(this.is_analytic_only_fn); output.writeFieldEnd(); } if (this.update_fn_symbol !== null && this.update_fn_symbol !== undefined) { output.writeFieldBegin('update_fn_symbol', Thrift.Type.STRING, 3); output.writeString(this.update_fn_symbol); output.writeFieldEnd(); } if (this.init_fn_symbol !== null && this.init_fn_symbol !== undefined) { output.writeFieldBegin('init_fn_symbol', Thrift.Type.STRING, 4); output.writeString(this.init_fn_symbol); output.writeFieldEnd(); } if (this.serialize_fn_symbol !== null && this.serialize_fn_symbol !== undefined) { output.writeFieldBegin('serialize_fn_symbol', Thrift.Type.STRING, 5); output.writeString(this.serialize_fn_symbol); output.writeFieldEnd(); } if (this.merge_fn_symbol !== null && this.merge_fn_symbol !== undefined) { output.writeFieldBegin('merge_fn_symbol', Thrift.Type.STRING, 6); output.writeString(this.merge_fn_symbol); output.writeFieldEnd(); } if (this.finalize_fn_symbol !== null && this.finalize_fn_symbol !== undefined) { output.writeFieldBegin('finalize_fn_symbol', Thrift.Type.STRING, 7); output.writeString(this.finalize_fn_symbol); output.writeFieldEnd(); } if (this.get_value_fn_symbol !== null && this.get_value_fn_symbol !== undefined) { output.writeFieldBegin('get_value_fn_symbol', Thrift.Type.STRING, 8); output.writeString(this.get_value_fn_symbol); output.writeFieldEnd(); } if (this.remove_fn_symbol !== null && this.remove_fn_symbol !== undefined) { output.writeFieldBegin('remove_fn_symbol', Thrift.Type.STRING, 9); output.writeString(this.remove_fn_symbol); output.writeFieldEnd(); } if (this.ignores_distinct !== null && this.ignores_distinct !== undefined) { output.writeFieldBegin('ignores_distinct', Thrift.Type.BOOL, 10); output.writeBool(this.ignores_distinct); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; var TFunction = module.exports.TFunction = function(args) { this.name = null; this.binary_type = null; this.arg_types = null; this.ret_type = null; this.has_var_args = null; this.comment = null; this.signature = null; this.hdfs_location = null; this.scalar_fn = null; this.aggregate_fn = null; this.is_persistent = null; this.last_modified_time = null; if (args) { if (args.name !== undefined && args.name !== null) { this.name = new ttypes.TFunctionName(args.name); } else { throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field name is unset!'); } if (args.binary_type !== undefined && args.binary_type !== null) { this.binary_type = args.binary_type; } if (args.arg_types !== undefined && args.arg_types !== null) { this.arg_types = Thrift.copyList(args.arg_types, [ttypes.TColumnType]); } if (args.ret_type !== undefined && args.ret_type !== null) { this.ret_type = new ttypes.TColumnType(args.ret_type); } if (args.has_var_args !== undefined && args.has_var_args !== null) { this.has_var_args = args.has_var_args; } if (args.comment !== undefined && args.comment !== null) { this.comment = args.comment; } if (args.signature !== undefined && args.signature !== null) { this.signature = args.signature; } if (args.hdfs_location !== undefined && args.hdfs_location !== null) { this.hdfs_location = args.hdfs_location; } if (args.scalar_fn !== undefined && args.scalar_fn !== null) { this.scalar_fn = new ttypes.TScalarFunction(args.scalar_fn); } if (args.aggregate_fn !== undefined && args.aggregate_fn !== null) { this.aggregate_fn = new ttypes.TAggregateFunction(args.aggregate_fn); } if (args.is_persistent !== undefined && args.is_persistent !== null) { this.is_persistent = args.is_persistent; } if (args.last_modified_time !== undefined && args.last_modified_time !== null) { this.last_modified_time = args.last_modified_time; } } }; TFunction.prototype = {}; TFunction.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.name = new ttypes.TFunctionName(); this.name.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.binary_type = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.LIST) { this.arg_types = []; var _rtmp311 = input.readListBegin(); var _size10 = _rtmp311.size || 0; for (var _i12 = 0; _i12 < _size10; ++_i12) { var elem13 = null; elem13 = new ttypes.TColumnType(); elem13.read(input); this.arg_types.push(elem13); } input.readListEnd(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.STRUCT) { this.ret_type = new ttypes.TColumnType(); this.ret_type.read(input); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.BOOL) { this.has_var_args = input.readBool(); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.STRING) { this.comment = input.readString(); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.STRING) { this.signature = input.readString(); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.STRING) { this.hdfs_location = input.readString(); } else { input.skip(ftype); } break; case 9: if (ftype == Thrift.Type.STRUCT) { this.scalar_fn = new ttypes.TScalarFunction(); this.scalar_fn.read(input); } else { input.skip(ftype); } break; case 10: if (ftype == Thrift.Type.STRUCT) { this.aggregate_fn = new ttypes.TAggregateFunction(); this.aggregate_fn.read(input); } else { input.skip(ftype); } break; case 11: if (ftype == Thrift.Type.BOOL) { this.is_persistent = input.readBool(); } else { input.skip(ftype); } break; case 12: if (ftype == Thrift.Type.I64) { this.last_modified_time = input.readI64(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TFunction.prototype.write = function(output) { output.writeStructBegin('TFunction'); if (this.name !== null && this.name !== undefined) { output.writeFieldBegin('name', Thrift.Type.STRUCT, 1); this.name.write(output); output.writeFieldEnd(); } if (this.binary_type !== null && this.binary_type !== undefined) { output.writeFieldBegin('binary_type', Thrift.Type.I32, 2); output.writeI32(this.binary_type); output.writeFieldEnd(); } if (this.arg_types !== null && this.arg_types !== undefined) { output.writeFieldBegin('arg_types', Thrift.Type.LIST, 3); output.writeListBegin(Thrift.Type.STRUCT, this.arg_types.length); for (var iter14 in this.arg_types) { if (this.arg_types.hasOwnProperty(iter14)) { iter14 = this.arg_types[iter14]; iter14.write(output); } } output.writeListEnd(); output.writeFieldEnd(); } if (this.ret_type !== null && this.ret_type !== undefined) { output.writeFieldBegin('ret_type', Thrift.Type.STRUCT, 4); this.ret_type.write(output); output.writeFieldEnd(); } if (this.has_var_args !== null && this.has_var_args !== undefined) { output.writeFieldBegin('has_var_args', Thrift.Type.BOOL, 5); output.writeBool(this.has_var_args); output.writeFieldEnd(); } if (this.comment !== null && this.comment !== undefined) { output.writeFieldBegin('comment', Thrift.Type.STRING, 6); output.writeString(this.comment); output.writeFieldEnd(); } if (this.signature !== null && this.signature !== undefined) { output.writeFieldBegin('signature', Thrift.Type.STRING, 7); output.writeString(this.signature); output.writeFieldEnd(); } if (this.hdfs_location !== null && this.hdfs_location !== undefined) { output.writeFieldBegin('hdfs_location', Thrift.Type.STRING, 8); output.writeString(this.hdfs_location); output.writeFieldEnd(); } if (this.scalar_fn !== null && this.scalar_fn !== undefined) { output.writeFieldBegin('scalar_fn', Thrift.Type.STRUCT, 9); this.scalar_fn.write(output); output.writeFieldEnd(); } if (this.aggregate_fn !== null && this.aggregate_fn !== undefined) { output.writeFieldBegin('aggregate_fn', Thrift.Type.STRUCT, 10); this.aggregate_fn.write(output); output.writeFieldEnd(); } if (this.is_persistent !== null && this.is_persistent !== undefined) { output.writeFieldBegin('is_persistent', Thrift.Type.BOOL, 11); output.writeBool(this.is_persistent); output.writeFieldEnd(); } if (this.last_modified_time !== null && this.last_modified_time !== undefined) { output.writeFieldBegin('last_modified_time', Thrift.Type.I64, 12); output.writeI64(this.last_modified_time); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; };