Search code examples
javaprestotrino

Presto Rest API [ in Presto version 333]


In the older version of Presto it was easy to access http://localhost:8080/v1/query/ URL either get or post.

In Presto version 333 when same URL try to access it will give error as MESSAGE: Method Not Allowed [STATUS:405] even if we try to send POST request with header X-Presto-User:

Did presto changes REST API URLs in new version?


Solution

  • I suggest you verify first that you can run the same query with the same user with either the Trino (formerly Presto) CLI or with an application connected via the JDBC driver.

    Beyond that you should probably use /v1/statement. More details about the REST API can be found in the documentation. Just keep in mind that you are much better off using the CLI or JDBC driver as a supported API. Or any other client (go, python...)