nopala
Version:
Impala and Hive client for Nodejs
610 lines (591 loc) • 18.1 kB
JavaScript
//
// 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 ExecStats_ttypes = require('./ExecStats_types');
var Status_ttypes = require('./Status_types');
var Types_ttypes = require('./Types_types');
var beeswax_ttypes = require('./beeswax_types');
var TCLIService_ttypes = require('./TCLIService_types');
var RuntimeProfile_ttypes = require('./RuntimeProfile_types');
var ttypes = module.exports = {};
ttypes.TImpalaQueryOptions = {
'ABORT_ON_ERROR' : 0,
'MAX_ERRORS' : 1,
'DISABLE_CODEGEN' : 2,
'BATCH_SIZE' : 3,
'MEM_LIMIT' : 4,
'NUM_NODES' : 5,
'MAX_SCAN_RANGE_LENGTH' : 6,
'MAX_IO_BUFFERS' : 7,
'NUM_SCANNER_THREADS' : 8,
'ALLOW_UNSUPPORTED_FORMATS' : 9,
'DEFAULT_ORDER_BY_LIMIT' : 10,
'DEBUG_ACTION' : 11,
'ABORT_ON_DEFAULT_LIMIT_EXCEEDED' : 12,
'COMPRESSION_CODEC' : 13,
'SEQ_COMPRESSION_MODE' : 14,
'HBASE_CACHING' : 15,
'HBASE_CACHE_BLOCKS' : 16,
'PARQUET_FILE_SIZE' : 17,
'EXPLAIN_LEVEL' : 18,
'SYNC_DDL' : 19,
'REQUEST_POOL' : 20,
'V_CPU_CORES' : 21,
'RESERVATION_REQUEST_TIMEOUT' : 22,
'DISABLE_CACHED_READS' : 23,
'DISABLE_OUTERMOST_TOPN' : 24,
'RM_INITIAL_MEM' : 25,
'QUERY_TIMEOUT_S' : 26,
'BUFFER_POOL_LIMIT' : 27,
'APPX_COUNT_DISTINCT' : 28,
'DISABLE_UNSAFE_SPILLS' : 29,
'EXEC_SINGLE_NODE_ROWS_THRESHOLD' : 30,
'OPTIMIZE_PARTITION_KEY_SCANS' : 31,
'REPLICA_PREFERENCE' : 32,
'SCHEDULE_RANDOM_REPLICA' : 33,
'SCAN_NODE_CODEGEN_THRESHOLD' : 34,
'DISABLE_STREAMING_PREAGGREGATIONS' : 35,
'RUNTIME_FILTER_MODE' : 36,
'RUNTIME_BLOOM_FILTER_SIZE' : 37,
'RUNTIME_FILTER_WAIT_TIME_MS' : 38,
'DISABLE_ROW_RUNTIME_FILTERING' : 39,
'MAX_NUM_RUNTIME_FILTERS' : 40,
'PARQUET_ANNOTATE_STRINGS_UTF8' : 41,
'PARQUET_FALLBACK_SCHEMA_RESOLUTION' : 42,
'MT_DOP' : 43,
'S3_SKIP_INSERT_STAGING' : 44,
'RUNTIME_FILTER_MAX_SIZE' : 45,
'RUNTIME_FILTER_MIN_SIZE' : 46,
'PREFETCH_MODE' : 47,
'STRICT_MODE' : 48,
'SCRATCH_LIMIT' : 49,
'ENABLE_EXPR_REWRITES' : 50,
'DECIMAL_V2' : 51,
'PARQUET_DICTIONARY_FILTERING' : 52,
'PARQUET_ARRAY_RESOLUTION' : 53,
'PARQUET_READ_STATISTICS' : 54,
'DEFAULT_JOIN_DISTRIBUTION_MODE' : 55,
'DISABLE_CODEGEN_ROWS_THRESHOLD' : 56,
'DEFAULT_SPILLABLE_BUFFER_SIZE' : 57,
'MIN_SPILLABLE_BUFFER_SIZE' : 58,
'MAX_ROW_SIZE' : 59,
'IDLE_SESSION_TIMEOUT' : 60,
'COMPUTE_STATS_MIN_SAMPLE_SIZE' : 61,
'EXEC_TIME_LIMIT_S' : 62,
'SHUFFLE_DISTINCT_EXPRS' : 63,
'MAX_MEM_ESTIMATE_FOR_ADMISSION' : 64,
'THREAD_RESERVATION_LIMIT' : 65,
'THREAD_RESERVATION_AGGREGATE_LIMIT' : 66,
'KUDU_READ_MODE' : 67,
'ALLOW_ERASURE_CODED_FILES' : 68,
'TIMEZONE' : 69,
'SCAN_BYTES_LIMIT' : 70,
'CPU_LIMIT_S' : 71,
'TOPN_BYTES_LIMIT' : 72,
'CLIENT_IDENTIFIER' : 73,
'RESOURCE_TRACE_RATIO' : 74,
'NUM_REMOTE_EXECUTOR_CANDIDATES' : 75,
'NUM_ROWS_PRODUCED_LIMIT' : 76,
'PLANNER_TESTCASE_MODE' : 77
};
var TInsertResult = module.exports.TInsertResult = function(args) {
this.rows_modified = null;
this.num_row_errors = null;
if (args) {
if (args.rows_modified !== undefined && args.rows_modified !== null) {
this.rows_modified = Thrift.copyMap(args.rows_modified, [null]);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field rows_modified is unset!');
}
if (args.num_row_errors !== undefined && args.num_row_errors !== null) {
this.num_row_errors = args.num_row_errors;
}
}
};
TInsertResult.prototype = {};
TInsertResult.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.rows_modified = {};
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 = input.readI64();
this.rows_modified[key3] = val4;
}
input.readMapEnd();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.I64) {
this.num_row_errors = input.readI64();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TInsertResult.prototype.write = function(output) {
output.writeStructBegin('TInsertResult');
if (this.rows_modified !== null && this.rows_modified !== undefined) {
output.writeFieldBegin('rows_modified', Thrift.Type.MAP, 1);
output.writeMapBegin(Thrift.Type.STRING, Thrift.Type.I64, Thrift.objectLength(this.rows_modified));
for (var kiter5 in this.rows_modified) {
if (this.rows_modified.hasOwnProperty(kiter5)) {
var viter6 = this.rows_modified[kiter5];
output.writeString(kiter5);
output.writeI64(viter6);
}
}
output.writeMapEnd();
output.writeFieldEnd();
}
if (this.num_row_errors !== null && this.num_row_errors !== undefined) {
output.writeFieldBegin('num_row_errors', Thrift.Type.I64, 2);
output.writeI64(this.num_row_errors);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TPingImpalaServiceResp = module.exports.TPingImpalaServiceResp = function(args) {
this.version = null;
this.webserver_address = null;
if (args) {
if (args.version !== undefined && args.version !== null) {
this.version = args.version;
}
if (args.webserver_address !== undefined && args.webserver_address !== null) {
this.webserver_address = args.webserver_address;
}
}
};
TPingImpalaServiceResp.prototype = {};
TPingImpalaServiceResp.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.version = input.readString();
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.webserver_address = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TPingImpalaServiceResp.prototype.write = function(output) {
output.writeStructBegin('TPingImpalaServiceResp');
if (this.version !== null && this.version !== undefined) {
output.writeFieldBegin('version', Thrift.Type.STRING, 1);
output.writeString(this.version);
output.writeFieldEnd();
}
if (this.webserver_address !== null && this.webserver_address !== undefined) {
output.writeFieldBegin('webserver_address', Thrift.Type.STRING, 2);
output.writeString(this.webserver_address);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TResetTableReq = module.exports.TResetTableReq = function(args) {
this.db_name = null;
this.table_name = null;
if (args) {
if (args.db_name !== undefined && args.db_name !== null) {
this.db_name = args.db_name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field db_name is unset!');
}
if (args.table_name !== undefined && args.table_name !== null) {
this.table_name = args.table_name;
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field table_name is unset!');
}
}
};
TResetTableReq.prototype = {};
TResetTableReq.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.table_name = input.readString();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TResetTableReq.prototype.write = function(output) {
output.writeStructBegin('TResetTableReq');
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.table_name !== null && this.table_name !== undefined) {
output.writeFieldBegin('table_name', Thrift.Type.STRING, 2);
output.writeString(this.table_name);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetExecSummaryReq = module.exports.TGetExecSummaryReq = function(args) {
this.operationHandle = null;
this.sessionHandle = null;
if (args) {
if (args.operationHandle !== undefined && args.operationHandle !== null) {
this.operationHandle = new TCLIService_ttypes.TOperationHandle(args.operationHandle);
}
if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
this.sessionHandle = new TCLIService_ttypes.TSessionHandle(args.sessionHandle);
}
}
};
TGetExecSummaryReq.prototype = {};
TGetExecSummaryReq.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 TCLIService_ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new TCLIService_ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetExecSummaryReq.prototype.write = function(output) {
output.writeStructBegin('TGetExecSummaryReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 2);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetExecSummaryResp = module.exports.TGetExecSummaryResp = function(args) {
this.status = null;
this.summary = null;
if (args) {
if (args.status !== undefined && args.status !== null) {
this.status = new TCLIService_ttypes.TStatus(args.status);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
}
if (args.summary !== undefined && args.summary !== null) {
this.summary = new ExecStats_ttypes.TExecSummary(args.summary);
}
}
};
TGetExecSummaryResp.prototype = {};
TGetExecSummaryResp.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 TCLIService_ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.summary = new ExecStats_ttypes.TExecSummary();
this.summary.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetExecSummaryResp.prototype.write = function(output) {
output.writeStructBegin('TGetExecSummaryResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.summary !== null && this.summary !== undefined) {
output.writeFieldBegin('summary', Thrift.Type.STRUCT, 2);
this.summary.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetRuntimeProfileReq = module.exports.TGetRuntimeProfileReq = function(args) {
this.operationHandle = null;
this.sessionHandle = null;
this.format = 0;
if (args) {
if (args.operationHandle !== undefined && args.operationHandle !== null) {
this.operationHandle = new TCLIService_ttypes.TOperationHandle(args.operationHandle);
}
if (args.sessionHandle !== undefined && args.sessionHandle !== null) {
this.sessionHandle = new TCLIService_ttypes.TSessionHandle(args.sessionHandle);
}
if (args.format !== undefined && args.format !== null) {
this.format = args.format;
}
}
};
TGetRuntimeProfileReq.prototype = {};
TGetRuntimeProfileReq.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 TCLIService_ttypes.TOperationHandle();
this.operationHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRUCT) {
this.sessionHandle = new TCLIService_ttypes.TSessionHandle();
this.sessionHandle.read(input);
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.I32) {
this.format = input.readI32();
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetRuntimeProfileReq.prototype.write = function(output) {
output.writeStructBegin('TGetRuntimeProfileReq');
if (this.operationHandle !== null && this.operationHandle !== undefined) {
output.writeFieldBegin('operationHandle', Thrift.Type.STRUCT, 1);
this.operationHandle.write(output);
output.writeFieldEnd();
}
if (this.sessionHandle !== null && this.sessionHandle !== undefined) {
output.writeFieldBegin('sessionHandle', Thrift.Type.STRUCT, 2);
this.sessionHandle.write(output);
output.writeFieldEnd();
}
if (this.format !== null && this.format !== undefined) {
output.writeFieldBegin('format', Thrift.Type.I32, 3);
output.writeI32(this.format);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};
var TGetRuntimeProfileResp = module.exports.TGetRuntimeProfileResp = function(args) {
this.status = null;
this.profile = null;
this.thrift_profile = null;
if (args) {
if (args.status !== undefined && args.status !== null) {
this.status = new TCLIService_ttypes.TStatus(args.status);
} else {
throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, 'Required field status is unset!');
}
if (args.profile !== undefined && args.profile !== null) {
this.profile = args.profile;
}
if (args.thrift_profile !== undefined && args.thrift_profile !== null) {
this.thrift_profile = new RuntimeProfile_ttypes.TRuntimeProfileTree(args.thrift_profile);
}
}
};
TGetRuntimeProfileResp.prototype = {};
TGetRuntimeProfileResp.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 TCLIService_ttypes.TStatus();
this.status.read(input);
} else {
input.skip(ftype);
}
break;
case 2:
if (ftype == Thrift.Type.STRING) {
this.profile = input.readString();
} else {
input.skip(ftype);
}
break;
case 3:
if (ftype == Thrift.Type.STRUCT) {
this.thrift_profile = new RuntimeProfile_ttypes.TRuntimeProfileTree();
this.thrift_profile.read(input);
} else {
input.skip(ftype);
}
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
TGetRuntimeProfileResp.prototype.write = function(output) {
output.writeStructBegin('TGetRuntimeProfileResp');
if (this.status !== null && this.status !== undefined) {
output.writeFieldBegin('status', Thrift.Type.STRUCT, 1);
this.status.write(output);
output.writeFieldEnd();
}
if (this.profile !== null && this.profile !== undefined) {
output.writeFieldBegin('profile', Thrift.Type.STRING, 2);
output.writeString(this.profile);
output.writeFieldEnd();
}
if (this.thrift_profile !== null && this.thrift_profile !== undefined) {
output.writeFieldBegin('thrift_profile', Thrift.Type.STRUCT, 3);
this.thrift_profile.write(output);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};