imjuni / jshs2

jsHS2 is a node.js client driver for hive server 2
http://imjuni.github.io/jshs2/
MIT License
34 stars 12 forks source link

Not able to connect to db #20

Open Kiran-Shinde opened 6 years ago

Kiran-Shinde commented 6 years ago

I am using node 6.1.0 And jshs2 0.4.4

And here is my code

` var serverConf = require("jshs2");

var Configuration = serverConf.Configuration;
var HiveConnection = serverConf.HiveConnection;
var IDLContainer = serverConf.IDLContainer;

var options = {
"auth": 'NOSASL',
"host": 'myserver',
"port": 10000,
"timeout": 100,
"username": 'abc',
"password": 'abc'
}

 const hiveConfig = new Configuration(options);
 const idl = new IDLContainer();

 function main() {
   idl.initialize(hiveConfig).then(function(data) {
         var connection = new HiveConnection(hiveConfig, idl);
        var cursor = connection.connect().then(function() {
          console.log("success");
        // var res = cursor.execute('SELECT * FROM employees LIMIT 10');

        // if (res.hasResultSet) {
        //  cursor.fetchBlock().then(function(fetchResult) {
        //      for (var i = 0; i < fetchResult.rows.length; i++) {
        //          console.log(fetchResult.rows[i])
        //      }
        //  })
        // }

        // cursor.close();
        // connection.close();
         }, function() {
             console.log("error");
         });

  })

}

main();`

All I am getting in console is either 'error' or nothing. Any idea what will be the problem?

y0uzha commented 6 years ago

same problem. is there any solution to solved this please?

MrLugh commented 4 years ago

same problem here...

lenchv commented 4 years ago

It seems the library is abandoned. Please, try this one hive-driver, it should work better.