1
votes

I have a web-app in Django and backend in Hbase. To access hbase I'm using Apache Phoenix to query hbase. Phoenix has jdbc drivers exposed.

How can I integrate Phoenix with Django ORM using these jdbc drivers? Can I write customer db adapter or is there any other way?

Thanks in advance.

1
If you use Django, then you should use a python database driver, not a JDBC driver. - Mark Rotteveel
You are right. But Apache Phoenix has only exposed JDBC client/drivers for its access. - SaurabhR

1 Answers

1
votes

I have also been trying to see if it is possible to extend the ORM of django to use apache phoenix. but for a start, you can checkout

JayDeBeAPI

or

phoenixdb

As an example, I was able to connect and retrieve data using the phoenixdb package.

  1. Install the package via pip install phoenixdb
  2. Run the sample code:

    import phoenixdb

    database_url = 'http://localhost:8765/?v=1.6'

    conn = phoenixdb.connect(database_url, autocommit=True)

    cursor = conn.cursor()

    cursor.execute('select * from WEB_STAT limit 1')

    rs = cursor.fetchall()

    print rs

It is important to know the version of the phoenix you are using, you can find the details in the link provided.