Using the Trino command-line interface

The Trino command-line interface (CLI) provides a terminal-based, interactive shell for running queries. The CLI is a self-executing JAR file and acts like a normal UNIX executable.

  1. Log in to the Cloudera web interface and navigate to the Cloudera Data Warehouse service.
  2. In the Overview page of Cloudera Data Warehouse, click See More in the Resources and Downloads tile.
  3. Select Trino CLI and click to download the trino-cli-executable.jar file.
  4. Save the trino-cli-executable.jar file and make it an executable file by running the following command:
    chmod +x trino-cli-executable.jar
  5. In the Cloudera Data Warehouse service Overview page, for the Virtual Warehouse you want to connect to the client, click and select Copy Trino URL.
  6. Paste the copied Trino URL in a text file, to be used in later steps.
  7. Open a terminal window to start Trino CLI. You can run the following command to check the version of the CLI:
    ./trino --version

    Run the CLI with --help or -h to see all available options.

  8. To start the Trino CLI in an interactive mode, specify the URL of the Trino coordinator that you copied earlier.
    ./trino http://trino.example.com:8080
    This starts an interactive shell where you can connect to Trino and run SQL queries.