GithubHelp home page GithubHelp logo

Comments (5)

ethe avatar ethe commented on June 15, 2024

You should always use the latest version of thriftpy2, if you could always reproduce this issue, please post a minimal case here, I would like to test it later.

from thriftpy2.

yiqijiu avatar yiqijiu commented on June 15, 2024

Thank you for your reply. I am using the last version of HappyBase with the latest version of thriftpy2 as the underlying connection to the HBase Thrift server, but encountered an error. The version of HBase Thrift is 0.14.1 and the version of HBase is 2.2.3.The following is an example of my code.

from thriftpy2.

yiqijiu avatar yiqijiu commented on June 15, 2024
import happybase

# Create a connection to the HBase using HappyBase client
connection = happybase.Connection('localhost', port=9090)

# Create a table named 'mytable'
table_name = 'mytable'
column_family = 'cf'
connection.create_table(
    table_name,
    {column_family: dict()},
)

# Get the table object for 'mytable'
table = connection.table(table_name)

# Insert a row of data into 'mytable'
table.put(b'row1', {b'cf:col1': b'value1', b'cf:col2': b'value2'})

# Get a row of data from 'mytable'
row = table.row(b'row1')
print(row[b'cf:col1'])  # output: b'value1'

# Close the connection
connection.close()

from thriftpy2.

yiqijiu avatar yiqijiu commented on June 15, 2024

Thank you, I have resolved the issue, it was my mistake. The solution was to replace the hbase.thrift of HappyBase with the one in the hbase cluster, and ensure that the connection protocol and cluster configuration are consistent. Sorry for bothering you for so long.

from thriftpy2.

aisk avatar aisk commented on June 15, 2024

``TTransportException(type=4,message='Tsocket read 0 bytes') means the server closed the TCP connection without sending anything. This will happened when the server can't under standing the request protocol (like it's not a thrift server, or have different protocol / transport config), or just got an error when processing the request and the IDL for this request have no exception assumed.

Or, this is a "502" in HTTP protocol.

from thriftpy2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.