Skip to content

Commit

Permalink
[Trino] Update Trino integration guide in Hue (#3943)
Browse files Browse the repository at this point in the history
* [Trino] Update Trino integration guide in Hue

* remove concurrency flag

* remove links giving 403

---------

Co-authored-by: Harsh Gupta <42064744+Harshg999@users.noreply.github.com>
  • Loading branch information
agl29 and Harshg999 authored Jan 9, 2025
1 parent 5b20c54 commit e119138
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,49 +175,29 @@ Currently just substitute 'presto' with 'trino' or vice versa.

### Trino

Fork of PrestoSQL (hence still having 'presto' name in several parameters).
To support Trino in Hue, we're leveraging the official [Trino Python client](https://github.com/trinodb/trino-python-client)

Install at least the 0.6.2 version of pyhive from https://github.com/gethue/PyHive or https://github.com/dropbox/PyHive
Install at least the 0.329.0 version of trino from https://github.com/trinodb/trino-python-client or https://pypi.org/project/trino/

./build/env/bin/pip install pyhive

Then give Hue the information about the database source following the `trino://{trino-coordinator}:{port}/{catalog}/{schema}` format:

[[[presto]]]
name = Trino
interface=sqlalchemy
options='{"url": "trino://localhost:8080/tpch/default"}'

**Note**: keep `[[[presto]]]` if not using the [connectors](/administrator/configuration/connectors/#connectors).

With impersonation:

options='{"url": "trino://localhost:8080/tpch/default", "has_impersonation": true}'
./build/env/bin/pip install trino

With Kerberos:
Then give Hue the information about the trino cluster:

options='{"url": "trino://localhost:8080/tpch/default?KerberosKeytabPath=/path/to/keytab&KerberosPrincipal=principal&KerberosRemoteServiceName=service&protocol=https"'
[[[trino]]]
name=Trino
interface=trino
options='{"url": "http://localhost:8080"}'

With credentials:

options='{"url": "trino://username:password@localhost:8080/tpch/default"}'

With LDAPS enabled over HTTPS:

options='{"url": "trino://username:password@localhost:8443/tpch/default","connect_args":"{\"protocol\": \"https\"}"}'
options='{"url": "http://localhost:8080", "auth_username": "", "auth_password":""}'

Pass Trino Session properties along with HTTPS:
With password script:

options='{"url": "trino://username:password@localhost:8443/tpch/default","connect_args":"{\"protocol\": \"https\", \"session_props\": {\"query_max_run_time\": \"1m\"}}"}'

Pass Trino Session Properties without HTTPS enabled:

options='{"url": "trino://username:password@localhost:8080/tpch/default","connect_args":"{\"session_props\": {\"query_max_run_time\": \"1m\"}}"}'
options='{"url": "http://localhost:8080", "auth_username": "", "auth_password_script":""}'

**Note**
In the past Hue did not use trino specific dialect of SQLAlchemy which may lead to a *catalog must be specified* error. This can be solved by setting `protocol.v1.alternate-header-name=Presto` in the Trino's configuration. More details about his can be found at [Migrating from PrestoSQL to Trino](https://trino.io/blog/2021/01/04/migrating-from-prestosql-to-trino.html)

Also give a try to https://github.com/dungdm93/sqlalchemy-trino for the 'trino://' and avoiding the [old protocol issue](https://github.com/dropbox/PyHive/issues/378).
Currently, only [basic LDAP authentication](https://github.com/trinodb/trino-python-client?tab=readme-ov-file#basic-authentication) using username and password or password script is supported. Alternatively, you can establish unsecured Trino connections.


### Oracle
Expand Down Expand Up @@ -606,7 +586,7 @@ Then give Hue the information about the database source:
Alternative:
Vertica’s JDBC client drivers can be downloaded here: [Vertica JDBC Client Drivers](http://my.vertica.com/download/vertica/client-drivers/). Be sure to download the driver for the right version and OS.
Be sure to download the Vertica’s JDBC client driver for the right version and OS.
[[[vertica]]]
name=Vertica JDBC
Expand Down Expand Up @@ -1008,7 +988,7 @@ Hue's filebrowser can now allow users to explore, manage, and upload data in an
Read more about it in the [S3 User Documentation](/user/browsing#s3).
In order to add an S3 account to Hue, you'll need to configure Hue with valid S3 credentials, including the access key ID and secret access key: [AWSCredentials](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSGettingStartedGuide/AWSCredentials.html)
In order to add an S3 account to Hue, you'll need to configure Hue with valid S3 credentials, including the access key ID and secret access key.
These keys can securely stored in a script that outputs the actual access key and secret key to stdout to be read by Hue (this is similar to how Hue reads password scripts). In order to use script files, add the following section to your hue.ini configuration file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Continue to the [next sections](/administrator/installation/dependencies/) for d
You can also find distributions of Hue via these companies:

* [Cloudera Data Platform - Hue](https://www.cloudera.com/products/cloudera-data-platform.html)
* [Amazon AWS EMR - Hue](https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-hue.html)
* Amazon AWS EMR - Hue
* [Google Cloud Dataproc - Hue](https://github.com/GoogleCloudPlatform/dataproc-initialization-actions/tree/master/hue)
* [Azure HDInsight - Hue](https://docs.microsoft.com/en-us/azure/hdinsight/hdinsight-hadoop-hue-linux)
* Open Data Hub - Data Catalog
2 changes: 1 addition & 1 deletion docs/docs-site/content/releases/release-notes-4.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ List of 900+ Commits
* dc2febd HUE-3287 [core] Django 1.11 upgrade - To upgrade Django 1.11, following changes are needed:
* 7e419c2 HUE-3287 [core] Django 1.11 upgrade - Adding PyYAML-3.12 colorama-0.3.2 docutils-0.14 nose-1.3.7 openpyxl-2.5.3 repoze.who-2.3 wheel-0.31.0 zope.interface-4.5.0 python modules
* 386b2b7 HUE-3287 [core] Django 1.11 upgrade - Fixing navigator error
* a96e334 HUE-3287 [core] Django 1.11 upgrade - fixing django-openid-auth-0.14/django_openid_auth/models.py from registering BLOB (Large object) with 2048 char length see https://stackoverflow.com/questions/44358506/sql-error-1170
* a96e334 HUE-3287 [core] Django 1.11 upgrade - fixing django-openid-auth-0.14/django_openid_auth/models.py from registering BLOB (Large object) with 2048 char length
* 64ff0d2 HUE-3287 [core] Django 1.11 upgrade - Reverting to requests-kerberos-0.6.1
* 5ad587f HUE-3287 [core] Django 1.11 upgrade - Upgrading following modules: - avro-1.8.2 - backports.csv-1.0.5 - configobj-5.0.6 - cryptography-2.1.4 - defusedxml-0.5.0 - django-openid-auth-0.14 - djangosaml2-0.16.11 - elementtree-1.2.6-20050316 - enum34-1.1.6
* 3186126 HUE-3287 [core] Django 1.11 upgrade - Fixing Hue Port :8888 and :8889 access issue
Expand Down
2 changes: 0 additions & 2 deletions docs/docs-site/content/releases/release-notes-4.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ First, the support of many SQL dialects has been improved, with in particular Ap
* [Query live HBase data with Phoenix SQL](https://gethue.com/blog/querying-live-kafka-data-in-apache-hbase-with-phoenix/)
* [Getting started with the Spark SQL Editor](https://gethue.com/blog/querying-spark-sql-with-spark-thrift-server-and-hue-editor/)

!["Flink SQL - SELECT and INSERT data into Kafka Topics"](https://cdn.gethue.com/uploads/2021/02/peek-log-streams.gif)

The Editor is also getting split up into components, so that they are cleaner and easier to reuse (e.g. SQL parsers, SQL Scratchpad...). This will bring a new version of the Editor, which is currently in beta. Another improvement in the introduction of the Connectors (in beta too) so that SQL dialects can be easily added without any server restart.

Secondly, special thanks to the community who contributed a brand new Dask SQL autocomplete (ISSUE-1480) and also Prometheus Alerting for Kubernetes (PR-1648).
Expand Down
3 changes: 1 addition & 2 deletions tools/ci/check_for_website_dead_links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ if [ "$?" -eq "0" ];
|http://demo.gethue.com*|https://twitter.com/gethue|https://github.com*|https://cdn.gethue.com/downloads/*|https://pypi.org*" \
--ignore-fragments \
--timeout 15 \
--buffer-size 8192 \
--concurrency 10
--buffer-size 8192
LINT_EXIT_CODE=$?

kill $HUGO_PID
Expand Down

0 comments on commit e119138

Please sign in to comment.