I'm working with Pinotdb library for python and I want to query my database sample. I can see the UI and see the tables, now I want to code it.
I have pinot installed in an AWS EKS cluster, and I exposed port 9000 and 8099 for services pinot-controller and pinot-broker.
I have a simple code following the documentation link but It always gives me this error:
{
"errorMessage": "Query\n\n{'sql': 'select * from testing limit 10'} timed out: Out of -1, only -1 responded, while needed was -1",
"errorType": "DatabaseError",
"stackTrace": [
" File \"/var/task/lambda_function.py\", line 13, in lambda_handler\n cursor.execute(query)\n",
" File \"/opt/python/pinotdb/db.py\", line 57, in g\n return f(self, *args, **kwargs)\n",
" File \"/opt/python/pinotdb/db.py\", line 492, in execute\n return self.normalize_query_response(query, r)\n",
" File \"/opt/python/pinotdb/db.py\", line 411, in normalize_query_response\n input_query, num_servers_queried, num_servers_responded\n",
" File \"/opt/python/pinotdb/db.py\", line 368, in check_sufficient_responded\n f\"Query\\n\\n{query} timed out: Out of {queried}, only\"\n"
]
}
My code is:
from pinotdb import connect
hosted='MyHost/'
def lambda_handler(event, context):
connection = connect(host=hosted, port=9000, scheme='http', timeout=50)
cursor = connection.cursor()
# Execute a select
query = "select * from testing limit 10"
cursor.execute(query)
I already try with all the ports that my services have:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
pinot-broker ClusterIP IP <none> 8099/TCP 56d
pinot-broker-external ClusterIP IP <none> 8099/TCP 56d
pinot-broker-headless ClusterIP None <none> 8099/TCP 56d
pinot-controller ClusterIP IP <none> 9000/TCP 56d
pinot-controller-external ClusterIP IP <none> 9000/TCP 56d
pinot-controller-headless ClusterIP None <none> 9000/TCP 56d
pinot-server ClusterIP IP <none> 8098/TCP,80/TCP 56d
pinot-server-headless ClusterIP None <none> 8098/TCP,80/TCP 56d
pinot-zookeeper ClusterIP IP <none> 2181/TCP,2888/TCP,3888/TCP 56d
pinot-zookeeper-headless ClusterIP None <none> 2181/TCP,2888/TCP,3888/TCP 56
Can someone help me?
