Closed Ritesh955 closed 7 years ago
var assert = require('assert'); var thrift = require('thrift'); var transport = require('thrift/lib/nodejs/lib/thrift/transport'); var ThriftHive = require('thrift-hive/lib/0.7.1-cdh3u3/ThriftHive'); // Client connection var options = {username: 'username',password:'password',transport: transport.TBufferedTransport, timeout: 1000}; var connection = thrift.createConnection("hostname", 20000, options); var client = thrift.createClient(ThriftHive, connection); // Execute query client.execute('use default', function(err){ client.execute('show tables', function(err){ assert.ifError(err); client.fetchAll(function(err, databases){ if(err){ console.log(err.message); }else{ console.log(databases); } connection.end(); }); }); });
not much I can do with this information. For information, I havent tested this module for the last 3 years since all my cluster are running with Kerberos and it isn't supported by thrift the last time I checked.
var assert = require('assert'); var thrift = require('thrift'); var transport = require('thrift/lib/nodejs/lib/thrift/transport'); var ThriftHive = require('thrift-hive/lib/0.7.1-cdh3u3/ThriftHive'); // Client connection var options = {username: 'username',password:'password',transport: transport.TBufferedTransport, timeout: 1000}; var connection = thrift.createConnection("hostname", 20000, options); var client = thrift.createClient(ThriftHive, connection); // Execute query client.execute('use default', function(err){ client.execute('show tables', function(err){ assert.ifError(err); client.fetchAll(function(err, databases){ if(err){ console.log(err.message); }else{ console.log(databases); } connection.end(); }); }); });