Closed MinuraPunchihewa closed 2 years ago
Have you tried the latest pinotdb version? This should be fixed already.
@xiangfu0 I just upgraded to pinotdb-0.4.3
and that username error does not seem to be coming up anymore. However, now I get this,
DatabaseError: Query
{'sql': 'SELECT * FROM airlineStats'} timed out: Out of -1, only -1 responded, while needed was -1
Do you know what it could be?
This is my code,
from pinotdb import connect
conn = connect(host='localhost', port=9000, path='/query/sql', scheme='http')
curs = conn.cursor()
curs.execute("SELECT * FROM airlineStats")
for row in curs:
print(row)
cc: @walterddr We will check
I've tested the current master code, seems it's working, let me cut a new release 0.4.4 then
@xiangfu0 That would be greatly appreciated. Please let me know when you make the release.
0.4.4 is published. And this is the example I'm using to test: https://github.com/python-pinot-dbapi/pinot-dbapi/blob/master/examples/pinot_quickstart_batch.py
@xiangfu0 @walterddr It seems to be working perfectly now! Thank you very much.
I will close this issue.
I was hoping that I could ask you for one more favor though. With Pinot, what is the command for getting all the available tables (equivalent of SHOW TABLES) and for getting the columns of a particular table (equivalent of SHOW TABLES IN
i dont think we support such DML DDL syntax yet. please feel free to file another github issues for these syntax (such as: SHOW TABLES
, DESCRIBE TABLE <tbl_name>
, etc)
@walterddr Sounds good. I will do that now. Is there a way to get it through the Python client? A list of tables in the database and the columns along with their types of a specific table?
you can do so by querying the REST API of pinot but that's not part of the DDL/DML, see: https://docs.pinot.apache.org/users/api/pinot-rest-admin-interface
@walterddr Ah, this is great!
But, could you please explain something to me? To get my Python client running, I had to start up my Docker instance the same way given in the example by @xiangfu0,
docker run --name pinot-quickstart -p 2123:2123 -p 9000:9000 -p 8000:8000 -d apachepinot/pinot:latest QuickStart -type batch
I have a basic idea of the components of Pinot, but could you please help me understand what these ports that we are exposing are?
just 9000 is the one you should use
@walterddr Connecting the Python client to port 9000 does not work for me. Similar to the example given, I had to use port 8000.
When I issue queries to port 9000, I get this error,
{'sql': 'SELECT * FROM baseballStats LIMIT 5'} timed out: Out of -1, only -1 responded, while needed was -1
However, to get the list of tables using the REST interface like you mentioned, I need to send the requests to port 9000.
@xiangfu0 @walterddr Any comments on this? From what I can understand, 9000 here is the port for the Controller and 8000 is the port for the Broker?
@MinuraPunchihewa correct.
@walterddr Thank you so much for all your help. I really appreciate it.
I have been trying to connect to Apache Pinot using the Python client pinotdb for quite a while now, to no avail.
I am simply running Pinot as a Docker container using the following command,
docker run -p 9000:9000 apachepinot/pinot:0.9.3 QuickStart -type hybrid
Given below is what my Python code looks like,
Every time I run this, I get the following error,
AttributeError: 'NoneType' object has no attribute '_username'
Is there a default username or password that comes with Pinot or is there some way that I can create a user? It looks like the problem is that a username is somehow required.
I realize that I this may not be the right place to raise this issue, but I have already created an issue on the pinotdb repository, but I am yet to receive a response.
Any help on this matter would be greatly appreciated.
Here is the complete stack trace of the error I am facing,