UNPKG

parquetjs-lite

Version:

fully asynchronous, pure JavaScript implementation of the Parquet file format

1,965 lines (1,913 loc) 89.3 kB
// // Autogenerated by Thrift Compiler (0.9.1) // // DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING // var Thrift = require('../modules/thrift-lite').Thrift; var ttypes = module.exports = {}; ttypes.Type = { 'BOOLEAN' : 0, 'INT32' : 1, 'INT64' : 2, 'INT96' : 3, 'FLOAT' : 4, 'DOUBLE' : 5, 'BYTE_ARRAY' : 6, 'FIXED_LEN_BYTE_ARRAY' : 7 }; ttypes.ConvertedType = { 'UTF8' : 0, 'MAP' : 1, 'MAP_KEY_VALUE' : 2, 'LIST' : 3, 'ENUM' : 4, 'DECIMAL' : 5, 'DATE' : 6, 'TIME_MILLIS' : 7, 'TIME_MICROS' : 8, 'TIMESTAMP_MILLIS' : 9, 'TIMESTAMP_MICROS' : 10, 'UINT_8' : 11, 'UINT_16' : 12, 'UINT_32' : 13, 'UINT_64' : 14, 'INT_8' : 15, 'INT_16' : 16, 'INT_32' : 17, 'INT_64' : 18, 'JSON' : 19, 'BSON' : 20, 'INTERVAL' : 21 }; ttypes.FieldRepetitionType = { 'REQUIRED' : 0, 'OPTIONAL' : 1, 'REPEATED' : 2 }; ttypes.Encoding = { 'PLAIN' : 0, 'PLAIN_DICTIONARY' : 2, 'RLE' : 3, 'BIT_PACKED' : 4, 'DELTA_BINARY_PACKED' : 5, 'DELTA_LENGTH_BYTE_ARRAY' : 6, 'DELTA_BYTE_ARRAY' : 7, 'RLE_DICTIONARY' : 8 }; ttypes.CompressionCodec = { 'UNCOMPRESSED' : 0, 'SNAPPY' : 1, 'GZIP' : 2, 'LZO' : 3, 'BROTLI' : 4, 'LZ4' : 5, 'ZSTD' : 6 }; ttypes.PageType = { 'DATA_PAGE' : 0, 'INDEX_PAGE' : 1, 'DICTIONARY_PAGE' : 2, 'DATA_PAGE_V2' : 3 }; ttypes.BoundaryOrder = { 'UNORDERED' : 0, 'ASCENDING' : 1, 'DESCENDING' : 2 }; Statistics = module.exports.Statistics = function(args) { this.max = null; this.min = null; this.null_count = null; this.distinct_count = null; this.max_value = null; this.min_value = null; if (args) { if (args.max !== undefined) { this.max = args.max; } if (args.min !== undefined) { this.min = args.min; } if (args.null_count !== undefined) { this.null_count = args.null_count; } if (args.distinct_count !== undefined) { this.distinct_count = args.distinct_count; } if (args.max_value !== undefined) { this.max_value = args.max_value; } if (args.min_value !== undefined) { this.min_value = args.min_value; } } }; Statistics.prototype = {}; Statistics.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.STRING) { this.max = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.min = input.readString(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I64) { this.null_count = input.readI64(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.I64) { this.distinct_count = input.readI64(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.STRING) { this.max_value = input.readString(); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.STRING) { this.min_value = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; Statistics.prototype.write = function(output) { output.writeStructBegin('Statistics'); if (this.max !== null && this.max !== undefined) { output.writeFieldBegin('max', Thrift.Type.STRING, 1); output.writeString(this.max); output.writeFieldEnd(); } if (this.min !== null && this.min !== undefined) { output.writeFieldBegin('min', Thrift.Type.STRING, 2); output.writeString(this.min); output.writeFieldEnd(); } if (this.null_count !== null && this.null_count !== undefined) { output.writeFieldBegin('null_count', Thrift.Type.I64, 3); output.writeI64(this.null_count); output.writeFieldEnd(); } if (this.distinct_count !== null && this.distinct_count !== undefined) { output.writeFieldBegin('distinct_count', Thrift.Type.I64, 4); output.writeI64(this.distinct_count); output.writeFieldEnd(); } if (this.max_value !== null && this.max_value !== undefined) { output.writeFieldBegin('max_value', Thrift.Type.STRING, 5); output.writeString(this.max_value); output.writeFieldEnd(); } if (this.min_value !== null && this.min_value !== undefined) { output.writeFieldBegin('min_value', Thrift.Type.STRING, 6); output.writeString(this.min_value); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; StringType = module.exports.StringType = function(args) { }; StringType.prototype = {}; StringType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; StringType.prototype.write = function(output) { output.writeStructBegin('StringType'); output.writeFieldStop(); output.writeStructEnd(); return; }; UUIDType = module.exports.UUIDType = function(args) { }; UUIDType.prototype = {}; UUIDType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; UUIDType.prototype.write = function(output) { output.writeStructBegin('UUIDType'); output.writeFieldStop(); output.writeStructEnd(); return; }; MapType = module.exports.MapType = function(args) { }; MapType.prototype = {}; MapType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; MapType.prototype.write = function(output) { output.writeStructBegin('MapType'); output.writeFieldStop(); output.writeStructEnd(); return; }; ListType = module.exports.ListType = function(args) { }; ListType.prototype = {}; ListType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; ListType.prototype.write = function(output) { output.writeStructBegin('ListType'); output.writeFieldStop(); output.writeStructEnd(); return; }; EnumType = module.exports.EnumType = function(args) { }; EnumType.prototype = {}; EnumType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; EnumType.prototype.write = function(output) { output.writeStructBegin('EnumType'); output.writeFieldStop(); output.writeStructEnd(); return; }; DateType = module.exports.DateType = function(args) { }; DateType.prototype = {}; DateType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; DateType.prototype.write = function(output) { output.writeStructBegin('DateType'); output.writeFieldStop(); output.writeStructEnd(); return; }; NullType = module.exports.NullType = function(args) { }; NullType.prototype = {}; NullType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; NullType.prototype.write = function(output) { output.writeStructBegin('NullType'); output.writeFieldStop(); output.writeStructEnd(); return; }; DecimalType = module.exports.DecimalType = function(args) { this.scale = null; this.precision = null; if (args) { if (args.scale !== undefined) { this.scale = args.scale; } if (args.precision !== undefined) { this.precision = args.precision; } } }; DecimalType.prototype = {}; DecimalType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.I32) { this.scale = input.readI32(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.precision = input.readI32(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; DecimalType.prototype.write = function(output) { output.writeStructBegin('DecimalType'); if (this.scale !== null && this.scale !== undefined) { output.writeFieldBegin('scale', Thrift.Type.I32, 1); output.writeI32(this.scale); output.writeFieldEnd(); } if (this.precision !== null && this.precision !== undefined) { output.writeFieldBegin('precision', Thrift.Type.I32, 2); output.writeI32(this.precision); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; MilliSeconds = module.exports.MilliSeconds = function(args) { }; MilliSeconds.prototype = {}; MilliSeconds.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; MilliSeconds.prototype.write = function(output) { output.writeStructBegin('MilliSeconds'); output.writeFieldStop(); output.writeStructEnd(); return; }; MicroSeconds = module.exports.MicroSeconds = function(args) { }; MicroSeconds.prototype = {}; MicroSeconds.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; MicroSeconds.prototype.write = function(output) { output.writeStructBegin('MicroSeconds'); output.writeFieldStop(); output.writeStructEnd(); return; }; TimeUnit = module.exports.TimeUnit = function(args) { this.MILLIS = null; this.MICROS = null; if (args) { if (args.MILLIS !== undefined) { this.MILLIS = args.MILLIS; } if (args.MICROS !== undefined) { this.MICROS = args.MICROS; } } }; TimeUnit.prototype = {}; TimeUnit.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { this.MILLIS = new ttypes.MilliSeconds(); this.MILLIS.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.MICROS = new ttypes.MicroSeconds(); this.MICROS.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TimeUnit.prototype.write = function(output) { output.writeStructBegin('TimeUnit'); if (this.MILLIS !== null && this.MILLIS !== undefined) { output.writeFieldBegin('MILLIS', Thrift.Type.STRUCT, 1); this.MILLIS.write(output); output.writeFieldEnd(); } if (this.MICROS !== null && this.MICROS !== undefined) { output.writeFieldBegin('MICROS', Thrift.Type.STRUCT, 2); this.MICROS.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; TimestampType = module.exports.TimestampType = function(args) { this.isAdjustedToUTC = null; this.unit = null; if (args) { if (args.isAdjustedToUTC !== undefined) { this.isAdjustedToUTC = args.isAdjustedToUTC; } if (args.unit !== undefined) { this.unit = args.unit; } } }; TimestampType.prototype = {}; TimestampType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.BOOL) { this.isAdjustedToUTC = input.readBool(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.unit = new ttypes.TimeUnit(); this.unit.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TimestampType.prototype.write = function(output) { output.writeStructBegin('TimestampType'); if (this.isAdjustedToUTC !== null && this.isAdjustedToUTC !== undefined) { output.writeFieldBegin('isAdjustedToUTC', Thrift.Type.BOOL, 1); output.writeBool(this.isAdjustedToUTC); output.writeFieldEnd(); } if (this.unit !== null && this.unit !== undefined) { output.writeFieldBegin('unit', Thrift.Type.STRUCT, 2); this.unit.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; TimeType = module.exports.TimeType = function(args) { this.isAdjustedToUTC = null; this.unit = null; if (args) { if (args.isAdjustedToUTC !== undefined) { this.isAdjustedToUTC = args.isAdjustedToUTC; } if (args.unit !== undefined) { this.unit = args.unit; } } }; TimeType.prototype = {}; TimeType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.BOOL) { this.isAdjustedToUTC = input.readBool(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.unit = new ttypes.TimeUnit(); this.unit.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; TimeType.prototype.write = function(output) { output.writeStructBegin('TimeType'); if (this.isAdjustedToUTC !== null && this.isAdjustedToUTC !== undefined) { output.writeFieldBegin('isAdjustedToUTC', Thrift.Type.BOOL, 1); output.writeBool(this.isAdjustedToUTC); output.writeFieldEnd(); } if (this.unit !== null && this.unit !== undefined) { output.writeFieldBegin('unit', Thrift.Type.STRUCT, 2); this.unit.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; IntType = module.exports.IntType = function(args) { this.bitWidth = null; this.isSigned = null; if (args) { if (args.bitWidth !== undefined) { this.bitWidth = args.bitWidth; } if (args.isSigned !== undefined) { this.isSigned = args.isSigned; } } }; IntType.prototype = {}; IntType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.BYTE) { this.bitWidth = input.readByte(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.BOOL) { this.isSigned = input.readBool(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; IntType.prototype.write = function(output) { output.writeStructBegin('IntType'); if (this.bitWidth !== null && this.bitWidth !== undefined) { output.writeFieldBegin('bitWidth', Thrift.Type.BYTE, 1); output.writeByte(this.bitWidth); output.writeFieldEnd(); } if (this.isSigned !== null && this.isSigned !== undefined) { output.writeFieldBegin('isSigned', Thrift.Type.BOOL, 2); output.writeBool(this.isSigned); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; JsonType = module.exports.JsonType = function(args) { }; JsonType.prototype = {}; JsonType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; JsonType.prototype.write = function(output) { output.writeStructBegin('JsonType'); output.writeFieldStop(); output.writeStructEnd(); return; }; BsonType = module.exports.BsonType = function(args) { }; BsonType.prototype = {}; BsonType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; BsonType.prototype.write = function(output) { output.writeStructBegin('BsonType'); output.writeFieldStop(); output.writeStructEnd(); return; }; LogicalType = module.exports.LogicalType = function(args) { this.STRING = null; this.MAP = null; this.LIST = null; this.ENUM = null; this.DECIMAL = null; this.DATE = null; this.TIME = null; this.TIMESTAMP = null; this.INTEGER = null; this.UNKNOWN = null; this.JSON = null; this.BSON = null; if (args) { if (args.STRING !== undefined) { this.STRING = args.STRING; } if (args.MAP !== undefined) { this.MAP = args.MAP; } if (args.LIST !== undefined) { this.LIST = args.LIST; } if (args.ENUM !== undefined) { this.ENUM = args.ENUM; } if (args.DECIMAL !== undefined) { this.DECIMAL = args.DECIMAL; } if (args.DATE !== undefined) { this.DATE = args.DATE; } if (args.TIME !== undefined) { this.TIME = args.TIME; } if (args.TIMESTAMP !== undefined) { this.TIMESTAMP = args.TIMESTAMP; } if (args.INTEGER !== undefined) { this.INTEGER = args.INTEGER; } if (args.UNKNOWN !== undefined) { this.UNKNOWN = args.UNKNOWN; } if (args.JSON !== undefined) { this.JSON = args.JSON; } if (args.BSON !== undefined) { this.BSON = args.BSON; } } }; LogicalType.prototype = {}; LogicalType.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.STRUCT) { this.STRING = new ttypes.StringType(); this.STRING.read(input); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRUCT) { this.MAP = new ttypes.MapType(); this.MAP.read(input); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.STRUCT) { this.LIST = new ttypes.ListType(); this.LIST.read(input); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.STRUCT) { this.ENUM = new ttypes.EnumType(); this.ENUM.read(input); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.STRUCT) { this.DECIMAL = new ttypes.DecimalType(); this.DECIMAL.read(input); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.STRUCT) { this.DATE = new ttypes.DateType(); this.DATE.read(input); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.STRUCT) { this.TIME = new ttypes.TimeType(); this.TIME.read(input); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.STRUCT) { this.TIMESTAMP = new ttypes.TimestampType(); this.TIMESTAMP.read(input); } else { input.skip(ftype); } break; case 10: if (ftype == Thrift.Type.STRUCT) { this.INTEGER = new ttypes.IntType(); this.INTEGER.read(input); } else { input.skip(ftype); } break; case 11: if (ftype == Thrift.Type.STRUCT) { this.UNKNOWN = new ttypes.NullType(); this.UNKNOWN.read(input); } else { input.skip(ftype); } break; case 12: if (ftype == Thrift.Type.STRUCT) { this.JSON = new ttypes.JsonType(); this.JSON.read(input); } else { input.skip(ftype); } break; case 13: if (ftype == Thrift.Type.STRUCT) { this.BSON = new ttypes.BsonType(); this.BSON.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; LogicalType.prototype.write = function(output) { output.writeStructBegin('LogicalType'); if (this.STRING !== null && this.STRING !== undefined) { output.writeFieldBegin('STRING', Thrift.Type.STRUCT, 1); this.STRING.write(output); output.writeFieldEnd(); } if (this.MAP !== null && this.MAP !== undefined) { output.writeFieldBegin('MAP', Thrift.Type.STRUCT, 2); this.MAP.write(output); output.writeFieldEnd(); } if (this.LIST !== null && this.LIST !== undefined) { output.writeFieldBegin('LIST', Thrift.Type.STRUCT, 3); this.LIST.write(output); output.writeFieldEnd(); } if (this.ENUM !== null && this.ENUM !== undefined) { output.writeFieldBegin('ENUM', Thrift.Type.STRUCT, 4); this.ENUM.write(output); output.writeFieldEnd(); } if (this.DECIMAL !== null && this.DECIMAL !== undefined) { output.writeFieldBegin('DECIMAL', Thrift.Type.STRUCT, 5); this.DECIMAL.write(output); output.writeFieldEnd(); } if (this.DATE !== null && this.DATE !== undefined) { output.writeFieldBegin('DATE', Thrift.Type.STRUCT, 6); this.DATE.write(output); output.writeFieldEnd(); } if (this.TIME !== null && this.TIME !== undefined) { output.writeFieldBegin('TIME', Thrift.Type.STRUCT, 7); this.TIME.write(output); output.writeFieldEnd(); } if (this.TIMESTAMP !== null && this.TIMESTAMP !== undefined) { output.writeFieldBegin('TIMESTAMP', Thrift.Type.STRUCT, 8); this.TIMESTAMP.write(output); output.writeFieldEnd(); } if (this.INTEGER !== null && this.INTEGER !== undefined) { output.writeFieldBegin('INTEGER', Thrift.Type.STRUCT, 10); this.INTEGER.write(output); output.writeFieldEnd(); } if (this.UNKNOWN !== null && this.UNKNOWN !== undefined) { output.writeFieldBegin('UNKNOWN', Thrift.Type.STRUCT, 11); this.UNKNOWN.write(output); output.writeFieldEnd(); } if (this.JSON !== null && this.JSON !== undefined) { output.writeFieldBegin('JSON', Thrift.Type.STRUCT, 12); this.JSON.write(output); output.writeFieldEnd(); } if (this.BSON !== null && this.BSON !== undefined) { output.writeFieldBegin('BSON', Thrift.Type.STRUCT, 13); this.BSON.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; SchemaElement = module.exports.SchemaElement = function(args) { this.type = null; this.type_length = null; this.repetition_type = null; this.name = null; this.num_children = null; this.converted_type = null; this.scale = null; this.precision = null; this.field_id = null; this.logicalType = null; if (args) { if (args.type !== undefined) { this.type = args.type; } if (args.type_length !== undefined) { this.type_length = args.type_length; } if (args.repetition_type !== undefined) { this.repetition_type = args.repetition_type; } if (args.name !== undefined) { this.name = args.name; } if (args.num_children !== undefined) { this.num_children = args.num_children; } if (args.converted_type !== undefined) { this.converted_type = args.converted_type; } if (args.scale !== undefined) { this.scale = args.scale; } if (args.precision !== undefined) { this.precision = args.precision; } if (args.field_id !== undefined) { this.field_id = args.field_id; } if (args.logicalType !== undefined) { this.logicalType = args.logicalType; } } }; SchemaElement.prototype = {}; SchemaElement.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; 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.type_length = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.repetition_type = input.readI32(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.STRING) { this.name = input.readString(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.I32) { this.num_children = input.readI32(); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.I32) { this.converted_type = input.readI32(); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.I32) { this.scale = input.readI32(); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.I32) { this.precision = input.readI32(); } else { input.skip(ftype); } break; case 9: if (ftype == Thrift.Type.I32) { this.field_id = input.readI32(); } else { input.skip(ftype); } break; case 10: if (ftype == Thrift.Type.STRUCT) { this.logicalType = new ttypes.LogicalType(); this.logicalType.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; SchemaElement.prototype.write = function(output) { output.writeStructBegin('SchemaElement'); if (this.type !== null && this.type !== undefined) { output.writeFieldBegin('type', Thrift.Type.I32, 1); output.writeI32(this.type); output.writeFieldEnd(); } if (this.type_length !== null && this.type_length !== undefined) { output.writeFieldBegin('type_length', Thrift.Type.I32, 2); output.writeI32(this.type_length); output.writeFieldEnd(); } if (this.repetition_type !== null && this.repetition_type !== undefined) { output.writeFieldBegin('repetition_type', Thrift.Type.I32, 3); output.writeI32(this.repetition_type); output.writeFieldEnd(); } if (this.name !== null && this.name !== undefined) { output.writeFieldBegin('name', Thrift.Type.STRING, 4); output.writeString(this.name); output.writeFieldEnd(); } if (this.num_children !== null && this.num_children !== undefined) { output.writeFieldBegin('num_children', Thrift.Type.I32, 5); output.writeI32(this.num_children); output.writeFieldEnd(); } if (this.converted_type !== null && this.converted_type !== undefined) { output.writeFieldBegin('converted_type', Thrift.Type.I32, 6); output.writeI32(this.converted_type); output.writeFieldEnd(); } if (this.scale !== null && this.scale !== undefined) { output.writeFieldBegin('scale', Thrift.Type.I32, 7); output.writeI32(this.scale); output.writeFieldEnd(); } if (this.precision !== null && this.precision !== undefined) { output.writeFieldBegin('precision', Thrift.Type.I32, 8); output.writeI32(this.precision); output.writeFieldEnd(); } if (this.field_id !== null && this.field_id !== undefined) { output.writeFieldBegin('field_id', Thrift.Type.I32, 9); output.writeI32(this.field_id); output.writeFieldEnd(); } if (this.logicalType !== null && this.logicalType !== undefined) { output.writeFieldBegin('logicalType', Thrift.Type.STRUCT, 10); this.logicalType.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; DataPageHeader = module.exports.DataPageHeader = function(args) { this.num_values = null; this.encoding = null; this.definition_level_encoding = null; this.repetition_level_encoding = null; this.statistics = null; if (args) { if (args.num_values !== undefined) { this.num_values = args.num_values; } if (args.encoding !== undefined) { this.encoding = args.encoding; } if (args.definition_level_encoding !== undefined) { this.definition_level_encoding = args.definition_level_encoding; } if (args.repetition_level_encoding !== undefined) { this.repetition_level_encoding = args.repetition_level_encoding; } if (args.statistics !== undefined) { this.statistics = args.statistics; } } }; DataPageHeader.prototype = {}; DataPageHeader.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.I32) { this.num_values = input.readI32(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.encoding = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.definition_level_encoding = input.readI32(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.I32) { this.repetition_level_encoding = input.readI32(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.STRUCT) { this.statistics = new ttypes.Statistics(); this.statistics.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; DataPageHeader.prototype.write = function(output) { output.writeStructBegin('DataPageHeader'); if (this.num_values !== null && this.num_values !== undefined) { output.writeFieldBegin('num_values', Thrift.Type.I32, 1); output.writeI32(this.num_values); output.writeFieldEnd(); } if (this.encoding !== null && this.encoding !== undefined) { output.writeFieldBegin('encoding', Thrift.Type.I32, 2); output.writeI32(this.encoding); output.writeFieldEnd(); } if (this.definition_level_encoding !== null && this.definition_level_encoding !== undefined) { output.writeFieldBegin('definition_level_encoding', Thrift.Type.I32, 3); output.writeI32(this.definition_level_encoding); output.writeFieldEnd(); } if (this.repetition_level_encoding !== null && this.repetition_level_encoding !== undefined) { output.writeFieldBegin('repetition_level_encoding', Thrift.Type.I32, 4); output.writeI32(this.repetition_level_encoding); output.writeFieldEnd(); } if (this.statistics !== null && this.statistics !== undefined) { output.writeFieldBegin('statistics', Thrift.Type.STRUCT, 5); this.statistics.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; IndexPageHeader = module.exports.IndexPageHeader = function(args) { }; IndexPageHeader.prototype = {}; IndexPageHeader.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } input.skip(ftype); input.readFieldEnd(); } input.readStructEnd(); return; }; IndexPageHeader.prototype.write = function(output) { output.writeStructBegin('IndexPageHeader'); output.writeFieldStop(); output.writeStructEnd(); return; }; DictionaryPageHeader = module.exports.DictionaryPageHeader = function(args) { this.num_values = null; this.encoding = null; this.is_sorted = null; if (args) { if (args.num_values !== undefined) { this.num_values = args.num_values; } if (args.encoding !== undefined) { this.encoding = args.encoding; } if (args.is_sorted !== undefined) { this.is_sorted = args.is_sorted; } } }; DictionaryPageHeader.prototype = {}; DictionaryPageHeader.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.I32) { this.num_values = input.readI32(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.encoding = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.BOOL) { this.is_sorted = input.readBool(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; DictionaryPageHeader.prototype.write = function(output) { output.writeStructBegin('DictionaryPageHeader'); if (this.num_values !== null && this.num_values !== undefined) { output.writeFieldBegin('num_values', Thrift.Type.I32, 1); output.writeI32(this.num_values); output.writeFieldEnd(); } if (this.encoding !== null && this.encoding !== undefined) { output.writeFieldBegin('encoding', Thrift.Type.I32, 2); output.writeI32(this.encoding); output.writeFieldEnd(); } if (this.is_sorted !== null && this.is_sorted !== undefined) { output.writeFieldBegin('is_sorted', Thrift.Type.BOOL, 3); output.writeBool(this.is_sorted); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; DataPageHeaderV2 = module.exports.DataPageHeaderV2 = function(args) { this.num_values = null; this.num_nulls = null; this.num_rows = null; this.encoding = null; this.definition_levels_byte_length = null; this.repetition_levels_byte_length = null; this.is_compressed = true; this.statistics = null; if (args) { if (args.num_values !== undefined) { this.num_values = args.num_values; } if (args.num_nulls !== undefined) { this.num_nulls = args.num_nulls; } if (args.num_rows !== undefined) { this.num_rows = args.num_rows; } if (args.encoding !== undefined) { this.encoding = args.encoding; } if (args.definition_levels_byte_length !== undefined) { this.definition_levels_byte_length = args.definition_levels_byte_length; } if (args.repetition_levels_byte_length !== undefined) { this.repetition_levels_byte_length = args.repetition_levels_byte_length; } if (args.is_compressed !== undefined) { this.is_compressed = args.is_compressed; } if (args.statistics !== undefined) { this.statistics = args.statistics; } } }; DataPageHeaderV2.prototype = {}; DataPageHeaderV2.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.I32) { this.num_values = input.readI32(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.I32) { this.num_nulls = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.num_rows = input.readI32(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.I32) { this.encoding = input.readI32(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.I32) { this.definition_levels_byte_length = input.readI32(); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.I32) { this.repetition_levels_byte_length = input.readI32(); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.BOOL) { this.is_compressed = input.readBool(); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.STRUCT) { this.statistics = new ttypes.Statistics(); this.statistics.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; DataPageHeaderV2.prototype.write = function(output) { output.writeStructBegin('DataPageHeaderV2'); if (this.num_values !== null && this.num_values !== undefined) { output.writeFieldBegin('num_values', Thrift.Type.I32, 1); output.writeI32(this.num_values); output.writeFieldEnd(); } if (this.num_nulls !== null && this.num_nulls !== undefined) { output.writeFieldBegin('num_nulls', Thrift.Type.I32, 2); output.writeI32(this.num_nulls); output.writeFieldEnd(); } if (this.num_rows !== null && this.num_rows !== undefined) { output.writeFieldBegin('num_rows', Thrift.Type.I32, 3); output.writeI32(this.num_rows); output.writeFieldEnd(); } if (this.encoding !== null && this.encoding !== undefined) { output.writeFieldBegin('encoding', Thrift.Type.I32, 4); output.writeI32(this.encoding); output.writeFieldEnd(); } if (this.definition_levels_byte_length !== null && this.definition_levels_byte_length !== undefined) { output.writeFieldBegin('definition_levels_byte_length', Thrift.Type.I32, 5); output.writeI32(this.definition_levels_byte_length); output.writeFieldEnd(); } if (this.repetition_levels_byte_length !== null && this.repetition_levels_byte_length !== undefined) { output.writeFieldBegin('repetition_levels_byte_length', Thrift.Type.I32, 6); output.writeI32(this.repetition_levels_byte_length); output.writeFieldEnd(); } if (this.is_compressed !== null && this.is_compressed !== undefined) { output.writeFieldBegin('is_compressed', Thrift.Type.BOOL, 7); output.writeBool(this.is_compressed); output.writeFieldEnd(); } if (this.statistics !== null && this.statistics !== undefined) { output.writeFieldBegin('statistics', Thrift.Type.STRUCT, 8); this.statistics.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; PageHeader = module.exports.PageHeader = function(args) { this.type = null; this.uncompressed_page_size = null; this.compressed_page_size = null; this.crc = null; this.data_page_header = null; this.index_page_header = null; this.dictionary_page_header = null; this.data_page_header_v2 = null; if (args) { if (args.type !== undefined) { this.type = args.type; } if (args.uncompressed_page_size !== undefined) { this.uncompressed_page_size = args.uncompressed_page_size; } if (args.compressed_page_size !== undefined) { this.compressed_page_size = args.compressed_page_size; } if (args.crc !== undefined) { this.crc = args.crc; } if (args.data_page_header !== undefined) { this.data_page_header = args.data_page_header; } if (args.index_page_header !== undefined) { this.index_page_header = args.index_page_header; } if (args.dictionary_page_header !== undefined) { this.dictionary_page_header = args.dictionary_page_header; } if (args.data_page_header_v2 !== undefined) { this.data_page_header_v2 = args.data_page_header_v2; } } }; PageHeader.prototype = {}; PageHeader.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; 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.uncompressed_page_size = input.readI32(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.I32) { this.compressed_page_size = input.readI32(); } else { input.skip(ftype); } break; case 4: if (ftype == Thrift.Type.I32) { this.crc = input.readI32(); } else { input.skip(ftype); } break; case 5: if (ftype == Thrift.Type.STRUCT) { this.data_page_header = new ttypes.DataPageHeader(); this.data_page_header.read(input); } else { input.skip(ftype); } break; case 6: if (ftype == Thrift.Type.STRUCT) { this.index_page_header = new ttypes.IndexPageHeader(); this.index_page_header.read(input); } else { input.skip(ftype); } break; case 7: if (ftype == Thrift.Type.STRUCT) { this.dictionary_page_header = new ttypes.DictionaryPageHeader(); this.dictionary_page_header.read(input); } else { input.skip(ftype); } break; case 8: if (ftype == Thrift.Type.STRUCT) { this.data_page_header_v2 = new ttypes.DataPageHeaderV2(); this.data_page_header_v2.read(input); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; PageHeader.prototype.write = function(output) { output.writeStructBegin('PageHeader'); if (this.type !== null && this.type !== undefined) { output.writeFieldBegin('type', Thrift.Type.I32, 1); output.writeI32(this.type); output.writeFieldEnd(); } if (this.uncompressed_page_size !== null && this.uncompressed_page_size !== undefined) { output.writeFieldBegin('uncompressed_page_size', Thrift.Type.I32, 2); output.writeI32(this.uncompressed_page_size); output.writeFieldEnd(); } if (this.compressed_page_size !== null && this.compressed_page_size !== undefined) { output.writeFieldBegin('compressed_page_size', Thrift.Type.I32, 3); output.writeI32(this.compressed_page_size); output.writeFieldEnd(); } if (this.crc !== null && this.crc !== undefined) { output.writeFieldBegin('crc', Thrift.Type.I32, 4); output.writeI32(this.crc); output.writeFieldEnd(); } if (this.data_page_header !== null && this.data_page_header !== undefined) { output.writeFieldBegin('data_page_header', Thrift.Type.STRUCT, 5); this.data_page_header.write(output); output.writeFieldEnd(); } if (this.index_page_header !== null && this.index_page_header !== undefined) { output.writeFieldBegin('index_page_header', Thrift.Type.STRUCT, 6); this.index_page_header.write(output); output.writeFieldEnd(); } if (this.dictionary_page_header !== null && this.dictionary_page_header !== undefined) { output.writeFieldBegin('dictionary_page_header', Thrift.Type.STRUCT, 7); this.dictionary_page_header.write(output); output.writeFieldEnd(); } if (this.data_page_header_v2 !== null && this.data_page_header_v2 !== undefined) { output.writeFieldBegin('data_page_header_v2', Thrift.Type.STRUCT, 8); this.data_page_header_v2.write(output); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; KeyValue = module.exports.KeyValue = function(args) { this.key = null; this.value = null; if (args) { if (args.key !== undefined) { this.key = args.key; } if (args.value !== undefined) { this.value = args.value; } } }; KeyValue.prototype = {}; KeyValue.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.STRING) { this.key = input.readString(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.STRING) { this.value = input.readString(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; KeyValue.prototype.write = function(output) { output.writeStructBegin('KeyValue'); if (this.key !== null && this.key !== undefined) { output.writeFieldBegin('key', Thrift.Type.STRING, 1); output.writeString(this.key); output.writeFieldEnd(); } if (this.value !== null && this.value !== undefined) { output.writeFieldBegin('value', Thrift.Type.STRING, 2); output.writeString(this.value); output.writeFieldEnd(); } output.writeFieldStop(); output.writeStructEnd(); return; }; SortingColumn = module.exports.SortingColumn = function(args) { this.column_idx = null; this.descending = null; this.nulls_first = null; if (args) { if (args.column_idx !== undefined) { this.column_idx = args.column_idx; } if (args.descending !== undefined) { this.descending = args.descending; } if (args.nulls_first !== undefined) { this.nulls_first = args.nulls_first; } } }; SortingColumn.prototype = {}; SortingColumn.prototype.read = function(input) { input.readStructBegin(); while (true) { var ret = input.readFieldBegin(); var fname = ret.fname; var ftype = ret.ftype; var fid = ret.fid; if (ftype == Thrift.Type.STOP) { break; } switch (fid) { case 1: if (ftype == Thrift.Type.I32) { this.column_idx = input.readI32(); } else { input.skip(ftype); } break; case 2: if (ftype == Thrift.Type.BOOL) { this.descending = input.readBool(); } else { input.skip(ftype); } break; case 3: if (ftype == Thrift.Type.BOOL) { this.nulls_first = input.readBool(); } else { input.skip(ftype); } break; default: input.skip(ftype); } input.readFieldEnd(); } input.readStructEnd(); return; }; SortingColumn.prototype.write = function(output) { output.writeStructBegin('SortingColumn'); if (this.column_idx !== null