File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ type: application
1818# This is the chart version. This version number should be incremented each time you make changes
1919# to the chart and its templates, including the app version.
2020# Versions are expected to follow Semantic Versioning (https://semver.org/)
21- version : 1.0.7
21+ version : 1.0.8
2222
2323# This is the version number of the application being deployed. This version number should be
2424# incremented each time you make changes to the application. Versions are not expected to
Original file line number Diff line number Diff line change 4545{{- end }}
4646
4747To use Trino with Python and the `trino` client (see [full doc](https://github.com/trinodb/trino-python-client)):
48+
49+ - First of all, setup the client using the commmand line:
4850```bash
4951pip install trino
52+ export TRINO_HOSTNAME={{ include "library-chart.service-url" . | quote }}
53+ export TRINO_USERNAME={{ .Values.security.username | quote }}
54+ export TRINO_PASSWORD={{ .Values.security.password | quote }}
5055```
5156
57+ - Then, in your Python script:
5258```python
59+ import os
5360from trino.dbapi import connect
5461from trino.auth import BasicAuthentication
5562
5663conn = connect(
57- host={{ include "library-chart.service-url" . | quote }} ,
64+ host=os.getenv('TRINO_HOSTNAME') ,
5865 port="443",
59- auth=BasicAuthentication("{{ .Values.security.username }}", "{{ .Values.security.password }}" ),
66+ auth=BasicAuthentication(os.getenv('TRINO_USERNAME'), os.getenv('TRINO_PASSWORD') ),
6067 catalog="{{ first $catalogs }}",
6168 {{- if gt (len $catalogs) 1 }}
6269 # Available catalogs:
@@ -67,7 +74,6 @@ conn = connect(
6774 schema="default"
6875)
6976cur = conn.cursor()
70- print(cur.execute("CREATE TABLE IF NOT EXISTS test(key bigint)").fetchall())
7177print(cur.execute("SHOW TABLES").fetchall())
7278```
7379{{- end -}}
You can’t perform that action at this time.
0 commit comments