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

        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        backlogmanager Backlog Manager made changes -
        Summary [fiware-stackoverflow] Can't connect to Cosmos to query Hive with Python or Node.js client FIWARE.Question.Tech.Data.BigData-Analysis.Can't connect to Cosmos to query Hive with Python or Node.js client
        HD-Node Unknown [ 10852 ]
        frb Francisco Romero made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        backlogmanager Backlog Manager made changes -
        Assignee Francisco Romero [ frb ]
        backlogmanager Backlog Manager made changes -
        HD-Chapter Unknown [ 10845 ] Data [ 10838 ]
        mev Manuel Escriche made changes -
        HD-Enabler Unknown [ 10910 ] Cosmos [ 10872 ]
        backlogmanager Backlog Manager made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        backlogmanager Backlog Manager made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        backlogmanager Backlog Manager made changes -
        HD-Enabler Unknown [ 10910 ]
        HD-Chapter Unknown [ 10845 ]
        HD-Node Unknown [ 10852 ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        backlogmanager Backlog Manager created issue -

          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: