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 System page provides the necessary information about the Presto endpoint. The two important values provided are:
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.
The URL is constructed like so:Note that the
<catalog-name>varies for versions of Okera:
okerais used for version 2.x and newer, while
recordserviceis 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.
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).
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
https://odas.it-infra.corp.internal:14050 is the URL for the Presto UI and can be copied to the clipboard using the icon next to the Presto endpoint heading:
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):
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:
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.
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):
queryparameter is a required string parameter and specifies the SQL query to be authorized and rewritten.
cteRewriteparameter 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.
dialectparameter is an optional string parameter that specifies the dialect for the SQL query (in double quotes). Valid values are
"SNOWFLAKE". The default is
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: