happybase | A developer-friendly Python library to interact with Apache HBase | Object-Relational Mapping library
kandi X-RAY | happybase Summary
kandi X-RAY | happybase Summary
A developer-friendly Python library to interact with Apache HBase
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Adds a row to the table
- Send batch mutations
- Reset all mutations
- Return the column family names of this column
- Put mutations to row
- Delete row from database
- Create a batch
- Get install requirements txt
- Returns the contents of a file
- Return the contents of a file
happybase Key Features
happybase Examples and Code Snippets
Community Discussions
Trending Discussions on happybase
QUESTION
I have installed Cloudera Manager Express 5.9.0 installed HBase, with Thrift server running on port 9090 on CentOS 7.3 in a VirtualBox vm.
Please help in figuring out why I am unable to successfully interface via happybase, or help identify next steps to pursue.
I am an experienced Java programmer, learning Python. I have experience using Hbase from Java using the native interface, although not in this specific environment.
- I have validated that I can use hbase shell to create tables, insert data, etc.
- I have validated that 9090 (thrift) is listening and accepting connections.
- I think I have validated that the Thrift server is running with the same protocol/transport settings as the happybase connection parameters.
Python Script taken virtually directly from happybase howto:
...ANSWER
Answered 2017-Jan-19 at 22:20i guess you are not using the supported version of the thrift daemon.
are you sure the thrift 1 (not thrift2) daemon is used, with the right protocol and transport?
QUESTION
I am deploying a docker solution for my application. In my docker file I used multiple conda-forge to build some containers. It worked very well for some of the containers, and give an error for the other and I am sure it is not about the package, because for the same package sometimes it work and others no.
I have tried to use pip instead of conda, but that lead to other errors since I am using conda originally for all of my configuration. Also, I read that RUN conda update --all
will solve it, and for pip setup RUN pip install --upgrade setuptools
This is part of my docker file :
...ANSWER
Answered 2019-Jul-16 at 18:47Try combining the two conda install
commands into a single command: RUN conda install -c conda-forge happybase=1.1.0 requests-kerberos --yes
.
I ran into a similar issue with the install commands split up; it turns out the issue was that the first caused the python version to be upgraded, which in turn was incompatible with the conda install
command - causing the error you're seeing.
Another workaround I found was to add python 3.6.8
as another install arg. One of the packages I was installing must have had a python 3.7 dependency, forcing it to upgrade python, and breaking conda install
.
QUESTION
I'm using Happybase/python to get data from hbase and I already used some filtering, but now for some reason it won't work.
I have the filter for my scanning code goes like that :
...ANSWER
Answered 2019-Jul-12 at 14:31Good thing you thought about regex, I don't know why it doesn't work even with escaping the quotes (I hope someone who knows would explain that to us), but here is something to get you going:
QUESTION
I'm trying to perform searches by multiple prefixes at Google Cloud Bigtable with the Python SDK. I'm using read_rows
, and I can't see a good way to search by prefix explicitly.
My first option is RowSet
+ RowRange
. I'm testing three queries, and the times that I'm getting are ~1.5s, ~3.5s and ~4.2s, which are an order of magnitude slower than the searches with the Node SDK (which has a filter option) ~0.19, ~0.13, ~0.46.
The second option is using RowFilterChain
+ RowKeyRegexFilter
. Performance is terrible for two of the queries: ~3.1s, ~70s, ~75s ~0.124s, ~72s, ~69s. It looks like it's doing a full scan. This is the code section:
ANSWER
Answered 2019-May-28 at 10:49The read_rows
method have two parameters start_key
and end_key
that you can use to filter efficiently rows based on the row key (see docs). Behind the scenes, this method performs a Scan, so that's why this is probably the most efficient way to filter rows based on their row keys.
For example, let's suppose you have the following row keys in your table :
QUESTION
I am getting data from Twitter in json format using python but I am getting an error: SyntaxError: unexpected character after line continuation character
. How can I solve this?
ANSWER
Answered 2019-Apr-29 at 07:15ast.literal_eval
should receive strings. However in the KafkaConsumer Documentation it says:
message value and key are raw bytes -- decode if necessary!
So your decision in the above line to insert string
into str()
before treating it as a string was correct. However in the following line you didn't do it. I would recommend to replace that line with:
QUESTION
I'm trying to interact with hbase throght knox using Python, In python
The admin give a list of knox API endpoints for hive, hbase and spark like:
https://knox-devl.www.mysite.com:9042/gateway/MYSITEHDO/hbaseversion/cluster
Now, since I'm using Python's happybase library, my connection code is
...ANSWER
Answered 2019-Apr-04 at 09:59As you identified, the only way to talk to HBase through Knox is via HBase's REST API. Happybase is trying to connect directly to HBase via RPC, which Knox will block.
You can't use Happybase from outside a cluster with Knox enabled.
A good tutorial for using the HBase REST API with Python can be found here. In case the link ever dies, some of the most useful commands from this article are:
Look at a table's schema:
QUESTION
We are using HDP 3. We are trying to insert PDF files in one of the columns of a particular column family in Hbase table. Developing environment is python 3.6 and the hbase connector is happybase 1.1.0.
We are unable to upload any PDF file greater than 10 MB in hbase.
In hbase we have set the parameters as follows:
We get the following error:
...IOError(message=b'org.apache.hadoop.hbase.client.RetriesExhaustedWithDetailsException: Failed 1 action: org.apache.hadoop.hbase.DoNotRetryIOException: Cell with size 80941994 exceeds limit of 10485760 bytes\n\tat org.apache.hadoop.hbase.regionserver.RSRpcServices.checkCellSizeLimit(RSRpcServices.java:937)\n\tat org.apache.hadoop.hbase.regionserver.RSRpcServices.doBatchOp(RSRpcServices.java:1010)\n\tat org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicBatchOp(RSRpcServices.java:959)\n\tat org.apache.hadoop.hbase.regionserver.RSRpcServices.doNonAtomicRegionMutation(RSRpcServices.java:922)\n\tat org.apache.hadoop.hbase.regionserver.RSRpcServices.multi(RSRpcServices.java:2683)\n\tat org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos$ClientService$2.callBlockingMethod(ClientProtos.java:42014)\n\tat org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:409)\n\tat org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:131)\n\tat org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)\n\tat
ANSWER
Answered 2019-Mar-07 at 09:00You have to check the hbase source code to see what is happening:
QUESTION
EDIT: This question and answer applies to anyone who is experiencing the exception stated in the subject line: TTransportException(type=4, message='TSocket read 0 bytes'); whether or not Cloudera and/or HappyBase is involved.
The root issue (as it turned out) stems from mismatching
protocol
and/ortransport
formats on theclient-side
with what theserver-side
is implementing, and this can happen with any client/server paring. Mine just happened to be Cloudera and HappyBase, but yours needn't be and you can run into this same issue.
Has anyone recently tried using the happybase v1.1.0 (latest)
Python package to interact with Hbase
on Cloudera CDH v6.1.x
?
I'm trying various options with it, but keep getting the exception:
...ANSWER
Answered 2019-Feb-13 at 04:46After a days worth of working on this, the answer to my question is the following:
QUESTION
I get an import error when I submit a workflow with Hue, which contains a Spark-Action.
The traceback is below:
...ANSWER
Answered 2019-Feb-04 at 12:59With the help of Cloudera Support I was solved this problem in this way:
Add the below to the spark opts:
--conf spark.yarn.appMasterEnv.PYSPARK_DRIVER_PYTHON=path_to_venv --conf spark.yarn.appMasterEnv.PYSPARK_PYTHON=path_to_venv
2, The Spark Launcher also needs this environment variable set, so set this as a job property
QUESTION
I want to connect to a Kerberos secured HBase database via HappyBase (python).
The connection worked for another unsecured cluster with this settings:
...ANSWER
Answered 2018-Apr-09 at 09:17It's not supported.
In https://happybase.readthedocs.io/en/latest/api.html#connection
The host and port arguments specify the host name and TCP port of the HBase Thrift server to connect to.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install happybase
You can use happybase like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page