Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-6731

FIWARE.Question.Tech.Data.BigData-Analysis.Can't connect to Cosmos to query Hive with Python or Node.js client

    Details

      Description

      Created question in FIWARE Q/A platform on 19-05-2015 at 16:05
      Please, ANSWER this question AT http://stackoverflow.com/questions/30329064/cant-connect-to-cosmos-to-query-hive-with-python-or-node-js-client

      Question:
      Can't connect to Cosmos to query Hive with Python or Node.js client

      Description:
      I am actually trying to develop a simple Node.js client, which can be used to query my Hive table on the Cosmos table .

      I first tried to use this implementation for Hive using Node.js :
      https://github.com/wdavidw/node-thrift-hive. My code is the following :

      var router = express.Router();
      var request = require('request');
      var _ = require('lodash');

      var hive = require('thrift-hive');
      // Client connection
      var client = hive.createClient({
      version: '0.7.1-cdh3u3',
      server: '130.206.80.46',
      port: 10000,
      timeout: 1000
      });
      // Execute call

      router.route('/')
      .get(function(req, res, next) {

      client.execute('use default', function(err) {
      // Query call
      client.query('select * from interserre')
      .on('row', function(database)

      { console.log(database); }

      )
      .on('error', function(err)

      { console.log(err.message); client.end(); }

      )
      .on('end', function()

      { client.end(); }

      );
      });
      })

      module.exports = router;

      I get this error:

      events.js:85
      throw er; // Unhandled 'error' event
      ^
      Error: connect ECONNREFUSED
      at exports._errnoException (util.js:746:11)
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1010:19)

      After that I tried to use the Python example (provided by the documentation just to run a simple test.

      http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/BigData_Analysis_-_User_and_Programmer_Guide#Python

      I couldn't even connect to the server.

      Could not connect to 130.206.80.46:10000

      I think the problem come from the fact that we don't provide any information that allow us to connect to the Cosmos portal. With Thrift there is no way to put your credentials. The server can't identify you're a real Cosmos user and reject your connection.

      The python was just a test. I'm actually doing a Hackaton and was planning to use Node.js to query the data that I have. Where do you think the problem come from? The module? The Cosmos Portal?

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2016-06-06 09:05|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-06-06 09:05|CREATED monitor | # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-06-06 12:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-06-06 12:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True
        Hide
        backlogmanager Backlog Manager added a comment -

        2016-06-06 15:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2016-06-06 15:05|UPDATED status: transition Answered| # answers= 1, accepted answer= True

          People

          • Assignee:
            frb Francisco Romero
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: