Valle1208
Valle1208

Reputation: 43

Apache pinot Connection

I'm new at working with Apache pinot and I would like you to help me with understanding how it works. Currently we work with AWS and in an AWS EKS Cluster, Apache Pinot was installed. I have the link/connection directly and I can use some few commands provides by swagger in the Pinot Controller Api. The controller service is exposed.

I want to work with pinotdb library in Python, as the documentation says, but when I try a little code like:

from pinotdb import connect


hosted='MyLinkConnection'
#Port=9000
Port=8098


def lambda_handler(event, context):
    conn = connect(host=hosted, port=Port, scheme='http')
    curs = conn.cursor()
    
    #curs.execute("select * from TestTable;")
    curs.execute("select * from TestTable_OFFLINE;")
    
    for row in curs:
        print(row)
    print('Gone')

This error is returned:

{
  "errorMessage": "timed out",
  "errorType": "ConnectTimeout",
  "stackTrace": [
    "  File \"/var/task/lambda_function.py\", line 15, in lambda_handler\n    curs.execute(\"select * from TestTable_OFFLINE;\")\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 490, in execute\n    **kwargs)\n",
    "  File \"/opt/python/httpx/_client.py\", line 1149, in post\n    extensions=extensions,\n",
    "  File \"/opt/python/httpx/_client.py\", line 821, in request\n    return self.send(request, auth=auth, follow_redirects=follow_redirects)\n",
    "  File \"/opt/python/httpx/_client.py\", line 912, in send\n    history=[],\n",
    "  File \"/opt/python/httpx/_client.py\", line 939, in _send_handling_auth\n    history=history,\n",
    "  File \"/opt/python/httpx/_client.py\", line 973, in _send_handling_redirects\n    response = self._send_single_request(request)\n",
    "  File \"/opt/python/httpx/_client.py\", line 1009, in _send_single_request\n    response = transport.handle_request(request)\n",
    "  File \"/opt/python/httpx/_transports/default.py\", line 218, in handle_request\n    resp = self._pool.handle_request(req)\n",
    "  File \"/var/lang/lib/python3.7/contextlib.py\", line 130, in __exit__\n    self.gen.throw(type, value, traceback)\n",
    "  File \"/opt/python/httpx/_transports/default.py\", line 77, in map_httpcore_exceptions\n    raise mapped_exc(message) from exc\n"
  ]
}

I can connect to the console if I enter to MyLinkConnection enter image description here

But I want to create a connection with pinotdb library or JDBC, always in python, can someone help me?

I already try to expose the services: controller (for console), broker, server and zookeper with their own Ports as the documentation returns.

Upvotes: 0

Views: 356

Answers (1)

fxx
fxx

Reputation: 131

Can you please check:

  1. Pinot broker service is exposed to port 8098, e.g. check health of the service should gives you ok
curl http://MyLinkConnection:8098/health
  1. Seems like you missed the path field in the connection?
conn = connect(host=hosted, port=Port, path='/query/sql', scheme='http')')

Upvotes: 0

Related Questions