我已经使用thrift-hive模块将我的node.js应用程序连接到hive服务器。当我尝试运行我的node.js Web应用程序时,我的hive查询没有运行,并且没有给出任何错误。
var express = require('express');
var cmd=require('node-cmd');
var assert = require('assert');
var thrift = require('thrift');
var hive = require('thrift-hive');
//var hive = require('thrift-hive');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res) {
console.log("ruchit1");
var client = hive.createClient({
version: '0.7.1-cdh3u2',
server: '127.0.0.1',
port: 10000,
timeout: 1000
});
// Execute call
client.execute('use default', function(err){
// Query call
console.log("ruchit2");
client.query('show tables')
.on('row', function(database){
console.log(database+"ruchit3");
})
.on('error', function(err){
console.log(err.message);
client.end();
})
.on('end', function(){
client.end();
});
});
});
module.exports = router;