Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Trino REST API on availability on Dataproc

Is the Trino REST API available on Dataproc?
As described here  it would be expected at /v1/statement on the base trino server URL.
On the Dataproc Trino Component Gateway this giving a 404 error.

Am following the example of accessing a Component Gateway api  for Knox and adapting for Trino.

I have a Dataproc cluster running with the Trino optional component.
Obtained the Component Gateway base url for Trino as https://xxxxxxxxxxx-dot-us-east1.dataproc.googleusercontent.com/trino/

Posting to https://xxxxxxxxxxx-dot-us-east1.dataproc.googleusercontent.com/trino/v1/statement
I am passing a Proxy-authorization header as in the example.

Response is

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<title>Error 404 Not Found</title>
</head>

<body>
<h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr>
<th>URI:</th>
<td>/ui/v1/statement</td>
</tr>
<tr>
<th>STATUS:</th>
<td>404</td>
</tr>
<tr>
<th>MESSAGE:</th>
<td>Not Found</td>
</tr>
<tr>
<th>SERVLET:</th>
<td>org.glassfish.jersey.servlet.ServletContainer-2c70a1de</td>
</tr>
</table>

</body>

</html>

 

This suggests the Component Gateway maybe set up to access the trino UI.

Does anyone have any experience with this, or know if the Trino REST API is available at some other endpoint?

0 1 170
1 REPLY 1

Hi harryotway,

Welcome to the Google Cloud Community!

The reason you're seeing the 404 is that the Component Gateway is set up to route requests to the Trino UI, not the full Trino API.

Here are some approaches that might help in accessing the Trino Rest API:

  • By using the gcloud compute ssh command, you can create an SSH tunnel that forwards a port on your local machine (such as port 8080) to the Trino coordinator’s port, which is typically also 8080. This allows you to access the API at ‘http: //localhost:8080/v1/statement’. Keep in mind that the SSH session must remain open for the tunnel to function properly.
  • If your application is running within the same Dataproc cluster or on a peered VPC, you can access the Trino API using the internal IP address of the master node along with the Trino port, typically 8080. The URL would look like ‘http://<master-node-internal-ip>:8080/v1/statement’, providing secure access within the private network of your cluster.
  • To improve security, scalability, and API management for handling production-level traffic, you may implement a dedicated API gateway service like Google Cloud’s API Gateway or Cloud Endpoints.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.