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

[fiware-stackoverflow] Fiware Cosmos Hive connection with Python

    Details

      Description

      Created question in FIWARE Q/A platform on 07-09-2016 at 13:09
      Please, ANSWER this question AT https://stackoverflow.com/questions/39369236/fiware-cosmos-hive-connection-with-python

      Question:
      Fiware Cosmos Hive connection with Python

      Description:
      I´m trying to send Hive queries to Fiware Cosmos using the following Python code:

      with pyhs2.connect(host='cosmos.lab.fiware.org',port=10000,
      authMechanism="PLAIN",
      user='xxx',
      password="xxx",
      database ="xxx" ) as conn:

      print ("pyhs — %s seconds ---" % ( time.time() - start_time))
      with conn.cursor() as cur:
      print ("conn ok — %s seconds ---" % ( time.time() - start_time))
      cur.execute("add JAR /usr/local/apache-hive-0.13.0-bin/lib/json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar")

      but i get the following error:

      raceback (most recent call last):
      File "script2.py", line 40, in <module>
      database ="default" ) as conn:
      File "/usr/local/lib/python2.7/site-packages/pyhs2/_init_.py", line 7, in connect
      return Connection(*args, **kwargs)
      File "/usr/local/lib/python2.7/site-packages/pyhs2/connections.py", line 46, in _init_
      transport.open()
      File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 74, in open
      status, payload = self._recv_sasl_message()
      File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 92, in _recv_sasl_message
      header = self._trans.readAll(5)
      File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
      chunk = self.read(sz - have)
      File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 105, in read
      buff = self.handle.recv(sz)
      socket.error: [Errno 104] Connection reset by peer

      Two months ago I could connect with the same code. Any changes or solution?

      Thanks in advance.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2d 18h 53m 1 Fernando Lopez 25/May/17 9:58 AM
        In Progress In Progress Answered Answered
        1s 1 Fernando Lopez 25/May/17 9:58 AM
        Answered Answered Closed Closed
        1s 1 Fernando Lopez 25/May/17 9:58 AM
        fla Fernando Lopez made changes -
        Fix Version/s 2021 [ 12600 ]
        fla Fernando Lopez made changes -
        HD-Enabler Cosmos [ 10872 ]
        Description
        Created question in FIWARE Q/A platform on 07-09-2016 at 13:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/39369236/fiware-cosmos-hive-connection-with-python


        +Question:+
        Fiware Cosmos Hive connection with Python

        +Description:+
        I´m trying to send Hive queries to Fiware Cosmos using the following Python code:

        with pyhs2.connect(host='cosmos.lab.fiware.org',port=10000,
                                                        authMechanism="PLAIN",
                                                        user='xxx',
                                                        password="xxx",
                                                        database ="xxx" ) as conn:

                            print ("pyhs --- %s seconds ---" % ( time.time() - start_time))
                            with conn.cursor() as cur:
                                    print ("conn ok --- %s seconds ---" % ( time.time() - start_time))
                                    cur.execute("add JAR /usr/local/apache-hive-0.13.0-bin/lib/json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar")


        but i get the following error:

        raceback (most recent call last):
        File "script2.py", line 40, in &lt;module&gt;
        database ="default" ) as conn:
        File "/usr/local/lib/python2.7/site-packages/pyhs2/__init__.py", line 7, in connect
        return Connection(*args, **kwargs)
        File "/usr/local/lib/python2.7/site-packages/pyhs2/connections.py", line 46, in __init__
        transport.open()
        File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 74, in open
        status, payload = self._recv_sasl_message()
        File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 92, in _recv_sasl_message
        header = self._trans.readAll(5)
        File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
        chunk = self.read(sz - have)
        File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 105, in read
        buff = self.handle.recv(sz)
        socket.error: [Errno 104] Connection reset by peer


        Two months ago I could connect with the same code. Any changes or solution?

        Thanks in advance.
        Created question in FIWARE Q/A platform on 07-09-2016 at 13:09
        {color: red}Please, ANSWER this question AT{color} https://stackoverflow.com/questions/39369236/fiware-cosmos-hive-connection-with-python


        +Question:+
        Fiware Cosmos Hive connection with Python

        +Description:+
        I´m trying to send Hive queries to Fiware Cosmos using the following Python code:

        with pyhs2.connect(host='cosmos.lab.fiware.org',port=10000,
                                                        authMechanism="PLAIN",
                                                        user='xxx',
                                                        password="xxx",
                                                        database ="xxx" ) as conn:

                            print ("pyhs --- %s seconds ---" % ( time.time() - start_time))
                            with conn.cursor() as cur:
                                    print ("conn ok --- %s seconds ---" % ( time.time() - start_time))
                                    cur.execute("add JAR /usr/local/apache-hive-0.13.0-bin/lib/json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar")


        but i get the following error:

        raceback (most recent call last):
        File "script2.py", line 40, in &lt;module&gt;
        database ="default" ) as conn:
        File "/usr/local/lib/python2.7/site-packages/pyhs2/__init__.py", line 7, in connect
        return Connection(*args, **kwargs)
        File "/usr/local/lib/python2.7/site-packages/pyhs2/connections.py", line 46, in __init__
        transport.open()
        File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 74, in open
        status, payload = self._recv_sasl_message()
        File "/usr/local/lib/python2.7/site-packages/pyhs2/cloudera/thrift_sasl.py", line 92, in _recv_sasl_message
        header = self._trans.readAll(5)
        File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
        chunk = self.read(sz - have)
        File "/usr/local/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 105, in read
        buff = self.handle.recv(sz)
        socket.error: [Errno 104] Connection reset by peer


        Two months ago I could connect with the same code. Any changes or solution?

        Thanks in advance.
        HD-Chapter Data [ 10838 ]
        fla Fernando Lopez made changes -
        Resolution Done [ 10000 ]
        Status Answered [ 10104 ] Closed [ 6 ]
        fla Fernando Lopez made changes -
        Status In Progress [ 3 ] Answered [ 10104 ]
        fla Fernando Lopez made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        fla Fernando Lopez made changes -
        Assignee Francisco Romero [ frb ]
        backlogmanager Backlog Manager made changes -
        Field Original Value New Value
        Component/s FIWARE-TECH-HELP [ 10278 ]
        Hide
        backlogmanager Backlog Manager added a comment -

        2017-05-22 15:05|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2017-05-22 15:05|CREATED monitor | # answers= 0, accepted answer= False
        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: