Skip to content

Presto Endpoint

Okera offers many different ways to access managed datasets. One of those options is the Presto Endpoint, which is powered by an embedded PrestoDB instance that is collocated on Okera clusters.

The following sections explain how to access the Presto endpoint information and provide example client integrations.

Endpoint Information

The System page provides the necessary information about the Presto endpoint. The two important values provided are:

  • Presto endpoint

    The embedded Presto cluster is listening to web requests at the specified HTTP(S) URL. It can be used for custom client integrations and to access the Presto WebUI. See Command-line Tools for another way to determine the Presto endpoint information.

    Note: Okera's Presto endpoint does not support HTTP/2 connections and blocks them. It supports HTTP/1.1 connections only. Some third-party tools bundle JDK into their product. In JDK 11.0 or higher, the HTTP protocol defaults to HTTP/2, rather than HTTP/1.1. So if your third-party tool installs JDK 11.0 or higher, you may see some performance problems. To resolve this conflict, you can block the HTTP/2 protocol at the load balancer, configure the Presto client to use HTTP/1.1, or configure the Presto client to use a lower version of JDK rather than the bundled version.

  • JDBC url

    This info field contains the fully-specified JDBC database connection URL. It can be used for client integrations that require JDBC details.

    The URL is constructed like so:

    Note that the <catalog-name> varies for versions of Okera: okera is used for version 2.x and newer, while recordservice is used for all 1.x versions of Okera.

With the information provided in the Okera WebUI, you can proceed to the client integration example, or keep reading the next sections for more detailed information.

Command-Line Tools

You can use the Kubernetes kubectl command line tool to get the Presto endpoint details, such as:

$ kubectl get services

For more information, see Command line tool (kubectl).

Presto WebUI

Since Presto provides its own web-based UI, you can use the provided web URL to access the coordinator interface using a web browser.

In this example is the URL for the Presto UI and can be copied to the clipboard using the icon next to the Presto endpoint heading:

Copy Endpoint To Clipboard

Before you can access the UI, you need to authenticate with a username and password from your configured corporate directory (for example, MS Active Directory):

WebUI Login

If you have authenticated successfully, you are presented with the Presto WebUI, providing details about the Presto cluster itself as well as the currently and recently executed queries:

Presto Coordinator UI

The UI is mostly informational, but could be used to debug query issues. Since it requires a certain amount of knowledge and Presto training, the UI is usually only accessible to Database Administrators or other administrative staff members.

Client Integration

Read Integrating Okera with BI tools to learn how to connect to Okera's Presto endpoint via popular SQL clients.

Presto Query Rewrite Endpoint

A dedicated API endpoint, /api/v2/query/rewrite can be used for Okera's rewrites of Presto queries. POST is the only method provided with this endpoint. There are three parameters (one required):

  • The query parameter is a required string parameter and specifies the SQL query to be authorized and rewritten.

  • The cteRewrite parameter is an optional boolean parameter. It indicates whether common table expressions should be used in the rewrite. Valid values are true and false. The default is false.

  • The dialect parameter is an optional string parameter that specifies the dialect for the SQL query (in double quotes). Valid values are "BIG_QUERY", "HIVE", "IMPALA", "PRESTO", and "SNOWFLAKE". The default is "PRESTO".

For information about any Okera API endpoint, see the Okera API documentation, available after you log into the Web UI by appending /api/v2-docs/api/ after the web UI port number (8083). For example: https://my.okera.installation:8083/api/v2-docs/api/.